Re: [PATCH 9/9 v8] difftool: print list of valid tools with '--tool-help'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tim Henigan <tim.henigan@xxxxxxxxx> writes:

> On Wed, Mar 28, 2012 at 2:58 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
>> Tim Henigan <tim.henigan@xxxxxxxxx> writes:
>>
>> 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"?
>
> It does recurse, but in this context '$_' only contains the current
> file name within the directory...not the directory itself [1].  So if
> we call 'find' on a directory that contains:
>
>   foo
>   bar/
>       baz
>
> then @tools = ('foo', 'baz')

That is even worse, no?  Is the rest of the code prepared to give you "git
difftool -t baz" in such a layout?  What if you have another baz next to
foo and bar?

What I was hinting at was that you may want to $File::Find::prune=1 when
you find a subdirectory.  While at it, you may also want to replace
the "unless -d $_" with "if -f $_ && -x _" or something.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]