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

Re: [PATCH] upload-pack: reject shallow requests that would return nothing

From
Duy Nguyen <pclouds@gmail.com>
Date
May 28, 2018, 18:48 UTC
Message-ID
<CACsJy8B7g-J8XeWYpY9SG1p51-fBLE2-V5872uWbyBXY2aVoEA@mail.gmail.com>
In-Reply-To
<xmqqy3g4jpck.fsf@gitster-ct.c.googlers.com>
On Mon, May 28, 2018 at 7:55 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 20 quoted lines
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>
>> To avoid this, if rev-list returns nothing, we abort the clone/fetch.
>> The user could adjust their request (e.g. --shallow-since further back
>> in the past) and retry.
>
> Yeah, that makes sense.
>
>> Another possible option for this case is to fall back to a default
>> depth (like depth 1). But I don't like too much magic that way because
>> we may return something unexpected to the user.
>
> I agree that it would be a horrible fallback.  I actually am
> wondering if we should just silently return no objects without even
> telling the user there is something unexpected happening.  After
> all, the user may well be expecting with --shallow-since that is too
> recent that the fetch may not result in pulling anything new, and
> giving a "die" message, which now needs to be distinguished from
> other forms of die's like network connectivity or auth failures, is
> not all that helpful.

An empty fetch is probably ok (though I would need to double check if anything bad would happen or git-fetch would give some helpful suggestion). git-clone on the other hand should actually clean this up with a good advice. I'll need to check and come back with v2 later.

-- 
Duy
Previous: Junio C HamanoNext: Duy Nguyen
Message 5 of 8 in “bug: --shallow-since misbehaves on old branch heads”
  1. Andreas KreyMay 22, 2018
  2. Duy NguyenMay 23, 2018
  3. upload-pack: reject shallow requests that would return nothingNguyễn Thái Ngọc Duy, May 26, 2018
  4. Junio C HamanoMay 28, 2018
  5. Duy NguyenMay 28, 2018
  6. Duy NguyenJun 2, 2018
  7. Junio C HamanoJun 4, 2018
  8. Duy NguyenJun 4, 2018

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.