Re: [PATCH v2 3/3] difftool --dir-diff: symlink all files matching the working tree
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 14, 2013, 22:31 UTC
- Message-ID
- <7vobelwr3a.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20130314222415.GC4256@serenity.lan>
John Keeping <john@keeping.me.uk> writes:
Show 19 quoted lines
>> > +for f in file file2 sub/sub >> > +do >> > + echo "$f" >> > + readlink "$2/$f" >> > +done >actual >> > +EOF >> >> When you later want to enhance the test to check a combination of >> difftool arguments where some paths are expected to become links and >> others are expected to become real files, wouldn't this helper >> become a bit awkward to use? The element that expects a real file >> could be an empty line to what corresponds to the output from >> readlink, but still... >> ... > > It looks like t3903 uses "ls -l" for this sort of test, perhaps > something like this covers these cases better: > ... > grep "-> $workdir/file" file.actual
Writing it without -e would confuse some implementations of grep into thinking "-" introduces an option, realizing it does not support the "->" option, and then barfing ;-)
What I had in mind was more along the lines of...
for f
do
echo "$f"
readlink "$2/$f" || echo "# not a link $f"
doneso that your "expect" list can become
file
$(pwd)/realdir/file
modifiedone.txt
# not a link modifiedone.txtIn any case, this "say blank if you expect a non symlink" is not an urgent issue that needs to be fixed or anything like that, so let's queue the v2 for now and see what happens.
Thanks.