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

Re: [PATCH 1/1] shallow: fix relative deepen on non-shallow repositories

From
Junio C Hamano <gitster@pobox.com>
Date
May 11, 2026, 00:09 UTC
Message-ID
<xmqqzf26x0vi.fsf@gitster.g>
In-Reply-To
<20260506215647.3011769-1-samo_pogacnik@t-2.net>
Samo Pogačnik <samo_pogacnik@t-2.net> writes:
> The previous patch "shallow: handling fetch relative-deepen"
Whose "previous patch" are we talking about in [PATCH 1/1]?

Please refer to the commit with "git show -s --format=reference", if you are talking about a public commit etched in the history.

> introduced a bug where using --deepen=<n> on a non-shallow
> repository incorrectly treated the value as an absolute depth,
> resulting in a shallow fetch and truncated history.
That's unfortunate.

We obviously should not truncate when asked to "deepen" (i.e., the user asked to get more history, not reset the number of commits we have to a specific depth), and making the operation in this situation a no-op may be a good first step, but should we just do so silently, instead of giving a warning/diagnosis?

Show 8 quoted lines
> This patch prevents any modification when a relative deepen is
> requested on a non-shallow repository.
>
> A test is added to ensure that history is not changed when
> --deepen is used on a non-shallow repository.
>
> Reported-by: Owen Stephens <owen@owenstephens.co.uk>
> Signed-off-by: Samo Pogačnik <samo_pogacnik@t-2.net>
Previous: Samo PogačnikNext: René Scharfe
Message 11 of 14 in “[Bug] fetch --deepen truncates history in v2.54.0”
  1. Owen StephensApr 29, 2026
  2. Owen StephensApr 29, 2026
  3. D. Ben KnobleApr 29, 2026
  4. Mikael MagnussonApr 30, 2026
  5. René ScharfeMay 2, 2026
  6. René ScharfeMay 2, 2026
  7. Samo PogačnikMay 5, 2026
  8. René ScharfeMay 5, 2026
  9. Samo PogačnikMay 5, 2026
  10. 1/1 shallow: fix relative deepen on non-shallow repositoriesSamo Pogačnik, May 6, 2026
  11. Junio C HamanoMay 11, 2026
  12. René ScharfeMay 11, 2026
  13. Junio C HamanoMay 11, 2026
  14. shallow: fix relative deepen on non-shallow repositoriesSamo Pogačnik, May 11, 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.