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

Re: [Bug] fetch --deepen truncates history in v2.54.0

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Apr 29, 2026, 13:16 UTC
Message-ID
<CALnO6CBzd0coeyJ9B+EkGWsSNEVTdVLvcVmEraGNxnUm5wXy=g@mail.gmail.com>
In-Reply-To
<CANOh7gEEw+6146NN3JV8EYxQarj0KkyA7r3RZ6v-DxeqQZLrCA@mail.gmail.com>
On Wed, Apr 29, 2026 at 7:27 AM Owen Stephens <owen@owenstephens.co.uk> wrote:
Show 13 quoted lines
>
> > What did you do before the bug happened? (Steps to reproduce your issue)
>
> Repeatedy called `git fetch --deepen 2` inside a shallow repo that was a
> file:// clone of another repo. Once all commits had been fetched, a subsequent
> `fetch --deepen` appears to "reset" the repo back to being shallow with a depth
> of 2. A reproduction script is included below. This issue appears to have been
> introduced in v2.54.0.
>
> > What did you expect to happen? (Expected behavior)
>
> I expected `git fetch --deepen` in a non-shallow repo with no upstream commits
> to be a no-op.
Here's the relevant part of git-fetch(1):
       --depth=<depth>
           Limit fetching to the specified number of commits from the tip of
           each remote branch history. If fetching to a shallow repository
           created by git clone with --depth=<depth> option (see git-clone(1)),
           deepen or shorten the history to the specified number of commits.
           Tags for the deepened commits are not fetched.
       --deepen=<depth>
           Similar to --depth, except it specifies the number of commits from
           the current shallow boundary instead of from the tip of each remote
           branch history.

I can see how one might read this as implying that when fetching in a non-shallow repository, there's no effect, but I don't think the text explicitly says that. In fact, the first sentence under "--depth" (which is of course relevant for "--deepen") is unconditional.

So I'm not sure it should be a no-op.

That said, it is possible the behavior changed between 2.53 and 2.54? I haven't tried to reproduce or bisect yet.

Best, D. Ben Knoble

Previous: Owen StephensNext: Mikael Magnusson
Message 3 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.