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

Re: Request for adding a simple mechanism to exclude files from Git merge operation

From
Sergey Organov <sorganov@gmail.com>
Date
Jun 25, 2020, 11:46 UTC
Message-ID
<87h7uzweoh.fsf@osv.gnss.ru>
In-Reply-To
<xmqqk0zw5bt5.fsf@gitster.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 9 quoted lines
> Sergey Organov <sorganov@gmail.com> writes:
>
>> To clarify, could you please tell if plain
>>
>>    git merge -s ours
>>
>> is a "partial merge" from your point of view?
>
> It is not even "partial".
OK, get it, thanks!

I asked for clarification because it /is/ possible to interpret such merge as "partial" in the sense that it gets only /part/ of changes, discarding those that were introduced on the side branch.

Show 12 quoted lines
>
> The merge strategy "-s ours" is a way to cauterize a side branch as
> dead-end, declaring that everything that has ever been done on that
> side branch up to the point of the merge is not interesting and we'd
> never want to look at anything that builds on it.
>
> It has its uses, though.  After doing so, "git log --all ^mainline"
> or "git branch --not-merged release" would not show such a
> cauterized branch; it is a good way to "hide" the branch that you
> deem a dead-end when you cannot remove it.  But of course you do not
> want to ever build on such a side branch after doing so.
>

I think the usefulness of the feature might happen to be somewhat wider, yet I'm to avoid arguing, to scatter no attention.

Show 5 quoted lines
>> If you think it is not, then what about:
>>
>>   git merge -X ours
>
> It is not even a sensible merge.
I don't believe one could tell out of context, see below.

Anyway, the question was not if it's good, bad, or sensible. Suppose I do such a "non-sensible" merge, is it a "partial merge" or not?

> It takes their changes where we didn't touch, but it takes our change
> without even looking at what they did when the changes overlap.

Sure, and that happens to be exactly what I need from Git when I do such merge, because I did look at all the 137 conflicts and found none where I need different resolution; and yes, I'm too lazy to resolve all 137 by hand. Makes sense? Is my merge "partial" /now/?

Getting back to technical discussion, can we come up with a useful definition of "partial merge" at all? Honestly, I can't, and unless somebody else does, I'm inclined to consider it to be an arbitrary label being put on selected merge examples for the sake of argument.

Thanks, -- Sergey

Previous: Junio C Hamano
Message 16 of 16 in “Request for adding a simple mechanism to exclude files from Git merge operation”
  1. Tiran MeltserJun 20, 2020
  2. Philip OakleyJun 21, 2020
  3. Tiran MeltserJun 22, 2020
  4. brian m. carlsonJun 22, 2020
  5. Sergey OrganovJun 23, 2020
  6. Philip OakleyJun 23, 2020
  7. Sergey OrganovJun 23, 2020
  8. Elijah NewrenJun 23, 2020
  9. Sergey OrganovJun 23, 2020
  10. Elijah NewrenJun 23, 2020
  11. Chris TorekJun 23, 2020
  12. Sergey OrganovJun 24, 2020
  13. Junio C HamanoJun 23, 2020
  14. Sergey OrganovJun 24, 2020
  15. Junio C HamanoJun 24, 2020
  16. Sergey OrganovJun 25, 2020

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.