From: "Ping Yin" <pkufranky@gmail.com>
To: "Git Mailing List" <git@vger.kernel.org>
Subject: Why 'git commit --amend' generates different HEAD sha1 each time when no content changes
Date: Sun, 30 Dec 2007 18:56:26 +0800 [thread overview]
Message-ID: <46dff0320712300256g36e825a2g711d98b565e361f9@mail.gmail.com> (raw)
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
next reply other threads:[~2007-12-30 10:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-30 10:56 Ping Yin [this message]
[not found] ` <1199012360.15996.6.camel@futex>
2007-12-30 11:19 ` Why 'git commit --amend' generates different HEAD sha1 each time when no content changes Ping Yin
2007-12-30 11:20 ` Ping Yin
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=46dff0320712300256g36e825a2g711d98b565e361f9@mail.gmail.com \
--to=pkufranky@gmail.com \
--cc=git@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).