Why 'git commit --amend' generates different HEAD sha1 each time when no content changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



AFAIK, commit sha1 is only determined by commit object content (say
parent commit, tree sha1 and so on). So why 'git commit --amend'
changes the commit sha1 when no content changes as following shows.

$ mkdir A && cd A && echo foo >foo

$ git init && git add foo && git commit -m 'add file foo'

Created initial commit 8626800: add file foo
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 foo

$ git commit --amend
Created commit 3591035: add file foo
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 foo

$ git commit --amend
Created commit 3927d9a: add file foo
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 foo

-- 
Ping Yin
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux