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

Re: Force Confirmation for Dropping Changed Lines

From
Jacob Keller <jacob.keller@gmail.com>
Date
Jan 26, 2017, 00:40 UTC
Message-ID
<CA+P7+xocc==-8ad-OVTahMDABA0-spDPEw05JTHopfO7Ovj2RQ@mail.gmail.com>
In-Reply-To
<CAE1pOi0CgfxQTygg_i3dc_-_Lb8qgOOk_0hg+goJvm7PyLZseg@mail.gmail.com>

On Wed, Jan 25, 2017 at 3:57 PM, Hilco Wijbenga <hilco.wijbenga@gmail.com> wrote:

Show 33 quoted lines
> On 25 January 2017 at 15:46, Junio C Hamano <gitster@pobox.com> wrote:
>> Jacob Keller <jacob.keller@gmail.com> writes:
>>
>>>> Mmm, that sounds complex. The "my-code.x" is made up so I could keep
>>>> my example as simple as possible. In reality, it's Maven's POM files
>>>> (pom.xml).
>>>>
>>>> So there is no setting for any of this? There is no way to switch off
>>>> auto merging for certain files?
>>>
>>> Not really sure, but a quick google search revealed
>>> https://github.com/ralfth/pom-merge-driver
>>>
>>> Maybe that will help you?
>>
>> Its readme seems to indicate that it is either solving a different
>> problem, or solving the same problem with the opposite goal in mind,
>> in that its goal seems to be to forcibly resolve what textually does
>> not resolve cleanly by choosing sides with an arbitrary policy, so
>> that humans do not have to get involved when they ordinarily would
>> have to.
>>
>> Hilco's goal sounded to me the opposite---to force conflict even
>> when the two histories did what textually does resolve cleanly and
>> require humans to get involved even when they ordinarily wouldn't
>> have to.
>
> Yes, unfortunately, you are correct. This seems to do the exact
> opposite of what I want.
>
> Before I start learning about custom merge drivers, is what I want
> even possible? If yes, would you happen to know some good examples of
> (custom) merge drivers? (Python, Ruby, Java are all okay.)

Setting the merge driver to "unset" will do what you want, but it would leave the current branch as the tentative answer and doesn't actually make it easy to resolve properly. That would only require putting "pom.xml merge=unset" in the .gitattributes file.

That might be what you want, but it doesn't actually try to update the file during the merge so you'd have to hand-fix it yourself.

Thanks, Jake

Previous: Hilco WijbengaNext: Junio C Hamano
Message 7 of 11 in “Force Confirmation for Dropping Changed Lines”
  1. Hilco WijbengaJan 25, 2017
  2. Jacob KellerJan 25, 2017
  3. Hilco WijbengaJan 25, 2017
  4. Jacob KellerJan 25, 2017
  5. Junio C HamanoJan 25, 2017
  6. Hilco WijbengaJan 25, 2017
  7. Jacob KellerJan 26, 2017
  8. Junio C HamanoJan 26, 2017
  9. Jacob KellerJan 26, 2017
  10. Hilco WijbengaJan 26, 2017
  11. Junio C HamanoJan 26, 2017

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.