mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <>
To: Angelo Borsotti <>
Cc: Philip Oakley <>, Git List <>
Subject: Re: Git add documentation error
Date: Thu, 27 Oct 2022 10:28:52 -0700	[thread overview]
Message-ID: <xmqqo7txmazv.fsf@gitster.g> (raw)
In-Reply-To: <> (Angelo Borsotti's message of "Thu, 27 Oct 2022 18:57:21 +0200")

Angelo Borsotti <> writes:

> Then I displayed the contents of both commits, and seen that it is pretty much
> the same:
> D:\gittest>git show --pretty="" --name-only 91ef45d
> D:\gittest>git show --pretty="" --name-only 8ec0c2f

You did not display the contents of these commits, though.  For each
of these commits, you checked the _difference_ between it and its

In the previous sequence

>> > I have tested this in the following way: I have two files: and
>> >
>> >     > git status
>> >     On branch master
>> >     nothing added to commit
>> >     > ... edit
>> >     > git status
>> >     On branch master
>> >     Changes not staged for commit:
>> >     (use "git add <file>..." to update what will be committed)
>> >     (use "git restore <file>..." to discard changes in working directory)
>> >         modified:
>> >      > git add
>> >      > git add
>> >      > git commit -m "commit2"
>> >      D:\gittest>git commit -m "commit1"
>> >      [master 91ef45d] commit1
>> >      1 file changed, 1 insertion(+), 1 deletion(-)

91ef45d, relative to its parent (i.e. the previous state before the
commit was made), was modified. was not.

So, what you saw

> D:\gittest>git show --pretty="" --name-only 91ef45d

is very much consistent with what you did.  And the above does not
mean 91ef45d does not have  If you want to "display" the
contents of commit 91ef45d, you could

	$ git ls-tree -r --name-only 91ef45d

which lists all the contents in commit 91ef45d


	$ git diff --name-only $(git hash-object --stdin -t tree </dev/null) 91ef45d

which compares all the contents in commit 91ef45d with a completely
empty tree.

In them, you'd see both C1 and C2, among other things that you did
not modify in 91ef45d.

  reply	other threads:[~2022-10-27 17:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-27 11:53 Git add documentation error Angelo Borsotti
2022-10-27 15:10 ` Philip Oakley
     [not found]   ` <>
2022-10-27 16:16     ` Philip Oakley
2022-10-27 16:57       ` Angelo Borsotti
2022-10-27 17:28         ` Junio C Hamano [this message]
2022-10-27 17:46           ` Angelo Borsotti
2022-10-27 18:44             ` Junio C Hamano
2022-10-27 19:15               ` Angelo Borsotti

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:

  List information:

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

  git send-email \
    --in-reply-to=xmqqo7txmazv.fsf@gitster.g \ \ \ \ \

* 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.
Code repositories for project(s) associated with this public inbox

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 read-only IMAP folder(s) and NNTP newsgroup(s).