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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 13, 2014, 19:16 UTC
Message-ID
<xmqqsiir3hlk.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1413016778-94829-2-git-send-email-davvid@gmail.com>
David Aguilar <davvid@gmail.com> writes:
Show 35 quoted lines
> From: Charles Bailey <cbailey32@bloomberg.net>
>
> Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
> Signed-off-by: David Aguilar <davvid@gmail.com>
> ---
> Changes since v2:
>
> This now uses the new git_dir_init function.
>
>  git-mergetool.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/git-mergetool.sh b/git-mergetool.sh
> index 96a61ba..cddb533 100755
> --- a/git-mergetool.sh
> +++ b/git-mergetool.sh
> @@ -10,11 +10,11 @@
>  
>  USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [file to merge] ...'
>  SUBDIRECTORY_OK=Yes
> +NONGIT_OK=Yes
>  OPTIONS_SPEC=
>  TOOL_MODE=merge
>  . git-sh-setup
>  . git-mergetool--lib
> -require_work_tree
>  
>  # Returns true if the mode reflects a symlink
>  is_symlink () {
> @@ -378,6 +378,9 @@ prompt_after_failed_merge () {
>  	done
>  }
>  
> +require_work_tree
> +git_dir_init
This is somewhat curious.  Shouldn't the order of these swapped?
> +
>  if test -z "$merge_tool"
>  then
>  	# Check if a merge tool has been configured
Previous: David AguilarNext: David Aguilar
Message 4 of 6 in “git-sh-setup: move GIT_DIR initialization into a function”
  1. 1/3 git-sh-setup: move GIT_DIR initialization into a functionDavid Aguilar, Oct 11, 2014
  2. 2/3 mergetool: don't require a work tree for --tool-helpDavid Aguilar, Oct 11, 2014
  3. 3/3 difftool: don't assume that default sh is saneDavid Aguilar, Oct 11, 2014
  4. Junio C HamanoOct 13, 2014
  5. David AguilarOct 15, 2014
  6. David AguilarOct 15, 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.