From: Johannes Sixt <j.sixt@viscovery.net>
To: Jose Ricardo <josericardo.jr@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Custom Merge
Date: Mon, 23 Apr 2012 14:59:47 +0200 [thread overview]
Message-ID: <4F955243.2090103@viscovery.net> (raw)
In-Reply-To: <loom.20120423T141242-348@post.gmane.org>
Am 4/23/2012 14:25, schrieb Jose Ricardo:
> In my project, I have a lot of image files, that I wanted to process using
> a different tool. For this, after reading some posts about custom merge
> drivers in this forum, I make the following modifications:
>
> In the file .gitconfig I added the following lines:
>
>
> [merge "imgfile"]
> name = Driver for image files
> driver = /usr/local/bin/git-merge-img.sh %O %A %B %L
> recursive = binary
>
> and in the .gitinfoattributes I put:
>
> *.png merge=imgfile
>
> As I can see, it works calling my custom script during a merge between
> two branches that have a .png file. Unfortunately, even after a successfully
> merge, the final image is not merged with the one in the other branch.
> In order to test it, I've called my script using three images, giving me the
> corrected result.
>
> I don't know if it could help but instead of changing the content of the file
> I create another one with the same name during a merge operation.
I have my image merge script configured it like this:
[merge "imgfile"]
driver = imgmerge %O %A %B %A
but if you do that, you must be sure that the script does not need to
access $2 after it has begun writing to $4.
(I know that it worked because at one time I had forgotten that I have a
custom merge driver, and was expecting a merge conflict due to an image
file, but there was no conflict, and the result was correct ;-)
-- Hannes
next prev parent reply other threads:[~2012-04-23 12:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 12:25 Custom Merge Jose Ricardo
2012-04-23 12:59 ` Johannes Sixt [this message]
2012-04-23 14:28 ` Jose Ricardo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F955243.2090103@viscovery.net \
--to=j.sixt@viscovery.net \
--cc=git@vger.kernel.org \
--cc=josericardo.jr@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).