From: Junio C Hamano <gitster@pobox.com>
To: liangxiong zhu <lxzhu@outlook.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Git log bug
Date: Fri, 29 Sep 2023 08:12:44 -0700 [thread overview]
Message-ID: <xmqqil7thv2r.fsf@gitster.g> (raw)
In-Reply-To: <LV2PR19MB5767BB3F887CDB46F571656DAFC0A@LV2PR19MB5767.namprd19.prod.outlook.com> (liangxiong zhu's message of "Fri, 29 Sep 2023 09:35:33 +0000")
liangxiong zhu <lxzhu@outlook.com> writes:
> git clone $repo_url $repo_name
> cd $repo_name
> mkdir dir01
> mkdir dir02
> touch dir01/file01.txt
> git add .
> git commit -m 'Add file01.txt'
> git push
>
> touch dir02/file02.txt
> git add .
> git commit -m 'Add file02.txt'
> git push
>
> git log -1 -- dir01
>
> What did you expect to happen? (Expected behavior)
> print out commit with message 'Add file01.txt'
>
> What happened instead? (Actual behavior)
> print out commit with message 'Add file02.txt'
Thanks, but it does not reproduce with the above procedure.
Following the above (with $repo_name set to "trash" that is not a
name of any existing directory in the current directory, and
$repo_url set to a local repository that exists but without any
history), I got the "Add file01.txt" from the last step.
I got
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch.
fatal: the remote end hung up unexpectedly
error: failed to push some refs to '/var/tmp/x/./empty.git'
after both of "git push", but becuase "git log" that does not say
where to start cares only about HEAD, in the above reproduction
precipe "git push" should be irrelevant (i.e., if your copy of Git
is broken to exhibit the above reported bug, it should show the same
symptom without these steps to run "git push").
If there are some hooks that modifies the history after your "git
push", it would be a different story, but otherwise I am not sure
how any version of Git would exhibit such a symptom.
Puzzled.
prev parent reply other threads:[~2023-09-29 15:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-29 9:35 Git log bug liangxiong zhu
2023-09-29 15:12 ` Junio C Hamano [this message]
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=xmqqil7thv2r.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=lxzhu@outlook.com \
/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).