Re: Bug using `fetch` with blank `-c` arguments to git
- From
Bryan Turner <bturner@atlassian.com>
- Date
- Jan 4, 2022, 20:04 UTC
- Message-ID
- <CAGyf7-HSia4pRs4FZ107v0jmP4k4Zfw5zJ-3Oz8UvF9oobczEw@mail.gmail.com>
- In-Reply-To
- <CA+kUOak9_RLpdr9d4pQiwU=K42taCwhMdg5WkLP4GreQd4yWig@mail.gmail.com>
On Tue, Jan 4, 2022 at 4:37 AM Adam Dinwoodie <adam@dinwoodie.org> wrote:
Show 5 quoted lines
> > While investigating some issues with a different project, I discovered > the command `git -c config.helper= fetch` was working with the Debian > stable version of Git (v2.30.2) but not with my local build > (v2.34.1.428.gdcc0cd074f).
Since you're working with a locally-built Git, have you, by chance, actually _installed_ that build, or is it simply in the Git repository itself after running make?
If you haven't _installed_ your build, my guess is you might be getting a mismatch wherein your _built_ Git, when it forks out subprocesses, is triggering your _installed_ Git (which I assume you have, and which I assume is not 2.34.1). Git compiles paths into itself to know where to find certain binaries, and if you run a compiled-but-not-installed Git then those paths are "wrong". (I see administrators do this fairly often when building Git from source to set up Bitbucket Server.)
What does `./git --exec-path` print, when you run your 2.34.1 binary? And is that where, for example, the compiled 2.34.1 versions of things like `git-remote-https` are?
Hope this helps, Bryan
Show 24 quoted lines
>
> Specifically, I see the following output:
>
> $ ./git -c credential.helper= fetch
> error: bogus format in GIT_CONFIG_PARAMETERS
> fatal: unable to parse command-line config
>
> Investigating with `git bisect`, the change in behaviour seems to have
> been introduced in 1ff21c05ba ("config: store "git -c" variables using
> more robust format", 2021-01-12).
>
> I see the same behaviour with `-c config.helper=`, `-c
> core.autocrlf=`, `-c core.autocrlf` and `-c core.autocrlf=true`..
> Notably the behaviour does not affect all other git commands; `git -c
> core.autocrlf= log -1` works as expected.
>
> I think this is a regression; I can't see any reason why these
> commands shouldn't work.
>
> Curiously, I'm seeing this behaviour on both my Raspberry Pi OS and
> Debian Bullseye systems, but not my Cygwin systems. I've not yet tried
> to work out what the difference is there. In all cases, I was testing
> with my own build, built with `make -j<num> configure && ./configure
> --prefix=$HOME/.local && make -j<num>`.