From: brian m. carlson Date: Wed, 17 Sep 2025 21:21:49 GMT Subject: Re: [Bug] git fetch --dry-run --filter makes changes to .git/config Message-ID: In-Reply-To: On 2025-09-17 at 14:44:00, Kevin Puetz wrote: > What did you do before the bug happened? (Steps to reproduce your issue) > > `git fetch origin --refetch --dry-run {commit} --depth=1 --filter=tree:0 --no-auto-gc` > > What did you expect to happen? (Expected behavior) > > I expected it to fetch just the one commit object (no blobs, no trees, no history), > as a means of checking whether that commit is actually known to the remote. > > What happened instead? (Actual behavior) > > the .git/config file was modified, adding > > [remote "origin"] > promisor = true > partialclonefilter = tree:0 I will note that if this command actually downloads any data, this is required. That's because your repository is incomplete: you want to download exactly one commit and without marking the promisor remote, you will lack the ability to acquire trees or blobs and your repository will then be corrupt. > What's different between what you expected and what actually happened? > > I did not expect any changes to the local clone (due to the use of --dry-run) I agree --dry-run should not change your repository. However, I would also say that it should not contact the server, either, so it may not do what you want. If that's not what it was intended to do, perhaps someone can clarify the documentation as to its functionality. > Anything else you want to add: > > Context is https://github.com/conan-io/conan/issues/18949 > > > trying to avoid a full-re-download in the process of checking > whether the HEAD commit hash exists in a remote. > The command was expected to either be a no-op success, or fail I don't think that the command you've provided is a good or efficient way of doing what you want, but I'm also not sure that there's a good or efficient way to do what you want using command line Git (you might need to write a small portion of the protocol, for instance). -- brian m. carlson (they/them) Toronto, Ontario, CA