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

Re: Why is it bad to rewind a branch that has already been pushed out?

From
Junio C Hamano <junkio@cox.net>
Date
Feb 3, 2007, 19:42 UTC
Message-ID
<7vy7nf3u5m.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200702031041.13437.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> writes:
Show 24 quoted lines
> In the following I've assumed that both "h" and "a" commits are 
> independent work, neither of which works on "j" (which isn't quite what 
> you described).  It's not really appropriate for the tutorial, so I 
> haven't really helped you.
> ...
>> (4) Alice pulls from me again:
>>
>> 	---o---o---o---j---a---a---*
>>                   \             /
>>                    h---h---h---h
>>
>> Contrary to the description, git will happily have Alice merge
>> between the two branches, and never gets confused.
>
> The problem is not that the working tree is wrong, it is that the 
> history is wrong.  This sequence of development isn't best represented 
> by a merge.  When we look at the history later, we'll see it as two 
> branches, but that isn't true.
>
> The graph shows that "j" was committed and then probably conflicted 
> in "*" and fixed.  The problem is that you can't point to any non-merge 
> commit that reverted/corrected "j" and explains why that wasn't a good 
> idea - so the "story" that the history tells us is incomplete.  The 
> correction was done just as a conflict resolution in "*".

Actually, if you are assuming a, h, and j are unrelated, then the merge done by Alice will _not_ revert 'j', so the history will perfectly be fine. The merge result will have a half-baked work done with 'j', and everybody can build on top of.

Previous: Andy ParkinsNext: Andy Parkins
Message 3 of 12 in “Why is it bad to rewind a branch that has already been pushed out?”
  1. Junio C HamanoFeb 3, 2007
  2. Andy ParkinsFeb 3, 2007
  3. Junio C HamanoFeb 3, 2007
  4. Andy ParkinsFeb 4, 2007
  5. Theodore TsoFeb 3, 2007
  6. Robin RosenbergFeb 4, 2007
  7. Junio C HamanoFeb 4, 2007
  8. Documentation: add KMail in SubmittingPatchesMichael, Feb 5, 2007
  9. Junio C HamanoFeb 6, 2007
  10. MichaelFeb 6, 2007
  11. Jakub NarebskiFeb 6, 2007
  12. Andy ParkinsFeb 6, 2007

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.