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

Re: [PATCH] fetch-pack: do not remove .git/shallow file when --depth is not specified

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 26, 2013, 06:09 UTC
Message-ID
<xmqqk3j9j84l.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1377483446-24834-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
Show 15 quoted lines
>  > The two possible fixes which I see are:
>  >
>  > 1) Replace back if (alternate_shallow_file) condition in fetch pack with
>  >    if (args->depth > 0)
>  >
>  > 2) alternate_shallow_file should be copy of shallow_lock.filename not a
>  >    reference to it
>
>  3) Move alternate_shallow_file to struct fetch_pack_args, which will
>     always be zero'd by memset
>
>  I think #1 is better. It's the original condition before 6035d6a
>  replaces it with "if (alternate_shallow_file)". Apparently I did not
>  see that fetch_pack() could be called twice. #3 is also an option,
>  but we still need static "shallow_lock" anyway, so I disregarded it.
Thanks.
Previous: Nguyễn Thái Ngọc Duy
Message 3 of 3 in “[BUG] Shallow fetch can result in broken git repo”
  1. Kacper KornetAug 26, 2013
  2. fetch-pack: do not remove .git/shallow file when --depth is not specifiedNguyễn Thái Ngọc Duy, Aug 26, 2013
  3. Junio C HamanoAug 26, 2013

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.