git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Tim Henigan <tim.henigan@gmail.com>
Cc: git@vger.kernel.org, davvid@gmail.com
Subject: Re: [PATCH 9/9 v8] difftool: print list of valid tools with '--tool-help'
Date: Wed, 28 Mar 2012 11:58:01 -0700	[thread overview]
Message-ID: <7vvclov9hi.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1332959684-2231-1-git-send-email-tim.henigan@gmail.com> (Tim Henigan's message of "Wed, 28 Mar 2012 14:34:44 -0400")

Tim Henigan <tim.henigan@gmail.com> writes:

> Changes in v8:
>   - Replaced 'glob' with 'File::Find'. Glob will fail if file paths include
>     spaces.  Using File::Find overcomes that limitation.

OK, but doesn't File::Find recurse into its subdirectories?  If you create
a 'foo' directory there and drop a 'bar' script in it, is the rest of the
code prepared to give you "git difftool -t foo/bar"?

>   - Added 'TOOL_MODE=DIFF' prior to calling 'git-mergetool--lib.sh'. This
>     insures that the shell script executes as designed.
>   - difftool now calls 'can_diff' from 'git-mergetool--lib.sh' to insure that
>     only tools that are capable of diffing are shown as valid options. For
>     example, 'tortoisemerge' cannot be used as a diff viewer.

Good that you caught these brown-paper-bag bugs ;-) It feels a bit awkward
that nobody pointed these out, even though the series has been queued in
'pu' since its early iterations.

> diff --git a/git-difftool.perl b/git-difftool.perl
> index 0fa131c..15fd572 100755
> --- a/git-difftool.perl
> +++ b/git-difftool.perl
> @@ -38,6 +39,40 @@ USAGE
>  	exit($exitcode);
>  }
>  
> +sub print_tool_help
> +{
> +	my ($cmd, @found, @notfound, @tools);
> +	my $gitpath = Git::exec_path();
> +
> +	find(sub { push(@tools, $_) unless (-d $_) }, "$gitpath/mergetools");
> +
> +	for (@tools) {
> +		my $tool = $_;
> +		next if ($tool eq "defaults");

Now you use File::Find::find(), you probably should do this kind of
trivial filtering inside the callback, no?

  reply	other threads:[~2012-03-28 18:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-28 18:34 [PATCH 9/9 v8] difftool: print list of valid tools with '--tool-help' Tim Henigan
2012-03-28 18:58 ` Junio C Hamano [this message]
2012-03-28 19:48   ` Tim Henigan
2012-03-28 20:02     ` Junio C Hamano
2012-03-28 20:16       ` Tim Henigan

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=7vvclov9hi.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=tim.henigan@gmail.com \
    /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).