git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] object-name: explain why <ref>~N fails in a shallow clone

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 21, 2026, 23:00 UTC
Message-ID
<xmqqqzimjjlp.fsf@gitster.g>
In-Reply-To
<CAHwyqnX77+qsstUmvvLw5Jvfdoi4V3YVagMddYxnWodHR9oq-g@mail.gmail.com>
Harald Nordgren <haraldnordgren@gmail.com> writes:
Show 15 quoted lines
>> 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.

Previous: Harald NordgrenNext: Harald Nordgren via GitGitGadget
Message 5 of 26 in “object-name: explain why <ref>~N fails in a shallow clone”
  1. object-name: explain why <ref>~N fails in a shallow cloneHarald Nordgren via GitGitGadget, Sep 20, 2026
  2. D. Ben KnobleSep 20, 2026
  3. Junio C HamanoSep 21, 2026
  4. Harald NordgrenSep 21, 2026
  5. Junio C HamanoSep 21, 2026
  6. shallow: advise when a walk stops at a shallow boundaryHarald Nordgren via GitGitGadget, Sep 22, 2026
  7. Junio C HamanoSep 22, 2026
  8. object-name: explain why <rev>~N fails in a shallow cloneHarald Nordgren via GitGitGadget, Sep 23, 2026
  9. Junio C HamanoNov 2, 2026
  10. Harald NordgrenNov 2, 2026
  11. Kristoffer HaugsbakkNov 2, 2026
  12. Harald NordgrenNov 2, 2026
  13. Patrick SteinhardtNov 2, 2026
  14. Kristoffer HaugsbakkNov 2, 2026
  15. Harald NordgrenNov 2, 2026
  16. Patrick SteinhardtNov 2, 2026
  17. Harald NordgrenNov 2, 2026
  18. Phillip WoodNov 2, 2026
  19. Harald NordgrenNov 2, 2026
  20. Junio C HamanoNov 2, 2026
  21. Junio C HamanoNov 2, 2026
  22. Kristoffer HaugsbakkNov 2, 2026
  23. Harald NordgrenNov 2, 2026
  24. Patrick SteinhardtNov 2, 2026
  25. Junio C HamanoNov 2, 2026
  26. Junio C HamanoNov 5, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.