Re: "git log -- SHA-1" - how to get/simulate this functionality?

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

 



On Mon, Apr 26, 2010 at 20:57, Alex Riesen <raa.lkml@xxxxxxxxx> wrote:
> On Mon, Apr 26, 2010 at 20:22, Eugene Sajine <euguess@xxxxxxxxx> wrote:
>> Well thank you for that, but that gives me what i already know - the content.
>> I need to "reverse engineer" the history by having only the content
>> and its SHA-1 in order to indentify the last commitID and get all
>> relevant info (author, date etc. )
>
> Hmm. In that case, your using of git log look like a good way to get the
> information. If you wanted an output format which is better suited for
> automated parsing, you can look at "git rev-list --pretty=format:...",
> let it output only commit and tree hashes, and grep the output of
> "git ls-tree" for your hash...

Actually, "git log --no-abbrev --raw --oneline" looks very simple to parse.
By the way, you may get ambiguous results: any file any time could have
had the given hash. IOW, by looking at the whole history you may see different
files having the same hash. It does mean the same content, so maybe its
OK for your purposes.
--
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]