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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:05:05

"Gondek, Andreas" [off-list ref] writes:
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.

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

From: Gondek, Andreas <hidden>
Date: 2016-06-15 23:05:05

Hi,

thank you for responding this fast. I would suggest providing this information as an additional parameter (like %A %O %B and %L) maybe %P. I think this would cost about 2 lines of code und wouldn't be any performance issue I assume. If I got it right in the source code, the information is present in the place where the parameters for the merge driver are prepared.

Greetings,

Andreas Gondek
Applications
________________________________

Deutsche WertpapierService Bank AG
ITTAS
Derendorfer Allee 2
40476 Düsseldorf
Tel.: +49 69 5099 9503
Fax: +49 69 5099 85 9503
E-Mail: Andreas.Gondek@dwpbank.de
http://www.dwpbank.de

Deutsche WertpapierService Bank AG | Wildunger Straße 14 | 60487 Frankfurt am Main 
Sitz der AG: Frankfurt am Main, HRB 56913 | USt.-ID: DE 813759005 
Vorstand: Thomas Klanten, Dr. Christian Tonnesen
Aufsichtsrat: Wilfried Groos (Vors.)

-----Ursprüngliche Nachricht-----
Von: Junio C Hamano [mailto:jch2355@gmail.com] Im Auftrag von Junio C Hamano
Gesendet: Montag, 1. Juni 2015 18:46
An: Gondek, Andreas
Cc: git@vger.kernel.org
Betreff: Re: Getting the full path of a conflicting file within a custom merge driver?

"Gondek, Andreas" [off-list ref] writes:
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help