# RFH: is the current file available to a custom merge driver?

3 messages from 2010-08-31 to 2010-08-31. Participants: Eric Raible, Jonathan Nieder.
Thread: https://gitlist.dev/t/24923

## Eric Raible, 2010-08-31 18:52

Subject: RFH: is the current file available to a custom merge driver?
Message-ID: <4C7D4F63.2060307@nextest.com>
URL: https://gitlist.dev/e/4C7D4F63.2060307%40nextest.com

```
[Note: this is a resend - the initial attempt got no responses]

Hello All -

In writing a custom merge driver to support $dayjob
requirements I've failed to find a simple way of getting
the current file name that the driver is supposed to
be merging.

I of course have the "ancestor", "ours", and "theirs"
temporary files, but for Ui purposes I'd like to know
the filename as well.

As a workaround, I'm grepping for the git-hash-object
of %A (aka "ours) from the output of "git ls-tree -r HEAD".

I've examined the environment, and saw nothing relevant.
"git-ls-files -u" isn't useful, since the items aren't
unmerged yet.

Can anyone offer hints/help/tips?

Thanks - Eric

git version 1.7.0.2.msysgit.0

```

## Jonathan Nieder, 2010-08-31 18:57

Subject: Re: RFH: is the current file available to a custom merge driver?
Message-ID: <20100831185708.GS2315@burratino>
URL: https://gitlist.dev/e/20100831185708.GS2315%40burratino
In-Reply-To: <4C7D4F63.2060307@nextest.com>

```
Hi Eric,

Eric Raible wrote:

> In writing a custom merge driver to support $dayjob
> requirements I've failed to find a simple way of getting
> the current file name that the driver is supposed to
> be merging.
> 
> I of course have the "ancestor", "ours", and "theirs"
> temporary files, but for Ui purposes I'd like to know
> the filename as well.

It's not available.  You can try modifying ll-merge.c to
expose it if you have an idea about how that should work.

```

## Eric Raible, 2010-08-31 19:07

Subject: Re: RFH: is the current file available to a custom merge driver?
Message-ID: <4C7D52FC.8000701@nextest.com>
URL: https://gitlist.dev/e/4C7D52FC.8000701%40nextest.com
In-Reply-To: <20100831185708.GS2315@burratino>

```
On 8/31/2010 11:57 AM, Jonathan Nieder wrote:
> Hi Eric,
> 
> Eric Raible wrote:
> 
>> In writing a custom merge driver to support $dayjob
>> requirements I've failed to find a simple way of getting
>> the current file name that the driver is supposed to
>> be merging.
>>
>> I of course have the "ancestor", "ours", and "theirs"
>> temporary files, but for Ui purposes I'd like to know
>> the filename as well.
> 
> It's not available.  You can try modifying ll-merge.c to
> expose it if you have an idea about how that should work.
> .

Thanks Jonathan for the (very!) quick response, but since
time is short I think I'll stick with my current technique
(grepping $(git ls-tree -r HEAD) for $(git hash-object %A))

```
