git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: "bolide2005@163.com" <bolide2005@163.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Bug or just a mistake : --shallow-exclude parameter behavior anomalies in Git 2.45.2: "no commits selected" and "ambiguous deepen-not" errors
Date: Mon, 24 Feb 2025 07:27:55 -0800	[thread overview]
Message-ID: <CABPp-BEzjk0PLEMjtk-0jQOAag-s_iJkKMbcU+o5vv8BzRVV2A@mail.gmail.com> (raw)
In-Reply-To: <2025022016263355354612@163.com>

On Thu, Feb 20, 2025 at 12:27 AM bolide2005@163.com <bolide2005@163.com> wrote:
>
> When using git clone with --shallow-exclude parameter (specifying branch name or existing commit SHA-1), two different errors occur:
>
>
>
>
> Case 1: git clone --shallow-exclude=master <repo-url>
>
>
>
> Error: fatal: no commits selected for shallow requests
>
>
>
> Case 2: git clone --shallow-exclude=ef5974fc470ad7a08f9b58dcd78724e9329910db <repo-url>
>
>
>
> Error: git upload-pack: ambiguous deepen-not: deepen-not ef5974fc470ad7a08f9b58dcd78724e9329910db

They actually should give different error messages, but the one given
by the second case, in the version of Git you are using, is broken.

The error message for case 2 was fixed in 5a875ff7fbd ("upload-pack:
fix ambiguous error message", 2024-11-04).

The documentation was fixed for case 2 in 00e10e07510 ("doc: correct
misleading descriptions for --shallow-exclude", 2024-11-04) to point
out that this usage is flawed.

Both are part of Git 2.48 and newer.

  reply	other threads:[~2025-02-24 15:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-20  8:26 Bug or just a mistake : --shallow-exclude parameter behavior anomalies in Git 2.45.2: "no commits selected" and "ambiguous deepen-not" errors bolide2005
2025-02-24 15:27 ` Elijah Newren [this message]
2025-09-16 14:50   ` --shallow-exclude=ref -> "ambiguous deepen-not" error Philipp Hahn
2025-09-16 17:03     ` D. Ben Knoble
2025-09-16 17:57       ` Philipp Hahn
2025-09-16 20:34         ` Ben Knoble
2025-09-17  2:54     ` Elijah Newren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABPp-BEzjk0PLEMjtk-0jQOAag-s_iJkKMbcU+o5vv8BzRVV2A@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=bolide2005@163.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).