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

Re: rebase-with-history -- a technique for rebasing without trashing your repo history

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Aug 14, 2009, 03:17 UTC
Message-ID
<2e24e5b90908132017i1c6be9abt9b08219acc1cb600@mail.gmail.com>
In-Reply-To
<4A849634.1020609@alum.mit.edu>
Hi,

I'm one of those wannabe experts who thinks he knows enough about git to teach people in his workplace but obviously pales in this group, but with that caveat, let me say:

2009/8/14 Michael Haggerty <mhagger@alum.mit.edu>:
> Now that you mention it, there are some other uses of rebase whose
> history could be recorded correctly, or at least better, in the DAG.  I
> am not ready to advocate any of these changes, but I think they are
I see you've made your own caveat :-)
> worth discussing.
[snip]
> A---B1---B2----C
>  \         \    \
>  ---------B12---C'
> A---B12---C
>  \     \   \
>  B1---B2---C'
[snip]
> A---C
>  \   \
>  B---C'
[etc etc... many such snipped]

To me, the ability to *forget* the mistakes I made (for whatever definition of "mistake" you wish) as long as it's private to my repo, is one of the main attractions of git. I'm one of those guys who saves early, and saves often, when editing files. This translates to commit early, commit often, in the git world.

I see no earthly reason why I would ever *want* those commits preserved, so I hope that, if this sort of thing ever gets into the code, it is definitely *not* the default :-) It is not sufficient for me that the GUI knows how to suppress their display, it is necessary that they *disappear completely*.

And that reminds me. You often hear people on #git ask how to get rid of some files (maybe containing passwords etc) that inadvertently got into the repo, and the answer, a lot of the time, is filter-branch, because the "bad" commit is pretty old. I suspect that for every person who asks that question on the list because he already pushed, there are 4 who discovered such an error much earlier, (when the file went into only a couple of commits at the top maybe), did a rebase -i with "edit" or whatever, and got rid of the evidence, err I mean password :-) If this sort of thing were to be the default, they'd have to use a filter-branch even for such simple cases.

Finally, speaking as someone who teaches git, this adds enormous complexity to the basic concepts. Complexity is good when the benefits are obvious, but to me they are not obvious [see *my* caveat at the top before you react to this statement]

Previous: Björn SteinbrinkNext: Bryan O'Sullivan
Message 8 of 10 in “rebase-with-history -- a technique for rebasing without trashing your repo history”
  1. Michael HaggertyAug 13, 2009
  2. Björn SteinbrinkAug 13, 2009
  3. Michael HaggertyAug 13, 2009
  4. Björn SteinbrinkAug 13, 2009
  5. Michael HaggertyAug 14, 2009
  6. Nanako ShiraishiAug 14, 2009
  7. Björn SteinbrinkAug 15, 2009
  8. Sitaram ChamartyAug 14, 2009
  9. Bryan O'SullivanAug 13, 2009
  10. Abderrahim KitouniAug 13, 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.