From 76278801e7012e33b0f501858ca050983e07215d Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 16 Jul 2017 16:22:04 -0400 Subject: Add a `git-mergetool` stub for ediff --- Makefile | 5 +++++ ediff.git-mergetool | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 ediff.git-mergetool diff --git a/Makefile b/Makefile index 49fc309..011f33a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ bash=/usr/bin/env bash +gitexecdir=$(libexecdir)/git-core EDIT = { m4 -P | sed -e 's|@bash@|$(bash)|g' -e 's|@VERSION@|$(VERSION)|'; } @@ -15,6 +16,7 @@ desktops = emacsmail emacsterm files.out.all += $(programs) files.sys.all += $(addprefix $(bindir)/,$(programs)) $(foreach d,$(desktops),$(datarootdir)/applications/$d.desktop) +files.sys.all += $(gitexecdir)/mergetools/ediff files.out.int += *.sh %.sh: %.sh.in common.sh.in .var.bash .var.VERSION @@ -26,6 +28,9 @@ $(DESTDIR)$(bindir)/%: % $(DESTDIR)$(datarootdir)/applications/%: % $(NORMAL_INSTALL) $(INSTALL_DATA) -D $< $@ +$(DESTDIR)$(gitexecdir)/mergetools/%: %.git-mergetool + $(NORMAL_INSTALL) + $(INSTALL_DATA) -D $< $@ .DELETE_ON_ERROR: .SECONDARY: diff --git a/ediff.git-mergetool b/ediff.git-mergetool new file mode 100644 index 0000000..8a267bd --- /dev/null +++ b/ediff.git-mergetool @@ -0,0 +1,20 @@ +diff_cmd () { + "$merge_tool_path" -c "$LOCAL" "$REMOTE" +} + +merge_cmd () { + if $base_present + then + "$merge_tool_path" -c \ + -3 "$LOCAL" "$REMOTE" "$BASE" \ + -m "$MERGED" + else + "$merge_tool_path" -c \ + "$LOCAL" "$REMOTE" \ + -m "$MERGED" + fi +} + +exit_code_trustable () { + true +} -- cgit v1.2.3-54-g00ecf