Re: "git log -- SHA-1" - how to get/simulate this functionality?
From: Alex Riesen <hidden>
Date: 2016-06-15 22:48:42
On Mon, Apr 26, 2010 at 20:57, Alex Riesen [off-list ref] wrote:
On Mon, Apr 26, 2010 at 20:22, Eugene Sajine [off-list ref] wrote:quoted
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.