git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Itches with the current rev spec

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 26, 2013, 17:49 UTC
Message-ID
<7v7gjpxjw0.fsf@alter.siamese.dyndns.org>
In-Reply-To
<517A3E47.6010606@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> writes:
Show 9 quoted lines
> Allow alternative spelling of
>
>    git rebase -i master topic
>
> like this:
>
>    git rebase -i master..topic
>
> (as always, the default for topic is HEAD).
I actually made this typo a few times in the past.

In a single-strand-of-pearls history, what rebase operates on is clearly a _range_ with a defined linear order of commits, and master..topic is a natural way to express it.

And rebase not just needs the range that defines the set of commits to be replayed, but also needs the commit on top of which they are replayed. It is natural to take ^master as that commit, and it is useful when you are trying to catch up with that branch.

The reason you would use "rebase -i" is not for catching up [*1*], so defaulting to replay onto ^master is not useful. You want the command to replay on top of the stable same base, so that you can compare the result with the previous version in order to verify. Often, the fork-point with master is a good choice for that.

It is tempting to say that "rebase -i" and normal catch-up "rebase" (e.g. "pull --rebase") should have designed to behave differently. "git rebase -i master" perhaps should have made to rebase the current work on top of the fork-point from master, not on top of it, and require an explict --onto master if the user does want to also catch up.

But the above is orthogonal to the syntax "../..." issue.
[Footnote]

*1* "rebase" and "rebase -i" already behave slightly differently with respect to $onto" in that a catch-up rebase that is already up to date notices the situation and turns into a no-op, but it does not turn "rebase -i" into a no-op for this exact reason.

Previous: Ramkumar RamachandraNext: Felipe Contreras
Message 13 of 24 in “Itches with the current rev spec”
  1. Ramkumar RamachandraApr 25, 2013
  2. Ramkumar RamachandraApr 25, 2013
  3. Matthieu MoyApr 25, 2013
  4. Felipe ContrerasApr 25, 2013
  5. Ramkumar RamachandraApr 25, 2013
  6. Michael J GruberApr 29, 2013
  7. Andreas SchwabApr 25, 2013
  8. Ramkumar RamachandraApr 25, 2013
  9. Phil HordApr 25, 2013
  10. Yann DirsonApr 26, 2013
  11. Johannes SixtApr 26, 2013
  12. Ramkumar RamachandraApr 26, 2013
  13. Junio C HamanoApr 26, 2013
  14. Felipe ContrerasApr 26, 2013
  15. Junio C HamanoApr 26, 2013
  16. Ramkumar RamachandraApr 29, 2013
  17. Yann DirsonApr 29, 2013
  18. Junio C HamanoApr 29, 2013
  19. Ramkumar RamachandraApr 29, 2013
  20. Junio C HamanoApr 29, 2013
  21. Ramkumar RamachandraApr 29, 2013
  22. Ramkumar RamachandraApr 29, 2013
  23. Junio C HamanoApr 30, 2013
  24. Ramkumar RamachandraApr 29, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.