
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlug] "How to"
Bruno Raoult writes:
> On Mon, May 12, 2014 at 10:52 AM, Stephen J. Turnbull <stephen@example.com> wrote:
>> For two files in the same directory that have the same content but
>> different names,
>>
>> git cat-file tree `git cat-file commit HEAD | grep tree | cut -b 5-` \
>> | sort -f 3 | uniq -D -w 52
>>
>> (untested; probably requires GNU uniq). To handle recursion is
>> (recursively ;-) left as an exercise for the reader.
>
> If files are in the same dir, why using git?
There's no restriction to a single directory, it's just that in a
single directory a one-liner can be used.
> You offered a solution (that I did not test) using git. I am sure
> readers will propose alternatives. And this was the target of the
> question: which solution would be the best for such a requisite?
"Best"? Depends on lots of things.
"Good"? Sure -- git is a highly optimized application for tracking
and comparing the contents of files. I happen to know a bit about
extracting the information you want from a git object database. git
would be a lot more reliable than coding the algorithms myself.
> Let say another way:
What makes you think I didn't understand the first time?
Home |
Main Index |
Thread Index