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
Jun 4, 2018, 14:44 UTC
Message-ID
<CACsJy8D5105r0=_pzfz8fTciQeXWCBe-qhsobR+_TJvfz7cv4Q@mail.gmail.com>
In-Reply-To
<xmqq602y6d8c.fsf@gitster-ct.c.googlers.com>
On Mon, Jun 4, 2018 at 12:46 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
>
>> Shallow clones with --shallow-since or --shalow-exclude work by
>> running rev-list to get all reachable commits, then draw a boundary
>> between reachable and unreachable and send "shallow" requests based on
>> that.
>>
>> The code does miss one corner case: if rev-list returns nothing, we'll
>> have no border and we'll send no shallow requests back to the client
>> (i.e. no history cuts). This essentially means a full clone (or a full
>> branch if the client requests just one branch). One example is the
>> oldest commit is older than what is specified by --shallow-since.
>
> "the newest commit is older than", isn't it?  That is, the cutoff
> point specified is newer than the existing history.

Yes. As a result, the entirely history is cut, including the tip. --shallow-exclude could also lead to this situation if the user accidentally excludes everything.

-- 
Duy
Previous: Junio C Hamano
Message 8 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.