From: Phillip Wood Date: Tue, 17 Nov 2026 16:28:42 GMT Subject: Re: [PATCH v14 1/5] fetch: add remote..fetchRefmap Message-ID: In-Reply-To: On 17/11/2026 15:40, Junio C Hamano wrote: > Phillip Wood writes: > >> However, I think it becomes confusing if we store the ref in two >> places when the user configures ".fetchRefmap" and then passes "src:dst" >> on the commandline because users are used to a commandline "src:dst" >> overriding the ".fetch" config, not adding to it. > > True, but the src:dst on the command line in your example is still > overriding the .fetch configuration. Wouldn't it make it confusing > if it overrode .fetchRefmap configuration, since src:dst on the > command line is what .fetch configuration gives the defaults for > (and .fetchRefmap configuration gives the defaults for --refmap, not > the refspec like src:dst). It may be just as confusing as if, say, a > command line --refmap suddenly started overriding .fetch > configuration, I am afraid. I think it depends on whether users already know how --refmap works. My contention is that they don't and are used to src:dst on the commandline overriding their config and will therefore be confused when it does not override .fetchRefmap. If one took the view that users are already familiar with what happens when they pass --refmap and src:dst then I agree changing the behavior would be confusing, but I don't think most users even know --refmap exists let alone what it does in this particular corner case. I had a look to see if the current behavior of --refmap combined with src:dst is documented, all I could see was When git fetch is run with explicit branches and/or tags to fetch on the command line, e.g. git fetch origin master, the s given on the command line determine what are to be fetched (e.g. master in the example, which is a short-hand for master:, which in turn means "fetch the master branch but I do not explicitly say what remote-tracking branch to update with it from the command line"), and the example command will fetch only the master branch. The remote..fetch values determine which remote-tracking branch, if any, is updated. When used in this way, the remote..fetch values do not have any effect in deciding what gets fetched (i.e. the values are not used as refspecs when the command-line lists refspecs); they are only used to decide where the refs that are fetched are stored by acting as a mapping. The latter use of the remote..fetch values can be overridden by giving the --refmap= parameter(s) on the command line. Which reads to me that --refmap overrides remote..fetch when remote..fetch is used as a mapping. As remote..fetch is not used as a mapping when there is a explicit destination on the commandline, it is not clear to me that the current behavior of --refmap combined with src:dst on the commandline matches the documentation. > I can buy it if the suggestion was to allow passing --no-refmap from > the command line (or would --refmap="" work?) to ignore .fetchRefmap > configuration, though. I think --refmap="" might work as --refmap overrides the config and --refmap="" is the documented way to ignore the ".fetch" config. Thanks Phillip