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

Re: [PATCH 2/3] ls-files --others --directory: give trailing slash

From
Linus Torvalds <torvalds@osdl.org>
Date
Jan 7, 2006, 23:35 UTC
Message-ID
<Pine.LNX.4.64.0601071533060.3169@g5.osdl.org>
In-Reply-To
<7vy81racv7.fsf@assigned-by-dhcp.cox.net>
On Sat, 7 Jan 2006, Junio C Hamano wrote:
> 
>  * Likes, dislikes?  This suits better for *my* purpose of
>    calling this from git-status, but it might be undesirable for
>    your Porcelain.
Likes.
However, I'd re-write it as just
	memcpy(fullname + baselen + len, "/", 2);
	len++;
	if (show_other_directories &&
	    !dir_exists(fullname, baselen + len))
		break;
	read_directory(fullname, fullname, baselen + len);

because let's face it, every user wants the "+1", so just do it once up-front instead of adding one in three different places.

		Linus
Previous: Junio C HamanoNext: Darrin Thompson
Message 2 of 3 in “ls-files --others --directory: give trailing slash”
  1. 2/3 ls-files --others --directory: give trailing slashJunio C Hamano, Jan 7, 2006
  2. Linus TorvaldsJan 7, 2006
  3. Darrin ThompsonJan 9, 2006

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.