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

Re: git rebase -i

From
Jeff King <peff@peff.net>
Date
Feb 19, 2009, 10:07 UTC
Message-ID
<20090219100743.GA16119@coredump.intra.peff.net>
In-Reply-To
<43d8ce650902190121v2e18aac1rfaa64a4ce6e799a3@mail.gmail.com>
On Thu, Feb 19, 2009 at 09:21:49AM +0000, John Tapsell wrote:
>   I often do   'git rebase -i HEAD~10'  to rebase.  Since afaics it
> doesn't matter if you go back 'too far' I just always use HEAD~10 even
> if it's just for the last or so commit.
Here are some reasons not to go back too far:
  1. The commits are displayed in order, so the ones that are
     interesting to the user are at the bottom. And HEAD~10 may display
     more than 10 commits in the face of non-linear history.
  2. rebase -i does not preserve merges by default. Which means that if
     HEAD~10 is not a linear history, then you are flattening the graph
     structure.
>   Would there be any objections to making  'git rebase -i' default to
> HEAD~10  or maybe 16 or 20.  Having sensible defaults for commands
> helps a bit with making it easier to use.

If you wanted to do something like this, a much more sensible cutoff would be the location of an upstream tracking branch (e.g., as defined by branch.*.rebase). Then you are literally asking for commits which have not been published in your upstream, which means it is OK to rewrite history (assuming they were not published elsewhere).

-Peff
Previous: John TapsellNext: Jay Soffian
Message 20 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.