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

Re: Getting the full path of a conflicting file within a custom merge driver?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 1, 2015, 16:46 UTC
Message-ID
<xmqqr3pv74ww.fsf@gitster.dls.corp.google.com>
In-Reply-To
<D8780C527EB1E642B3150E6D705B46D468837861@DWPWHMS531.dwpbank.local>
"Gondek, Andreas" <Andreas.Gondek@dwpbank.de> writes:
Show 6 quoted lines
> I'm wondering if there is no option to find out the full path of a
> conflicting file from within a custom merge driver? If I understand
> this correctly, Git only provides the name of the 3 temporary local
> files and the size of the limiter. But is there any possibility to get
> the path of the file via a Git command, that I can run from within the
> merge driver? Maybe as part of the repository's status?

Short answer is "no", as the merge driver interface was originally designed for a backend that can do its job with only the contents of the three variants without any other information. Imagine the interface to things like "merge" from the RCS suite where it takes three variants as the input---for them, the same three-tuple of original, mine and theirs contents should merge to identical result no matter where in the working tree the conflicts happened.

Having said that, I do not think it is unreasonable to feed more information to external merge driver, perhaps by adding a new environment variable GIT_MERGE_CONFLICTED_PATH exported when the driver is run, or something.

Previous: Gondek, AndreasNext: Gondek, Andreas
Message 2 of 9 in “Getting the full path of a conflicting file within a custom merge driver?”
  1. Gondek, AndreasJun 1, 2015
  2. Junio C HamanoJun 1, 2015
  3. AW: Getting the full path of a conflicting file within a custom merge driver?Gondek, Andreas, Jun 2, 2015
  4. Junio C HamanoJun 2, 2015
  5. Re*: AW: Getting the full path of a conflicting file within a custom merge driver?Junio C Hamano, Jun 4, 2015
  6. AW: Re*: AW: Getting the full path of a conflicting file within a custom merge driver?Gondek, Andreas, Jun 5, 2015
  7. Christian CouderJun 5, 2015
  8. Christian CouderJun 5, 2015
  9. Junio C HamanoJun 5, 2015

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.