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

[PATCH] mergetool merge/skip/abort at prompt

From
Caleb Cushing <xenoterracide@gmail.com>
Date
Jan 28, 2009, 06:56 UTC
Message-ID
<81bfc67a0901272256t726bf206k351bb6c8b2778bd5@mail.gmail.com>

previously git mergetool when run with prompt only allowed the user to continue merging. This changes git mergetool to allow the option of skipping a file or aborting, and includes an addtional key to explicitly select merge.

Signed-off-by: Caleb Cushing <xenoterracide@gmail.com>
---
 git-mergetool.sh |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/git-mergetool.sh b/git-mergetool.sh
index 00e1337..575fbb2 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -177,8 +177,24 @@ 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
+	while true; do
+	    printf "Use (m)erge file or (s)kip 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
-- 
1.6.1.1
Next: Caleb Cushing
Message 1 of 6 in “mergetool merge/skip/abort at prompt”
  1. mergetool merge/skip/abort at promptCaleb Cushing, Jan 28, 2009
  2. Caleb CushingJan 28, 2009
  3. David AguilarJan 28, 2009
  4. Caleb CushingJan 28, 2009
  5. Charles BaileyJan 28, 2009
  6. Caleb CushingJan 28, 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.