git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Kevin Puetz <PuetzKevinA@johndeere.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [Bug] git fetch --dry-run --filter makes changes to .git/config
Date: Wed, 17 Sep 2025 21:21:49 +0000	[thread overview]
Message-ID: <aMsmbU_Cg0L6kOlm@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <CY8PR05MB100119985C7C25A72E530556DB517A@CY8PR05MB10011.namprd05.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2050 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2025-09-17 21:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17 14:44 [Bug] git fetch --dry-run --filter makes changes to .git/config Kevin Puetz
2025-09-17 21:21 ` brian m. carlson [this message]
2025-09-17 23:23   ` Kevin Puetz
2025-09-18 19:20     ` Jeff King
2025-09-18 20:28       ` Junio C Hamano
2025-09-18 20:39         ` Jeff King
2025-09-18 20:46           ` Junio C Hamano
2025-09-18 21:55       ` Kevin Puetz
2025-09-18 22:21         ` rsbecker
2025-09-19 15:31           ` Kevin Puetz

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=aMsmbU_Cg0L6kOlm@fruit.crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=PuetzKevinA@johndeere.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).