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

[PATCH] feature request: git-mergetool --force

From
William Pursell <bill.pursell@gmail.com>
Date
Oct 17, 2008, 23:23 UTC
Message-ID
<48F91E59.50202@gmail.com>

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
  		*,*=*)
Next: Jeff King
Message 1 of 6 in “feature request: git-mergetool --force”
  1. feature request: git-mergetool --forceWilliam Pursell, Oct 17, 2008
  2. Jeff KingOct 18, 2008
  3. William PursellOct 18, 2008
  4. Jeff KingOct 18, 2008
  5. Charles BaileyOct 18, 2008
  6. Jeff KingOct 19, 2008

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.