Re: A new way to get a sha1?
From: Martin Langhoff <hidden>
Date: 2016-06-15 22:54:23
On Mon, Jul 30, 2012 at 11:45 AM, Junio C Hamano [off-list ref] wrote:
git show -s ':/^t1100-.*: Fix an interm'
That doesn't work for me (git 1.7.10.4 as per Fedora 18 rpms) in
git.git. But the idea is sound -- git can give you the sha1 trivially.
You don't need additional glue.
But any ref definition can be turned into a sha1 with this snippet:
git show --pretty=format:%H HEAD
If you want to get the last 10 sha1s, use the same "pretty" with git log
git log --pretty=format:%H HEAD | head
This is all predicated on passing the info to something else. For git
commands, you can always use the rich ref notation git supports.
cheers,
m
--
martin.langhoff@gmail.com
martin@laptop.org -- Software Architect - OLPC
- ask interesting questions
- don't get distracted with shiny stuff - working code first
- http://wiki.laptop.org/go/User:Martinlanghoff