From: William Ruppel <wcruppel@gmail.com>
To: "brian m. carlson" <sandals@crustytoothpaste.net>, git@vger.kernel.org
Subject: Re: Git "safe directory" not working correctly
Date: Sat, 25 May 2024 18:11:12 -0400 [thread overview]
Message-ID: <eecf9177-2557-4af3-a660-6eec63ca854b@gmail.com> (raw)
In-Reply-To: <ZlJaXfLc5fvBl4UK@tapette.crustytoothpaste.net>
Thanks Brian, makes perfect sense. Yes, I was using good ol' Windows
cmd.exe. So, there is no bug here.
On 05/25/2024 5:38 PM, brian m. carlson wrote:
> On 2024-05-25 at 20:22:38, William Ruppel wrote:
>> FYI, I discovered that the issue appears to be related to the single
>> quotes. If I do this instead, then all repos are considered safe:
>>
>> git config --global --add safe.directory *
>>
>> And in a similar vein, to whitelist just the single repo I was having
>> an issue with, git itself says the command should be:
>>
>> "
>> To add an exception for this directory, call:
>> git config --global --add safe.directory '\\bill\gitmaster\Src'
>> "
>>
>> But, again, the single quotes don't allow this to work.
>>
>> All the examples I've seen use single quotes. Has something regressed
>> w.r.t. to how single quotes are handled?
> The examples are given for a POSIX shell, where single quotes prevent
> any interpolation or escaping, and double quotes permit interpolation.
> You're running on Windows, probably with CMD or PowerShell, where single
> quotes don't work and would probably be interpreted as part of the
> argument, leading to the `safe.directory` value being `'*'`, not `*`.
>
> Note that at a POSIX shell, not quoting the asterisk will result in it
> being expanded to all files in the current directory, which is why
> quoting is necessary.
>
> If you use Git Bash, then using single quotes is correct. Otherwise,
> you may need to use double quotes or read the documentation for your
> shell to determine how to properly quote things. (I don't use Windows,
> so I can't say what the proper syntax is.) Git itself doesn't
> necessarily know what the shell used to invoke it is (very especially on
> Windows, where SHELL will not be set), so it provides the default POSIX
> command.
prev parent reply other threads:[~2024-05-25 22:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-25 18:49 Git "safe directory" not working correctly William Ruppel
2024-05-25 20:22 ` William Ruppel
2024-05-25 21:38 ` brian m. carlson
2024-05-25 22:11 ` William Ruppel [this message]
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=eecf9177-2557-4af3-a660-6eec63ca854b@gmail.com \
--to=wcruppel@gmail.com \
--cc=git@vger.kernel.org \
--cc=sandals@crustytoothpaste.net \
/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).