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

[PATCH] mergetool merge/skip/abort

From
Caleb Cushing <xenoterracide@gmail.com>
Date
Jan 21, 2009, 14:37 UTC
Message-ID
<81bfc67a0901210637j52fa7a55q51b599e9ff16f6dc@mail.gmail.com>

There are some files that I can't merge with git, and sometimes you just want to finish merging later or move on to the next file and come back later. My patch allows you to quit mergetool without ctrl-c, or move on to the next file or merge the this one. pretty simple and I think will be useful for a lot of people.

>From b647762ad179cdaaf9f844671fdf26074563b366 Mon Sep 17 00:00:00 2001
From: Caleb Cushing <xenoterracide@gmail.com>
Date: Tue, 20 Jan 2009 11:33:30 -0500
Subject: [PATCH] mergetool merge/skip/abort
 add functionality to skip merging a file or abort from the merge
---
 git-mergetool.sh |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/git-mergetool.sh b/git-mergetool.sh
index 00e1337..43d2a9e 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -177,11 +177,27 @@ merge_file () {
     describe_file "$local_mode" "local" "$LOCAL"
     describe_file "$remote_mode" "remote" "$REMOTE"
     if "$prompt" = true; then
-       printf "Hit return to start merge resolution tool (%s): " "$merge_tool"
-       read ans
-    fi
+               while true; do
+               printf "Use (m)erge file or (s)skip file, or (a)bort? (%s): " \
+               "$merge_tool"
+               read ans
+               case "$ans" in
+                       [mM]*)
+                       break
+                       ;;
+                       [sS]*)
+                       cleanup_temp_files
+                       return 0
+                       ;;
+                       [aA]*)
+                       cleanup_temp_files
+                       exit 0
+                       ;;
+               esac
+               done
+       fi

-    case "$merge_tool" in
+       case "$merge_tool" in
        kdiff3)
            if base_present ; then
                ("$merge_tool_path" --auto --L1 "$MERGED (Base)" --L2
"$MERGED (Local)" --L3 "$MERGED (Remote)" \
--
1.6.1
-- 
Caleb Cushing

http://xenoterracide.blogspot.com
Next: Caleb Cushing
Message 1 of 17 in “mergetool merge/skip/abort”
  1. mergetool merge/skip/abortCaleb Cushing, Jan 21, 2009
  2. Caleb CushingJan 21, 2009
  3. Johannes SchindelinJan 21, 2009
  4. Markus HeidelbergJan 21, 2009
  5. Caleb CushingJan 22, 2009
  6. Charles BaileyJan 21, 2009
  7. Caleb CushingJan 22, 2009
  8. Charles BaileyJan 22, 2009
  9. Caleb CushingJan 23, 2009
  10. Junio C HamanoJan 23, 2009
  11. Caleb CushingJan 24, 2009
  12. Nanako ShiraishiJan 24, 2009
  13. Caleb CushingJan 25, 2009
  14. Junio C HamanoJan 25, 2009
  15. Theodore TsoJan 26, 2009
  16. Charles BaileyJan 27, 2009
  17. Junio C HamanoJan 27, 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.