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

Re: git rebase -i

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Feb 20, 2009, 11:02 UTC
Message-ID
<499E8DB9.5030505@drmicha.warpmail.net>
In-Reply-To
<76718490902191626u2202ed38xf63111b6a2758206@mail.gmail.com>
Jay Soffian venit, vidit, dixit 20.02.2009 01:26:
Show 19 quoted lines
> On Thu, Feb 19, 2009 at 7:11 PM, Junio C Hamano <gitster@pobox.com> wrote:
> 
>>> $ git rebase -i -10
>>> $ git rebase -i -n -10
>> The syntax would certainly imply a different semantics from giving
>> HEAD~10.  How would you compute the set of commits to rebase sanely when
>> you have merges after your 10th direct parent commit?
> 
> I didn't mean to suggest that -10 and HEAD~10 are the same thing.
> 
> I would expect -10 to act the same when given to rebase as it does
> when given to format-patch. In both cases, you are asking the command
> for a set of commits.
> 
> But as I said, I don't exactly know what -10 means to format-patch if
> there are merge commits because I've never tried to use it in such a
> context.
> 
> j.
I guess it means exactly what
git rev-list -10 HEAD
means. And that would also be the easy way to implement it.
BUT: The fact that it's not obvious what "-10" is in non-linear
situations is the reason why it's probably not a good idea for r-b-i. If
you want to rebase you need a clear picture of the revision graph. If
you have one you know where to rebase from, and how to say so using
HEAD~5 and such. If you don't have one then using an option like -10
could be dangerous. And in a linear situation, -10 is equivalent to
HEAD~10 (+-1 ...).
Michael
Previous: Jay Soffian
Message 28 of 28 in “git rebase -i”
  1. John TapsellFeb 19, 2009
  2. Wincent ColaiutaFeb 19, 2009
  3. John TapsellFeb 19, 2009
  4. Wincent ColaiutaFeb 19, 2009
  5. Jeff KingFeb 19, 2009
  6. Wincent ColaiutaFeb 19, 2009
  7. Jeff KingFeb 19, 2009
  8. Theodore TsoFeb 19, 2009
  9. Teemu LikonenFeb 19, 2009
  10. John TapsellFeb 19, 2009
  11. Sitaram ChamartyFeb 19, 2009
  12. John TapsellFeb 19, 2009
  13. Stephan BeyerFeb 23, 2009
  14. Pieter de BieFeb 19, 2009
  15. Junio C HamanoFeb 19, 2009
  16. Marc BranchaudFeb 19, 2009
  17. Nazri RamliyFeb 19, 2009
  18. Thomas RastFeb 19, 2009
  19. John TapsellFeb 19, 2009
  20. Jeff KingFeb 19, 2009
  21. Jay SoffianFeb 19, 2009
  22. Johannes SchindelinFeb 19, 2009
  23. Jay SoffianFeb 19, 2009
  24. Giuseppe BilottaFeb 19, 2009
  25. Johannes SchindelinFeb 20, 2009
  26. Junio C HamanoFeb 20, 2009
  27. Jay SoffianFeb 20, 2009
  28. Michael J GruberFeb 20, 2009

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.