git-ls-tree prints the blob’s (file’s) hash. It has nothing to do with
a commit, which has its own hash (as you have already noticed).

As far as I can get, your boss needs a commit hash, as he wants to
know who and when introduced the bug. For that, you can even use
git-bisect (as I suggested earlier), or maybe git-blame.

git-blame is also very powerful as it will annotate the whole file,
showing who and when has modified a file, together with the hash of
the commit. It is a bit hard to find deleted lines with that, though.

On 11 June 2014 18:50, John Fisher <fishook2...@gmail.com> wrote:
>
>
> On Wednesday, June 11, 2014 8:09:44 AM UTC-7, Dale Worley wrote:
>>
>> > From: John Fisher <fisho...@gmail.com>
>>
>> > I still don't understand what the commit-SHA given out by git ls-tree is
>> > for? If it doesn't correspond to a commit on the file as seen in git
>> > log,
>> > what's it used for?
>>
>> The *commit* has a SHA, and that is what is listed in the git-log
>> entry for the commit.
>
>
>
> yes, per file
>
>>
>>
>> The commit points to a *file tree*, which has its own SHA.
>
>
>
> yes, in this case a commit as a tag with its own SHA
>>
>>
>> The file tree points to all of the *file objects", each of which has
>> its own SHA.
>
>
> yes as listed in git log and an alternate list in git ls-tree
>
>
>>
>>
>> Every commit contains the complete set of files that are in the file
>> tree at the moment the commit is made.
>
>
>
> yes
>
>>
>>
>> git-ls-tree, when given the SHA of a commit, lists the SHAs of the
>> file objects pointed to by the file tree that is pointed to by the
>> commit.
>
>
> but that output does not agree with git log!
>
>
>>
>>
>> Dale
>
>
>
> Thanks for helping Dale. No doubt there is something essential I don't
> grasp...
> What I am asking about is here copied out of my tree. 1.2 is a tag of
> course:
>
> $ git ls-tree -r 1.2  | grep rmapi_bcmxlat.c
> 100644 blob 990c3e0f7efc8ddf869dbb39ba0065c9e9578df4    rmapi_bcmxlat.c
>
> $ git log rmapi_bcmxlat.c | grep 990c3e0f7ef
> $     ( no match!)
>
> My expectation is to get the result from the command you suggested ( the
> boss likes it BTW)
>
> $ git log -n 1 1.2 rmapi_bcmxlat.c
> commit 1d01be262f785dbf38ce3a22a54b99bdcb6ff620
> ...
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to