Git development
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Matt Enright <awickedshimmy@gmail.com>
Cc: stoecher@gmx.at, git@vger.kernel.org
Subject: Re: just curious: what influences a commit hash?
Date: Thu, 5 Mar 2009 10:02:21 +0100	[thread overview]
Message-ID: <20090305090221.GA28687@pengutronix.de> (raw)
In-Reply-To: <1236237939.2421.38.camel@virgil>

Hi,

On Thu, Mar 05, 2009 at 02:25:39AM -0500, Matt Enright wrote:
> On Thu, 2009-03-05 at 07:36 +0100, stoecher@gmx.at wrote:
> > Hi,
> > 
> > being new to git I did some experiments with commits looking at the hashes. What I observed:
> > * The same commit (same file, same committer, same message) into different empty repositories (git init) gives different hashes. So I assume that also the time of the commit influences the hash. Is this intended? For what reason?
Yes, commit time and commit date influence the hash.

But the hashes for the corresponding trees should be the same.
Check the output of git rev-parse $commit^{tree}.

If you want to reproduce the exact same commit, you need to set
the env variables GIT_AUTHOR_DATE and GIT_COMMITTER_DATE.  (Not sure,
but GIT_AUTHOR_DATE might be handled by git am.)

Best regards
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

  reply	other threads:[~2009-03-05  9:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-05  6:36 just curious: what influences a commit hash? stoecher
2009-03-05  7:25 ` Matt Enright
2009-03-05  9:02   ` Uwe Kleine-König [this message]
2009-03-05 10:38 ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090305090221.GA28687@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=awickedshimmy@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=stoecher@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox