git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mergetool merge/skip/abort
@ 2009-01-21 14:37 Caleb Cushing
  2009-01-21 16:17 ` Caleb Cushing
  2009-01-21 17:04 ` Charles Bailey
  0 siblings, 2 replies; 17+ messages in thread
From: Caleb Cushing @ 2009-01-21 14:37 UTC (permalink / raw)
  To: git

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

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2009-01-27 22:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-21 14:37 [PATCH] mergetool merge/skip/abort Caleb Cushing
2009-01-21 16:17 ` Caleb Cushing
2009-01-21 16:33   ` Johannes Schindelin
2009-01-21 18:49   ` Markus Heidelberg
2009-01-22  5:07     ` Caleb Cushing
2009-01-21 17:04 ` Charles Bailey
2009-01-22 14:17   ` Caleb Cushing
2009-01-22 14:22     ` Charles Bailey
2009-01-23 15:16       ` Caleb Cushing
2009-01-23 17:26         ` Junio C Hamano
2009-01-24 18:36           ` Caleb Cushing
2009-01-24 21:45             ` Nanako Shiraishi
2009-01-25  0:18               ` Caleb Cushing
2009-01-25  5:20               ` Junio C Hamano
2009-01-26 22:58           ` Theodore Tso
2009-01-27 22:09             ` Charles Bailey
2009-01-27 22:37               ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).