From: Junio C Hamano <gitster@pobox.com>
To: "Kristoffer Haugsbakk" <code@khaugsbakk.name>
Cc: "Moritz Widmann" <widmann@tweaklab.org>, git@vger.kernel.org
Subject: Re: Git Pathspec bug
Date: Tue, 17 Oct 2023 09:02:00 -0700 [thread overview]
Message-ID: <xmqqwmvljkzr.fsf@gitster.g> (raw)
In-Reply-To: <2c45e813-738a-480f-8c77-8c646df9c0e3@app.fastmail.com> (Kristoffer Haugsbakk's message of "Tue, 17 Oct 2023 12:51:00 +0200")
"Kristoffer Haugsbakk" <code@khaugsbakk.name> writes:
> On Tue, Oct 17, 2023, at 11:45, Moritz Widmann wrote:
>> I executed the following command in zsh (added `command` just to be sure
>> that there's no aliases or functions)
>>
>> command git submodule add
>> 'git@github.com:moritz-t-w/Godot-Onscreen-Keyboard.git' '.'
>> fatal: empty string is not a valid pathspec. please use . instead if you
>> meant to match all paths
>>
>> Git Version: 2.42.0
>>
>> OS: Arch Linux
>
> Is this the same issue?: https://stackoverflow.com/a/53441183/1725151
It does look so.
It is correct to reject such a request to attempt to add a submodule
as if it is overlayed at the same level as its superproject [*].
But the error message is totally bogus, I think. It is not that the
pathspec the end-user gave us is wrong (the user does not even give
a pathspec in this case---the last one must be a concrete path in
the superproject where the newly added submodule is), and the user
should not be told anything about "valid" pathspec.
Patches welcome ;-)
Thanks.
[Footnote]
* Our submodules do not allow such a layout (and "git add foo" in
such an environment would not know to which repository between the
submodule or the superproject that new file "foo" should be added,
which is just one example why such a layout is not usable).
prev parent reply other threads:[~2023-10-17 16:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-17 9:45 Git Pathspec bug Moritz Widmann
2023-10-17 10:51 ` Kristoffer Haugsbakk
2023-10-17 16:02 ` Junio C Hamano [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=xmqqwmvljkzr.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=code@khaugsbakk.name \
--cc=git@vger.kernel.org \
--cc=widmann@tweaklab.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).