git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git Pathspec bug
@ 2023-10-17  9:45 Moritz Widmann
  2023-10-17 10:51 ` Kristoffer Haugsbakk
  0 siblings, 1 reply; 3+ messages in thread
From: Moritz Widmann @ 2023-10-17  9:45 UTC (permalink / raw)
  To: git

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Git Pathspec bug
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Kristoffer Haugsbakk @ 2023-10-17 10:51 UTC (permalink / raw)
  To: Moritz Widmann; +Cc: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Git Pathspec bug
  2023-10-17 10:51 ` Kristoffer Haugsbakk
@ 2023-10-17 16:02   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2023-10-17 16:02 UTC (permalink / raw)
  To: Kristoffer Haugsbakk; +Cc: Moritz Widmann, git

"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).

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-17 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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).