Subject: Bug or just a mistake : --shallow-exclude parameter behavior anomalies in Git 2.45.2: "no commits selected" and "ambiguous deepen-not" errors

From: "[email-masked]" <[email-masked]>
Date: Thu, 20 Feb 2025 16:26:34 +0800

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

Git Version: 2.45.2 (Confirmed on Centos 7)

[email-masked]