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

[PATCH 1/2] mergetool: don't require a work tree for --tool-help

From
Charles Bailey <charles@hashpling.org>
Date
Jul 19, 2014, 16:35 UTC
Message-ID
<1405787717-30476-1-git-send-email-charles@hashpling.org>
From: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
---
You can call git difftool --tool-help outside of a work tree but not
mergetool --tool-help but there's not real reason for this restriction
and it can be easily relaxed by deferring the require_work_tree call
until after the options have been parsed.
 git-mergetool.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/git-mergetool.sh b/git-mergetool.sh
index 9a046b7..e969dd0 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -14,7 +14,6 @@ OPTIONS_SPEC=
 TOOL_MODE=merge
 . git-sh-setup
 . git-mergetool--lib
-require_work_tree
 
 # Returns true if the mode reflects a symlink
 is_symlink () {
@@ -372,6 +371,8 @@ prompt_after_failed_merge () {
 	done
 }
 
+require_work_tree
+
 if test -z "$merge_tool"
 then
 	# Check if a merge tool has been configured
-- 
2.0.2.611.g8c85416
Next: Charles Bailey
Message 1 of 6 in “mergetool: don't require a work tree for --tool-help”
  1. 1/2 mergetool: don't require a work tree for --tool-helpCharles Bailey, Jul 19, 2014
  2. 2/2 difftool: don't assume that default sh is saneCharles Bailey, Jul 19, 2014
  3. John KeepingJul 19, 2014
  4. Charles BaileyJul 19, 2014
  5. David AguilarJul 29, 2014
  6. David AguilarJul 29, 2014

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.