From: Junio C Hamano <gitster@pobox.com>
To: Harald Nordgren <haraldnordgren@gmail.com>
Cc: Harald Nordgren via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH] object-name: explain why <ref>~N fails in a shallow clone
Date: Mon, 21 Sep 2026 16:00:18 -0700 [thread overview]
Message-ID: <xmqqqzimjjlp.fsf@gitster.g> (raw)
In-Reply-To: <CAHwyqnX77+qsstUmvvLw5Jvfdoi4V3YVagMddYxnWodHR9oq-g@mail.gmail.com> (Harald Nordgren's message of "Tue, 22 Sep 2026 00:17:46 +0200")
Harald Nordgren <haraldnordgren@gmail.com> writes:
>> It is obvious that users would see such a message when they say
>>
>> $ git show HEAD~20
>> $ git log HEAD~20..HEAD
>>
>> but would they see the same when
>>
>> $ git log -20 HEAD
>> $ git log --since=2.months HEAD
>>
>> and internally HEAD~20 fails to resolve? Should they see the same
>> hint?
>
> But I think the 'log -20' doesn't even give an error, so where would
> we show that message?
Where? To their terminal ;-)?
To end users, "git log -20 HEAD" that stops only after showing 2
commits is just as puzzling as, if not more puzzling than, "git show
HEAD~20" that complains "What commit are you talking about?"
At least the latter has an error message that says the commit the
user thought they gave (i.e., HEAD~20) was not interpreted as a
commit, and that might give them enough clue to remind them that
they are the responsible ones for the unexpected beahviour by
initially cloning the repository with a "--depth" option. On the
other hand, "git log -20" that stops way before they expect it would
does not even give them such a hint.
I thought that helping that case would have much more benefit, hence
my question.
next prev parent reply other threads:[~2026-09-21 23:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 9:53 [PATCH] object-name: explain why <ref>~N fails in a shallow clone Harald Nordgren via GitGitGadget
2026-09-20 21:59 ` D. Ben Knoble
2026-09-21 16:50 ` Junio C Hamano
2026-09-21 22:17 ` Harald Nordgren
2026-09-21 23:00 ` Junio C Hamano [this message]
2026-09-22 13:38 ` [PATCH v2] shallow: advise when a walk stops at a shallow boundary Harald Nordgren via GitGitGadget
2026-09-22 21:20 ` Junio C Hamano
2026-09-23 18:55 ` [PATCH v3] object-name: explain why <rev>~N fails in a shallow clone Harald Nordgren via GitGitGadget
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=xmqqqzimjjlp.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=haraldnordgren@gmail.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