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

[PATCH 0/2] Custom low-level merge driver support.

From
Junio C Hamano <junkio@cox.net>
Date
Apr 18, 2007, 09:21 UTC
Message-ID
<11768880622402-git-send-email-junkio@cox.net>

This two-patch series concludes my initial attempt for gitattributes for now.

It hooks into the merge-recursive backend to allow custom low-level 3-way merge drivers to be specified path-by-path basis.

To define a custom low-level merge driver, the usual configuration mechanism is used.

	[merge]
		driver = ancient merge %A %O %B

The new configuration item, 'merge.driver', is multi-valued. Each of its values begin with the name of the low-level driver ('ancient' in the above example), followed by its command line. The command line can contain the following patterns to be processed with the usual interpolation mechanism:

	%O	name of the temporary file that has the
		ancestor's version.
	%A	name of the temporary file that has the
		version from the current branch.
	%B	name of the temporary file that has the
		version from the other branch.

The low-level driver is expected to update the file named with %A with the result of the merge, and exit with zero status upon a clean merge. It can exit with non-zero status to signal that the result still has conflicts.

Once you set up a low-level merge driver, you can specify that driver to be used for specific paths, using the attributes mechanism, by using the driver's name as the value of 'merge' attribute. For example, taken together with the above 'ancient' driver configuration and this line in your .git/info/attributes:

	*.txt	merge=ancient

will use the old "RCS merge" external program to merge a file whose extension is ".txt", just like we used to do before v1.5.0.

Next: Junio C Hamano
Message 1 of 23 in “Custom low-level merge driver support.”
  1. 0/2 Custom low-level merge driver support.Junio C Hamano, Apr 18, 2007
  2. 1/2 Custom low-level merge driver support.Junio C Hamano, Apr 18, 2007
  3. Johannes SixtApr 18, 2007
  4. Johannes SchindelinApr 18, 2007
  5. 2/2 Allow the default low-level merge driver to be configured.Junio C Hamano, Apr 18, 2007
  6. Johannes SchindelinApr 18, 2007
  7. Martin WaitzApr 18, 2007
  8. Junio C HamanoApr 18, 2007
  9. Martin WaitzApr 18, 2007
  10. Linus TorvaldsApr 18, 2007
  11. Junio C HamanoApr 18, 2007
  12. Linus TorvaldsApr 18, 2007
  13. Junio C HamanoApr 18, 2007
  14. Junio C HamanoApr 18, 2007
  15. Linus TorvaldsApr 18, 2007
  16. Linus TorvaldsApr 18, 2007
  17. Junio C HamanoApr 18, 2007
  18. Linus TorvaldsApr 18, 2007
  19. David LangApr 18, 2007
  20. Junio C HamanoApr 18, 2007
  21. Martin WaitzApr 19, 2007
  22. Junio C HamanoApr 19, 2007
  23. Custom low-level merge driver: change the configuration scheme.Junio C Hamano, Apr 18, 2007

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.