Revset recipes #496
Replies: 4 comments 10 replies
-
Is it possible to query for commits that aren't on any branch? I tried |
Beta Was this translation helpful? Give feedback.
-
This is a nice feature. I needed to run tests for each commit in my current WIP chain of commits to make sure none of the intermediate commits are in a broken state. Let me know if there's a more idiomatic way to do this, but I came up with this:
Could easily tweak the query to use this approach to run something for all draft commits rather than just the immediate ancestors. |
Beta Was this translation helpful? Give feedback.
-
Wow these are epic! A couple quick typos in Force push all branches in the current stack: it uses a bad quote and is missing a closing paren. It should be:
|
Beta Was this translation helpful? Give feedback.
-
For the git-imerge one, I think the following is a bit more precise, as your query could sometimes pick things up that end up in a branch, and misses some things as well:
|
Beta Was this translation helpful? Give feedback.
-
git-branchless v0.4.0 supports revset expressions for many commands. Here's a few examples of useful things you can do with revsets. Feel free to add your own recipes in the comments.
Move all other draft commits on top of this commit
Hide commits generated by imerge
As per #380.
“Drop” commits rather than hide them
As per #48 (reply in thread).
Insert a commit into a stack:
As per #478.
Separate all commits in this stack for a given ticket into their own stack
This is kind of like
git-branchstack
.Move all commits touching a class of files to the top of this stack
Force push all branches in the current stack
As per #45 (reply in thread).
Note that this can be accomplished with the
git submit
command, inmaster
at the time of this writing.Find out about recently-upgraded dependencies, excluding Dependabot commits
Hide any commits in the current stack which aren’t on a branch
Delete any draft branches which weren’t created by me
Beta Was this translation helpful? Give feedback.
All reactions