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

Re: request for documentation about branch surgery

From
Andreas Ericsson <ae@op5.se>
Date
Jul 7, 2009, 11:03 UTC
Message-ID
<4A532B9E.7020606@op5.se>
In-Reply-To
<200907071213.25418.bruno@clisp.org>
Bruno Haible wrote:
Show 40 quoted lines
> Hi Junio,
> 
>> You learn new things every day, and today is such a day ;-)
>>
>>>   If you want to add a commit in the middle of a branch:
>>>
>>>             A---C---...---Z    master
>>>
>>>   =>
>>>
>>>             A---B---C---...---Z    master
>>>
>>>   it is achieved by
>>         $ git checkout master~25 ;# detach HEAD at A
>>         $ edit edit edit
>>         $ git commit ;# creates B
>>
>> which makes
>>
>>                B              HEAD (detached)
>>               /
>>              A---C---...---Z    master
>>
>> and then
>>
>>         $ git rebase HEAD master
>>
>> which reshapes the history into
>>
>>
>>                B---C'--...---Z' master
>>               /
>>              A---C---...---Z    master@{1}
>>
>> and you are done.
> 
> Cool! I wouldn't have guessed that. Now you wrote it into the mailing list
> archives. It would be even better if it were mentioned in the user's manual,
> chapter "Rewriting history and maintaining patch series"
> 
Anyone can submit patches. I find your persistent urging that someone else
do this for you slightly annoying. Now that you've been helped along the
way to understanding, it's your turn to do your bit and write up the info
you've received as a proper patch. This will help ensure that:
a) Other people can find the relevant information quickly
b) We won't have to answer the same questions again
c) You gain an even deeper understanding about how the various features
   actually work as your patches are submitted for review and improvements
   are suggested for them by the list members
d) We answer your questions again next time you have any

You can ofcourse refrain from submitting patches and just hope that d) happens anyway. It probably will, but not indefinitely.

Thanks.
-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
Previous: Bruno HaibleNext: Junio C Hamano
Message 8 of 10 in “request for documentation about branch surgery”
  1. Bruno HaibleJul 6, 2009
  2. Elijah NewrenJul 7, 2009
  3. Elijah NewrenJul 7, 2009
  4. Bruno HaibleJul 7, 2009
  5. Andreas EricssonJul 7, 2009
  6. Junio C HamanoJul 7, 2009
  7. Bruno HaibleJul 7, 2009
  8. Andreas EricssonJul 7, 2009
  9. Junio C HamanoJul 7, 2009
  10. Daniel BarkalowJul 7, 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.