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

Re: Use case I don't know how to address

From
Alan Chandler <alan@chandlerfamily.org.uk>
Date
Sep 7, 2009, 12:08 UTC
Message-ID
<4AA4F7A5.2060904@chandlerfamily.org.uk>
In-Reply-To
<4AA4F632.3070206@chandlerfamily.org.uk>
Alan Chandler wrote:
Show 34 quoted lines
> Alan Chandler wrote:
>> Junio C Hamano wrote:
>>> Alan Chandler <alan@chandlerfamily.org.uk> writes:
>>>
>>>>        2' - 2a - 3' - 4' ----------------- 6' SITE
>>>>       /         /    /                    /
>>>> 1 -  2  ------ 3  - 4  ------------6'''- 6a TEST
>>>>                      \            /
>>>>                        5  ------ 6  MASTER
>>>>                         \         \
>>>>                           5''- 5a- 6'' DEMO
>>>>
>>>>
>>>> What will happen is the changes made in 4->5 will get applied to the
>>>> (now) Test branch as part of the 6->6'' merge, and I will be left
>>>> having to add a new commit, 6a, to undo them all again.  Given this is
>>>> likely to be quite a substantial change I want to try and avoid it if
>>>> possible.
>>>
>>> I presume 6'''-6a has the revert of 4-5?  If so, the next merge should
>>> work just fine.
>>
>>
>> I think you missed the issue - Yes 6'''-6a is the revert, but the 
>> problem is this could be large and complicated, and I wanted to find 
>> an automated way rather than manual
>>
>> Sort of like doing a diff of 4-5 and somehow applying it backwards.
>>
>>
> 
> I just discovered that git-apply has the -R flag.  Is that what I am 
> looking for?
> 
         2' - 2a - 3' - 4' ------------ 6' SITE
        /         /    /               /
  1 -  2  ------ 3  - 4  --5'''--5b---6''' TEST
                       \  /          /
                         5  ------ 6  MASTER
                          \         \
                           5''- 5a- 6'' DEMO

Just to be clear - if I do a diff of 4->5 and then immediately merge it back to 4 as 5'' (which fast forwards 4) and then 5b is the diff of 4-5 applied with git apply -R.

Is that what the -R flag does on git apply?
-- 
Alan Chandler
http://www.chandlerfamily.org.uk
Previous: Alan Chandler
Message 7 of 7 in “Use case I don't know how to address”
  1. Alan ChandlerSep 5, 2009
  2. Johannes SixtSep 5, 2009
  3. Alan ChandlerSep 6, 2009
  4. Junio C HamanoSep 6, 2009
  5. Alan ChandlerSep 6, 2009
  6. Alan ChandlerSep 7, 2009
  7. Alan ChandlerSep 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.