That's surprising, I'd naively assumed a refspec on the command line would override the refmap. It feels problematic if we cannot override the fetchRefmap config with a refspec on the command line, but need to use "--refmap" instead.
I think there are at least a couple of ways of thinking about the interaction of "remote.<name>.fetchRefmap" and "remote.<name>.fetch". The first is to consider that the "fetchRefmap" config is for "where to store the fetched refs" and the "fetch" config is for "what to fetch". In that case we'd reject values containing colons in the "fetch" config as any mapping should be done by the "fetchRefmap" config. The other way is to consider that the "fetchRefmap" config holds the default argument for "--refmap" and "fetch" holds the default command line refspecs to use when the user doesn't specify any. In that case we should accept "fetch" values containing colons and behave as if those values had been given as command line arguments. I'm leaning towards the latter, but if we do decide to do that, I think we should make sure
git -c remote.cabal.fetchRefmap='refs/heads/*:refs/remotes/cabal/*' \
fetch cabal refs/heads/master:refs/remotes/origin/masteronly updates origin/master and not cabal/master.
Thanks
Phillip