git/list[1] front-page[2] threads[3] people[4] search[5] about
 

just curious: what influences a commit hash?

From
Sstoecher@gmx.at <stoecher@gmx.at>
Date
Mar 5, 2009, 06:36 UTC
Message-ID
<20090305063632.42880@gmx.net>
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?
* Having created two repositories exactly the same way (the history is the same except for the commit times and hashes) I applied the same patch (using git am) and again I got different hashes for these commits. So in some way also the repository/branch influences the hash of a commit!?
From reading the Git user's manual, chapter 10, object storage format, I was not expecting this. Can someone explain or give a link to a more detailed description?
thank you,
Wolfgang
-- 
Computer Bild Tarifsieger! GMX FreeDSL - Telefonanschluss + DSL
für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a
Next: Matt Enright
Message 1 of 4 in “just curious: what influences a commit hash?”
  1. stoecher@gmx.atMar 5, 2009
  2. Matt EnrightMar 5, 2009
  3. Uwe Kleine-KönigMar 5, 2009
  4. Matthieu MoyMar 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.