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

Re: [RFC WIP PATCH] merge: implement -s theirs -X N

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 20, 2018, 00:08 UTC
Message-ID
<xmqqpo2ud9ih.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<87r2nbeh1r.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 38 quoted lines
> On Thu, Apr 19 2018, Junio C. Hamano wrote:
>
>> This question has nothing to do with your "-s theirs" but let me see
>> if I got the above correctly.  Suppose you have a deployed branch
>> (say, "prod"), all developments happen on "master" elsewhere that
>> can be seen as "origin/master", so you may have a few fixes that is
>> not yet in "prod" you would want to cherry-pick from origin/master.
>>
>>     $ git checkout prod
>>     $ git cherry-pick origin/master~2
>>     $ git cherry-pick origin/master
>>
>> Let's say that "master" had a fix at HEAD~2, HEAD~1 is a feature
>> enhancement that is not yet ready for "prod", and HEAD is another
>> fix.  Up to this point you successfully back-ported the fixes to
>> "prod".
>>
>> Then you do merge the tip into "master", i.e.
>>
>>     $ git checkout origin/master && git merge -s ours prod
>>     $ git push origin HEAD:master
>>     $ git checkout prod
>>
>> to make sure that the "master" at the source of truth knows that
>> it already has what our "prod" with these two cherry-picks have.
>>
>> Is that what is going on here?
>>
>> I am just wondering what would and should happen to the non-fix
>> commit in the middle in the above example.  Perhaps your workflow
>> automatically does the right thing to it, perhaps not.
>>
>>
>> [Footnote]
>> ...
> Yeah this -s theirs is redundant to just doing it the other way around
> as you describe.
> ...

Heh, you responded to a much less relevant footnote without addressing the main part of the message which was a more interesting question to me ;-)

Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 6 of 7 in “merge: implement -s theirs -X N”
  1. merge: implement -s theirs -X NÆvar Arnfjörð Bjarmason, Apr 18, 2018
  2. Stefan BellerApr 18, 2018
  3. Junio C HamanoApr 19, 2018
  4. Junio C HamanoApr 19, 2018
  5. Ævar Arnfjörð BjarmasonApr 19, 2018
  6. Junio C HamanoApr 20, 2018
  7. Ævar Arnfjörð BjarmasonApr 20, 2018

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.