git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, John Keeping <john@keeping.me.uk>
Subject: [PATCH 1/7] git-mergetool: move show_tool_help to mergetool--lib
Date: Fri, 25 Jan 2013 01:43:48 -0800	[thread overview]
Message-ID: <1359107034-14606-2-git-send-email-davvid@gmail.com> (raw)
In-Reply-To: <1359107034-14606-1-git-send-email-davvid@gmail.com>

From: John Keeping <john@keeping.me.uk>

This is the first step in unifying "git difftool --tool-help" and
"git mergetool --tool-help".

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: David Aguilar <davvid@gmail.com>
---
 git-mergetool--lib.sh | 37 +++++++++++++++++++++++++++++++++++++
 git-mergetool.sh      | 37 -------------------------------------
 2 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
index f013a03..89a857f 100644
--- a/git-mergetool--lib.sh
+++ b/git-mergetool--lib.sh
@@ -174,6 +174,43 @@ list_merge_tool_candidates () {
 	esac
 }
 
+show_tool_help () {
+	TOOL_MODE=merge
+	list_merge_tool_candidates
+	unavailable= available= LF='
+'
+	for i in $tools
+	do
+		merge_tool_path=$(translate_merge_tool_path "$i")
+		if type "$merge_tool_path" >/dev/null 2>&1
+		then
+			available="$available$i$LF"
+		else
+			unavailable="$unavailable$i$LF"
+		fi
+	done
+	if test -n "$available"
+	then
+		echo "'git mergetool --tool=<tool>' may be set to one of the following:"
+		echo "$available" | sort | sed -e 's/^/	/'
+	else
+		echo "No suitable tool for 'git mergetool --tool=<tool>' found."
+	fi
+	if test -n "$unavailable"
+	then
+		echo
+		echo 'The following tools are valid, but not currently available:'
+		echo "$unavailable" | sort | sed -e 's/^/	/'
+	fi
+	if test -n "$unavailable$available"
+	then
+		echo
+		echo "Some of the tools listed above only work in a windowed"
+		echo "environment. If run in a terminal-only session, they will fail."
+	fi
+	exit 0
+}
+
 guess_merge_tool () {
 	list_merge_tool_candidates
 	echo >&2 "merge tool candidates: $tools"
diff --git a/git-mergetool.sh b/git-mergetool.sh
index c50e18a..c0ee9aa 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -315,43 +315,6 @@ merge_file () {
 	return 0
 }
 
-show_tool_help () {
-	TOOL_MODE=merge
-	list_merge_tool_candidates
-	unavailable= available= LF='
-'
-	for i in $tools
-	do
-		merge_tool_path=$(translate_merge_tool_path "$i")
-		if type "$merge_tool_path" >/dev/null 2>&1
-		then
-			available="$available$i$LF"
-		else
-			unavailable="$unavailable$i$LF"
-		fi
-	done
-	if test -n "$available"
-	then
-		echo "'git mergetool --tool=<tool>' may be set to one of the following:"
-		echo "$available" | sort | sed -e 's/^/	/'
-	else
-		echo "No suitable tool for 'git mergetool --tool=<tool>' found."
-	fi
-	if test -n "$unavailable"
-	then
-		echo
-		echo 'The following tools are valid, but not currently available:'
-		echo "$unavailable" | sort | sed -e 's/^/	/'
-	fi
-	if test -n "$unavailable$available"
-	then
-		echo
-		echo "Some of the tools listed above only work in a windowed"
-		echo "environment. If run in a terminal-only session, they will fail."
-	fi
-	exit 0
-}
-
 prompt=$(git config --bool mergetool.prompt || echo true)
 
 while test $# != 0
-- 
1.8.1.1.367.g22b1720.dirty

  reply	other threads:[~2013-01-25  9:45 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-25  9:43 [PATCH 0/7] mergetool-lib improvements for --tool-help David Aguilar
2013-01-25  9:43 ` David Aguilar [this message]
2013-01-25  9:43 ` [PATCH 2/7] git-mergetool: remove redundant assignment David Aguilar
2013-01-25  9:43 ` [PATCH 3/7] git-mergetool: don't hardcode 'mergetool' in show_tool_help David Aguilar
2013-01-25  9:43 ` [PATCH 4/7] git-difftool: use git-mergetool--lib for "--tool-help" David Aguilar
2013-01-25  9:43 ` [PATCH 5/7] mergetools/vim: Remove redundant diff command David Aguilar
2013-01-25  9:43 ` [PATCH 6/7] mergetools: Fix difftool/mergetool --tool-help listing for vim David Aguilar
2013-01-25 10:23   ` Sebastian Schuberth
2013-01-25 10:28     ` David Aguilar
2013-01-25 10:34       ` Sebastian Schuberth
2013-01-25 11:39         ` Sebastian Schuberth
2013-01-25 10:38   ` John Keeping
2013-01-25 10:40     ` David Aguilar
2013-01-25 19:11       ` Junio C Hamano
2013-01-25  9:43 ` [PATCH 7/7] mergetool--lib: Improve show_tool_help() output David Aguilar
2013-01-25 19:54   ` John Keeping
2013-01-25 20:06     ` Junio C Hamano
2013-01-25 20:08     ` John Keeping
2013-01-25 20:16       ` Junio C Hamano
2013-01-25 20:46         ` John Keeping
2013-01-25 20:56           ` Junio C Hamano
2013-01-25 21:16             ` John Keeping
2013-01-25 21:47               ` Junio C Hamano
2013-01-25 22:02                 ` John Keeping
2013-01-25 22:03                   ` [PATCH 8/7] mergetool--lib: don't call "exit" in setup_tool John Keeping
2013-01-26  0:24                     ` Junio C Hamano
2013-01-26  7:01                       ` David Aguilar
2013-01-26 12:17                       ` [PATCH 1/2 v2] " John Keeping
2013-01-26 13:50                         ` [PATCH 1/2 v3] " John Keeping
2013-01-25 22:04                   ` [PATCH 9/7] mergetool--lib: fix path lookup in guess_merge_tool John Keeping

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=1359107034-14606-2-git-send-email-davvid@gmail.com \
    --to=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=john@keeping.me.uk \
    /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).