git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] feature request: git-mergetool --force
@ 2008-10-17 23:23 William Pursell
  2008-10-18 15:48 ` Jeff King
  0 siblings, 1 reply; 6+ messages in thread
From: William Pursell @ 2008-10-17 23:23 UTC (permalink / raw)
  To: git

I occasionally use commands like 'cp $REMOTE $MERGED' with
mergetool, and would prefer to not be prompted to start
the tool on each file.  A --force option would be handy.

-- 
William Pursell


diff --git a/git-mergetool.sh b/git-mergetool.sh
index 94187c3..5c9ce09 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -8,7 +8,7 @@
  # at the discretion of Junio C Hamano.
  #

-USAGE='[--tool=tool] [file to merge] ...'
+USAGE='[--tool=tool] [--force] [file to merge] ...'
  SUBDIRECTORY_OK=Yes
  OPTIONS_SPEC=
  . git-sh-setup
@@ -176,8 +176,10 @@ merge_file () {
      echo "Normal merge conflict for '$MERGED':"
      describe_file "$local_mode" "local" "$LOCAL"
      describe_file "$remote_mode" "remote" "$REMOTE"
-    printf "Hit return to start merge resolution tool (%s): " "$merge_tool"
-    read ans
+    if test x"$force_option" != xyes; then
+	printf "Hit return to start merge resolution tool (%s): " "$merge_tool"
+	read ans
+    fi

      case "$merge_tool" in
  	kdiff3)
@@ -283,6 +285,9 @@ merge_file () {
  while test $# != 0
  do
      case "$1" in
+	-f|--fo|--for|--forc|--force)
+	    force_option=yes
+	    ;;
  	-t|--tool*)
  	    case "$#,$1" in
  		*,*=*)

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

end of thread, other threads:[~2008-10-19 11:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-17 23:23 [PATCH] feature request: git-mergetool --force William Pursell
2008-10-18 15:48 ` Jeff King
2008-10-18 18:44   ` William Pursell
2008-10-18 20:54     ` Jeff King
2008-10-18 23:16       ` Charles Bailey
2008-10-19 11:47         ` Jeff King

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).