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

Merge driver not called for locally modified files?

From
GBGioele Barabucci <gioele@svario.it>
Date
Apr 2, 2016, 14:14 UTC
Message-ID
<56FFD3BD.1060002@svario.it>
Hello,

it seems to me that merge drivers are not called while merging commits that touch locally modified (but uncommited) files. Is this correct?

I made a (simple) merge driver for files in the `pw` format. [1] This driver works correctly when a file is modified by multiple commits. However, if a file has only been modified locally (and not committed), then merging a commit that modifies the same file raises the following error:

    $ git merge --ff-only 78d4f09
    Updating 5180202..78d4f09
    error: Your local changes to the following files would
    be overwritten by merge:
	.local/share/pw/passwords
    Please, commit your changes or stash them before you can merge.
    Aborting
>From my experiments, it looks like the merge driver is not called at all.

Is it possible to configure git so that the merge driver is called also while merging locally modified files?

Regards,
[1] https://github.com/gioele/pw/blob/master/bin/git-pw-merge
-- 
Gioele Barabucci <gioele@svario.it>
Next: Junio C Hamano
Message 1 of 2 in “Merge driver not called for locally modified files?”
  1. Gioele BarabucciApr 2, 2016
  2. Junio C HamanoApr 2, 2016

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.