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

Re: [FIXED PATCH] Make rebase save ORIG_HEAD if changing current branch

From
Brian Gernhardt <benji@silverinsanity.com>
Date
Jul 7, 2008, 05:16 UTC
Message-ID
<803A3528-2451-4C5D-A48D-5E0C37B8E90E@silverinsanity.com>
In-Reply-To
<7v7iby9ucx.fsf@gitster.siamese.dyndns.org>
On Jul 7, 2008, at 12:43 AM, Junio C Hamano wrote:
Show 5 quoted lines
> Having said that, thanks to updates to git-rebase,  
> rebased_branch@{1} has
> useful information these days, so I do not see much practical  
> upside, even
> though I _will_ apply this patch, just for the sake of consistency.

I've been running rebase a lot over the last few days, and my impression was that git-rebase adds an entry to ther eflog for each patch it runs over. While this has its uses, it makes HEAD@{1} not terribly useful after a "pull --rebase". Of course, it took me three tries to get a one-line patch out this weekend, so my judgement is obviously not that great at the moment.

I do appreciate that you'll apply it though. As useful as I find rebasing pull useful, I dislike maintaining patches on top of git. It tends to lead to something breaking when I don't have time to fix it. ;-)

> We would make it _appear_ rebase and merge are interchangeable even  
> more.
> But the thing is, I am not convinced if promoting that appearance is
> necessarily a good thing.

I don't really think promoting it is a good idea, actually. I do, however, think that having ORIG_HEAD set intelligently after a pull is. I nearly added setting ORIG_HEAD to pull, but didn't think that removing it from merge or setting it twice was a good plan.

Besides, I've done the wrong rebase more than once and having the quick recovery is excellent. (Reflogs are great, but when the commit messages are identical it becomes a little difficult to figure out which one to use.)

Show 11 quoted lines
> But you cannot say the same thing with "gitk ORIG_HEAD..", for  
> example.
> The meaning of the topology and commits you would see would be quite
> different.  For rebase you will see your own commits that are carried
> forward, and for merge you won't.  Besides this example, there  
> probably
> are many fundamental differences between rebase and merge, and  
> trying to
> give a false impression that they are interchangeable may not add much
> value to the end user experience, and it could even be harmful from
> educational point of view.

However, the rebased patches may have changed in subtle ways, so having them appear in gitk is a good thing. If I was trying to teach someone git, I'd compare the rebased commits to the merge commit. They both give information on how any conflicts were resolved (although the information is more subtle with rebase).

My final thought is that the rational ORIG_HEAD and when we set it is not clearly documented anywhere. But I am currently out of time to work on git, so that patch won't be coming from me soon.

~~ Brian
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 28 in “Make rebase save ORIG_HEAD if changing current branch”
  1. Make rebase save ORIG_HEAD if changing current branchBrian Gernhardt, Jul 6, 2008
  2. Junio C HamanoJul 7, 2008
  3. Brian GernhardtJul 7, 2008
  4. Junio C HamanoJul 7, 2008
  5. Junio C HamanoJul 7, 2008
  6. Junio C HamanoJul 7, 2008
  7. Theodore TsoJul 7, 2008
  8. Jakub NarebskiJul 7, 2008
  9. Brian GernhardtJul 7, 2008
  10. Jeff KingJul 8, 2008
  11. Brian GernhardtJul 8, 2008
  12. Brian GernhardtJul 7, 2008
  13. Junio C HamanoJul 7, 2008
  14. Junio C HamanoJul 7, 2008
  15. Jakub NarebskiJul 7, 2008
  16. Junio C HamanoJul 7, 2008
  17. Jakub NarebskiJul 7, 2008
  18. Brian GernhardtJul 8, 2008
  19. Documentation: mention ORIG_HEAD in am, merge, and rebaseBrian Gernhardt, Jul 8, 2008
  20. Junio C HamanoJul 8, 2008
  21. Brian GernhardtJul 8, 2008
  22. Jay SoffianJul 8, 2008
  23. Mike HommeyJul 7, 2008
  24. Junio C HamanoJul 7, 2008
  25. Mike HommeyJul 7, 2008
  26. Nanako ShiraishiJul 7, 2008
  27. Re* [FIXED PATCH] Make rebase save ORIG_HEAD if changing current branchJunio C Hamano, Jul 7, 2008
  28. Brian GernhardtJul 7, 2008

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.