-
-
Notifications
You must be signed in to change notification settings - Fork 95
feat(revset): add + as shortcut for "only child" #1461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
23f0dae
to
b625b17
Compare
Sorry, haven't had time to go through my pending PRs yet. Generally speaking, I would want to be consistent with jj's revset language where possible, since git-branchless is probably a gateway to jj for many users. |
OK, for now I have reimplemented this to use If I can get my head around the union conflict and the lalrpop grammar, I would prefer to implement it to mimic |
23d181c
to
f87823a
Compare
b2ae341
to
f0fd6b2
Compare
f0fd6b2
to
c5b8242
Compare
c5b8242
to
def2fa7
Compare
This will be used to circumvent the "autocheckout" setting in `git split` (in the next commit), so that we can preserve the current detached/attached state. FIXME is this really needed? Maybe we don't need to force-re-checkout?
But only when no message is explicitly supplied. This is a breaking change. Previously, the user would be prompted for a message if none was supplied.
eg `@!`, `abc123!`, `current(foo)!`, etc
def2fa7
to
bec223c
Compare
This adds
+
as a postfix revset operator that evaluates tosole(children(...))
. I chose+
because it matches the similar operator injj
revsets, but I didn't add-
for symmetry because I didn't feel the need since we already have~
and^
.Note that I chose
sole(...)
because I have found that I (almost?) always wanted this shorthand in cases where there is only 1 child, and if I wanted all children, I could reach for the regularchildren(...)
function. I don't think I care about this that strongly, though, and I'd be OK to removesole(...)
if preferred.Handy use cases:
+
or++
instead of copying the commit you really want :)git move -s prev-branch+ -d main
git next
:git sw @+