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

From: Junio C Hamano <[email-masked]>
Date: Mon, 11 May 2026 09:09:53 +0900

Samo Pogačnik <[email-masked]> 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?

> 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 <[email-masked]>
> Signed-off-by: Samo Pogačnik <[email-masked]>