CARVIEW |
Navigation Menu
-
-
Notifications
You must be signed in to change notification settings - Fork 98
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.
All reactions
-
Yep, that should be like the "Hide any commits in the current stack which arenβt on a branch" example. You just need to write |
Beta Was this translation helpful? Give feedback.
All reactions
-
π 1
-
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.
All reactions
-
@arxanas Is the order of commits from I'm wondering because with a workflow where I'm linting files in a stack for issues, I want to find the first commit that introduces a problem, so that I can fix it at source. So it seems like I can just do Also, something I've found useful is to use a revset expression with smartlog to filter its output. Doing that is a good way to experiment with expressions, as it's easy to compare the filtered output with the default output to work out what your query is doing. |
Beta Was this translation helpful? Give feedback.
All reactions
-
I asked a similar question in discord last month and @arxanas answer suggests that the order may be consistent but is not defined. I briefly played with adding a |
Beta Was this translation helpful? Give feedback.
All reactions
-
Thanks @claytonrcarter, that's useful. I guess I'll quote what @arxanas said here for anyone not in Discord (you have to join the server to view your link):
|
Beta Was this translation helpful? Give feedback.
All reactions
-
@h4l The intermediate results of the revsets are not sorted or guaranteed to be in a particular order, but In principle, the results of evaluating the revset when passed to other functions ( |
Beta Was this translation helpful? Give feedback.
All reactions
-
Perfect, thanks @arxanas! |
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
All reactions
-
Thanks for the correction. I've updated the post. By the way, you can use |
Beta Was this translation helpful? Give feedback.
All reactions
-
Oh nice! I'll have a look at that one. The |
Beta Was this translation helpful? Give feedback.
All reactions
-
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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