git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] submodule: handle trailing slash, warn about non-submodules

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 6, 2009, 11:41 UTC
Message-ID
<alpine.DEB.1.00.0902061238060.7377@intel-tinevez-2-302>
In-Reply-To
<7vzlh0875l.fsf@gitster.siamese.dyndns.org>
Hi,
On Thu, 5 Feb 2009, Junio C Hamano wrote:
Show 11 quoted lines
> Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> 
> > Earlier, when you called
> >
> > 	git submodule path/to/submodule/
> >
> > (which happens easily if you are a heavy user of tab-completion), Git
> > would silently ignore the given path, as "git ls-files path/to/submodule/"
> > does not return anything due to the trailing slash.
> 
> Does --error-unmatch help in such a case to avoid shell loops?
No, as the second issue solved by the shell loop still holds true:
	$ git ls-files --error-unmatch submodule/
	error: pathspec 'submodule/' did not match any file(s) known to git.
	Did you forget to 'git add'?
That would be really awkward, don't you think?

BTW I have been asked about this behavior _easily_ a 50 times. I just finally broke down and went for the easiest solution.

A proper solution would most probably involve a rewrite as a builtin.

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 8 in “submodule: handle trailing slash, warn about non-submodules”
  1. submodule: handle trailing slash, warn about non-submodulesJohannes Schindelin, Feb 6, 2009
  2. Junio C HamanoFeb 6, 2009
  3. Johannes SchindelinFeb 6, 2009
  4. Junio C HamanoFeb 7, 2009
  5. 0/2 submodule path handling fixesJohannes Schindelin, Feb 7, 2009
  6. Junio C HamanoFeb 7, 2009
  7. 1/2 Let ls-files strip trailing slashes in submodules' pathsJohannes Schindelin, Feb 7, 2009
  8. 2/2 submodule: warn about non-submodulesJohannes Schindelin, Feb 7, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.