Re: Using two-dot range notation in `git rebase`?

2 messages, 2 authors, 2021-07-29 · open the first message on its own page

Re: Using two-dot range notation in `git rebase`?

From: Junio C Hamano <hidden>
Date: 2021-07-29 17:14:07

Jeff King [off-list ref] writes:
long as there is only one negative tip given, that becomes the "--onto"
point).
So "git newbase [--options] A..B" would

 - checks if B names an existing branch or just a commit

 - detaches HEAD at commit A

 - replays commits in DAG A..B on top of it; the exact way the
   history is replayed is affected by the options given (e.g. "-m"
   and "-p" may try to preserve history shapes)

 - if B was determined to be a branch name, "git branch -f" to it;
   otherwise leave the HEAD detached.

which all sounds OK, but I do not see a huge improvement over the
current "git rebase [--options] A B" (other than that you can type
double dot instead of a single space).

Re: Using two-dot range notation in `git rebase`?

From: Jeff King <hidden>
Date: 2021-07-29 17:29:30

On Thu, Jul 29, 2021 at 10:13:59AM -0700, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
long as there is only one negative tip given, that becomes the "--onto"
point).
So "git newbase [--options] A..B" would

 - checks if B names an existing branch or just a commit

 - detaches HEAD at commit A

 - replays commits in DAG A..B on top of it; the exact way the
   history is replayed is affected by the options given (e.g. "-m"
   and "-p" may try to preserve history shapes)

 - if B was determined to be a branch name, "git branch -f" to it;
   otherwise leave the HEAD detached.

which all sounds OK, but I do not see a huge improvement over the
current "git rebase [--options] A B" (other than that you can type
double dot instead of a single space).
Yeah, I don't see it as a huge benefit either.

Potentially it opens the door for stuff like:

  git rebase ^A B C D

but I am not sure if that is helpful or horrifying. ;)

(To be clear, I am not necessarily advocating any of this, but just
thinking aloud of possibilities. And I'm definitely not planning to work
on it myself.)

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help