arxanas / git-branchless

High-velocity, monorepo-scale workflow for Git
Apache License 2.0
3.43k stars 84 forks source link

feat(revsets): add `merges()` and allow `branches()` to filter branch names #1130

Closed claytonrcarter closed 8 months ago

claytonrcarter commented 10 months ago
claytonrcarter commented 10 months ago

branches() needs more work; it's currently mush slower that I would expect, and it seems to not match some branchs (at least it didn't match all the branches I expected when I used it to push these recent PRs)

For example, on my copy of the git-branchless repo, I have approx 1600 commits and 7 branches, as follows:

⋮
◆ 5871499 2h (ᐅ master) Change 'suggest' to 'discuss'
┣━┓
┃ ◯ 2bd4827 5s (crc/submit-dry-run) feat(submit): add --dry-run flag
┣━┓
┃ ◯ 306e9b4 5s (crc/fix-status-spaces, local) fix(status): rudimentary support for filenames with spaces
┣━┓
┃ ◯ 9661224 5s (crc/sync-resolve-stack) feat(sync): resolve revset arguments to their entire stacks
┣━┓
┃ ⊘ 2 omitted commits
┃ ⋮
┃ ◯ 620a061 5s (move-fixup-on-disk) temp(on disk fixup): Try to fix abandoned branches
⋮
⊘ 1 omitted commit
⋮
◯ fa5342c 5s (crc/revsets) feat(revset): allow branches() to accept a text pattern

Running git sl 'branches(crc)' takes around 3s to run, and seems to process every commit in the repo. Also, git submit 'branches(crc)' --dry-run doesn't match/report the crc/fix-status-spaces branch, which I'm currently assuming has something to do w/ the other branch that points to that commit. (Hmm, on second thought, perhaps that's an issue w/ the implementation of #1129?) Edit: nope, that was a separate issue #1131

claytonrcarter commented 10 months ago

Running git sl 'branches(crc)' takes around 3s to run, and seems to process every commit in the repo.

This was my misunderstanding of how revset Matchers work. I hadn't connected that they work on all visible commits, and there is currently no way to restrict that. (This is the first revset feature – that I can tell – that would make any sense to operate on anything other than all visible commits, because we know that branches are (probably) a subset of visible commits.)

claytonrcarter commented 8 months ago

Sorry, I lost track of this. As I recall, I have addressed the review as best I could figure out; see my comments from 11/13. I think I just forgot to un-draft this after doing so. Thank you!

claytonrcarter commented 8 months ago

Looks good pending a few comments!

Great, thank you!