git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: William Pursell <bill.pursell@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH] feature request: git-mergetool --force
Date: Sat, 18 Oct 2008 00:23:05 +0100	[thread overview]
Message-ID: <48F91E59.50202@gmail.com> (raw)

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
  		*,*=*)

             reply	other threads:[~2008-10-17 23:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-17 23:23 William Pursell [this message]
2008-10-18 15:48 ` [PATCH] feature request: git-mergetool --force 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48F91E59.50202@gmail.com \
    --to=bill.pursell@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).