{"thread":{"id":"25140","subject":"Commiting unchanged tree","startedAt":"2010-09-18T08:15:11Z","lastAt":"2010-09-18T09:30:04Z","messageCount":2,"participants":["Maaartin","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"150936","messageId":"loom.20100918T095640-130@post.gmane.org","threadId":"25140","inReplyTo":null,"subject":"Commiting unchanged tree","fromName":"Maaartin","fromEmail":"grajcar1@seznam.cz","sentAt":"2010-09-18T08:15:11Z","receivedAt":"2010-09-18T08:15:11Z","isPatch":false,"sender":{"key":"grajcar1@seznam.cz","avatar":null},"body":"I thought that calling\n\ngit commit --amend -m \"A message\"\n\ntwice in a row should lead to an error saying \"nothing to commit (working \ndirectory clean)\", but it doesn't. Or at least, the result of the second commit \nshould be the same as the result of the first one, but I keep getting a \ndifferent hash each time\n\n# git commit --amend -m \"A message\"\n[master b8cf1c2] A message\n# git commit --amend -m \"A message\"\n[master 6c8ea30] A message\n# git commit --amend -m \"A message\"\n[master be318b3] A message\n\nI wonder if everything is fine with my repo since I was doing some funny \nrebasing and filtering and I'm quite new to git.\n"},{"id":"150938","messageId":"AANLkTi=ODMjevBTLSK8W1AcdiiSiX=yfQfr_kK7Bh-cn@mail.gmail.com","threadId":"25140","inReplyTo":"loom.20100918T095640-130@post.gmane.org","subject":"Re: Commiting unchanged tree","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-18T09:30:04Z","receivedAt":"2010-09-18T09:30:04Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sat, Sep 18, 2010 at 08:15, Maaartin <grajcar1@seznam.cz> wrote:\n> I thought that calling\n>\n> git commit --amend -m \"A message\"\n>\n> twice in a row should lead to an error saying \"nothing to commit (working\n> directory clean)\", but it doesn't. Or at least, the result of the second commit\n> should be the same as the result of the first one, but I keep getting a\n> different hash each time\n>\n> # git commit --amend -m \"A message\"\n> [master b8cf1c2] A message\n> # git commit --amend -m \"A message\"\n> [master 6c8ea30] A message\n> # git commit --amend -m \"A message\"\n> [master be318b3] A message\n>\n> I wonder if everything is fine with my repo since I was doing some funny\n> rebasing and filtering and I'm quite new to git.\n\nThis is expected behavior. You're telling Git to amend the latest\ncommit with a new commit message (which happens to be equivalent to\nthe old one), and your sha1 keeps changing because the `commiter` time\nentry in the commit changes every time you commit (well, with a\ngranularity of 1 second):\n\n    v foo (master) $ git commit --amend -m\"blah\"; GIT_PAGER=cat git\nshow --pretty=raw\n    [master 9cc96c7] blah\n     0 files changed, 0 insertions(+), 0 deletions(-)\n     create mode 100644 blah\n    commit 9cc96c71ae30f94afaf891be58671a0adf89cedb\n    tree c4bf67b477e5e7470266b4227a664f7b175c9d4a\n    author Ævar Arnfjörð Bjarmason <avarab@gmail.com> 1284802065 +0000\n    committer Ævar Arnfjörð Bjarmason <avarab@gmail.com> 1284802096 +0000\n\n        blah\n\n    diff --git a/blah b/blah\n    new file mode 100644\n    index 0000000..e69de29\n    v foo (master) $ git commit --amend -m\"blah\"; GIT_PAGER=cat git\nshow --pretty=raw\n    [master bc71b18] blah\n     0 files changed, 0 insertions(+), 0 deletions(-)\n     create mode 100644 blah\n    commit bc71b18ae254b33e895ee840825bf357baa40e00\n    tree c4bf67b477e5e7470266b4227a664f7b175c9d4a\n    author Ævar Arnfjörð Bjarmason <avarab@gmail.com> 1284802065 +0000\n    committer Ævar Arnfjörð Bjarmason <avarab@gmail.com> 1284802097 +0000\n\n        blah\n\n    diff --git a/blah b/blah\n    new file mode 100644\n    index 0000000..e69de29\n    v foo (master) $\n\nNote the difference between 1284802096 and 1284802097 there.\n"}]}