[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: git committish for 1 year ago
From: |
Graham Percival |
Subject: |
Re: git committish for 1 year ago |
Date: |
Thu, 8 Dec 2011 03:20:12 -0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Dec 08, 2011 at 12:08:30PM +0100, David Kastrup wrote:
> Graham Percival <address@hidden> writes:
>
> > ~/src/lilypond$ git rev-parse "origin/address@hidden months ago}"
> > 95fab3ca9692b197c2a26c5249d7f30b114ab451
> >
>
> Uh, @ specifications are for the _reflog_. That is something maintained
> strictly locally, for fixing things when you messed up the branch heads
> beyond repair.
huh. The impression I got from here
http://stackoverflow.com/questions/949314/how-to-retrieve-the-hash-for-the-current-commit-in-git
was that git rev-parse got me the abcd1234 hash.
> git log "--since=1 year ago" "--until=9 months ago"
all I want is the commit hash, though. I suppose I could pipe
that through git log ... | head -n 1 | | cut -f 2, but that would
be a pain. I need a single abcd1234 (which corresponds to the
commit approximately 3 months ago) to feed to gitstats; I don't
want a list of committishes.
I've managed to get this far:
git log "--since=1 year ago" --pretty=format:'%H' -n 1
but that appears to show the latest commit. Adding --reverse
doesn't work. :(
I suppose I could add something like
"--since=364 days ago" "--until=362 days ago"
but then it might break if there was no update exactly 363 days
ago.
Cheers,
- Graham