This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Moving to git
- From: Jason Merrill <jason at redhat dot com>
- To: Richard Earnshaw <Richard dot Earnshaw at foss dot arm dot com>, Jakub Jelinek <jakub at redhat dot com>, Jeff Law <law at redhat dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 25 Aug 2015 23:47:26 -0400
- Subject: Re: Moving to git
- Authentication-results: sourceware.org; auth=none
- References: <55D61512 dot 8010002 at redhat dot com> <55D61B23 dot 3000309 at redhat dot com> <55D63403 dot 4000603 at redhat dot com> <20150824081741 dot GB9425 at tucnak dot redhat dot com> <55DB3991 dot 4030701 at redhat dot com> <20150824154355 dot GM9425 at tucnak dot redhat dot com> <55DB3E2A dot 1030703 at foss dot arm dot com>
On 08/24/2015 11:54 AM, Richard Earnshaw wrote:
Why not use the output of 'git show -s --format=%ct-%h'?
$ git show -s --format=%ct-%h master
1440153969-f57da59
That gives you a unix timestamp for the commit, followed by the hash.
Now you've got a fully ordered way of referring to the commit, but still
have access to the hash code.
You don't even need to worry about the hash code, you can use the
timestamp by itself. Given the timestamp,
git log -1 --until 1440153969
will show you the relevant commit, or
git rev-list HEAD --max-count=1 --until 1440153969
will give you the hash.
So that seems like a suitable monotonically increasing identifier. What
do you think, Jakub?
Jason