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

Re: How to install and use a custom merge driver

From
Jeff King <peff@peff.net>
Date
Jan 29, 2009, 03:25 UTC
Message-ID
<20090129032531.GA11836@coredump.intra.peff.net>
In-Reply-To
<loom.20090128T230123-889@post.gmane.org>
On Wed, Jan 28, 2009 at 11:04:02PM +0000, Alec Clews wrote:
> I fixed that problem -- however it did not make any difference.

Can you post an exact recipe for recreating the problem? It works just fine here, using:

-- >8 --
commit() {
  echo $1 >file && git add file && git commit -m $1
}

mkdir repo && cd repo && git init commit base commit branch-master git checkout -b other HEAD^ commit branch-other

echo '* merge=overwrite' >.git/info/attributes
cat >>.git/config <<'EOF'
[merge "overwrite"]
  name = overwrite using cp
  driver= cp %B %A
EOF

git merge master -- 8< --

I get an automatic merge with the contents from "master" (and without the merge config, there is obviously a conflict).

> Is there someway to enable logging to see how git is making this choice?

You can try "git check-attr merge file" to be sure that it is picking up the attribute.

-Peff
Previous: Alec ClewsNext: Alec Clews
Message 5 of 9 in “How to install and use a custom merge driver”
  1. Alec ClewsJan 28, 2009
  2. Jeff KingJan 28, 2009
  3. Alec ClewsJan 28, 2009
  4. Alec ClewsJan 28, 2009
  5. Jeff KingJan 29, 2009
  6. Alec ClewsJan 29, 2009
  7. Jeff KingJan 29, 2009
  8. Alec ClewsJan 29, 2009
  9. Jeff KingJan 29, 2009

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.