{"thread":{"id":"2992","subject":"[PATCH 2/3] ls-files --others --directory: give trailing slash","startedAt":"2006-01-07T22:31:56Z","lastAt":"2006-01-09T15:17:53Z","messageCount":3,"participants":["Junio C Hamano","Linus Torvalds","Darrin Thompson"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"14268","messageId":"7vy81racv7.fsf@assigned-by-dhcp.cox.net","threadId":"2992","inReplyTo":null,"subject":"[PATCH 2/3] ls-files --others --directory: give trailing slash","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-01-07T22:31:56Z","receivedAt":"2006-01-07T22:31:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This adds a trailing slash to directory names in the output\nwhen \"--others --directory\" option shows only untracked\ndirectories and not their contents, to make them stand out.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n\n---\n\n * Likes, dislikes?  This suits better for *my* purpose of\n   calling this from git-status, but it might be undesirable for\n   your Porcelain.\n\n ls-files.c |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\n02e90a13cce6041263ec90da77f2ba929055b448\ndiff --git a/ls-files.c b/ls-files.c\nindex cc5b32e..7e2fdea 100644\n--- a/ls-files.c\n+++ b/ls-files.c\n@@ -294,8 +294,10 @@ static void read_directory(const char *p\n \t\t\tcase DT_DIR:\n \t\t\t\tmemcpy(fullname + baselen + len, \"/\", 2);\n \t\t\t\tif (show_other_directories &&\n-\t\t\t\t    !dir_exists(fullname, baselen + len + 1))\n+\t\t\t\t    !dir_exists(fullname, baselen + len + 1)) {\n+\t\t\t\t\tlen++;\n \t\t\t\t\tbreak;\n+\t\t\t\t}\n \t\t\t\tread_directory(fullname, fullname,\n \t\t\t\t\t       baselen + len + 1);\n \t\t\t\tcontinue;\n-- \n1.0.7-g0263\n"},{"id":"14273","messageId":"Pine.LNX.4.64.0601071533060.3169@g5.osdl.org","threadId":"2992","inReplyTo":"7vy81racv7.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 2/3] ls-files --others --directory: give trailing slash","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2006-01-07T23:35:08Z","receivedAt":"2006-01-07T23:35:08Z","isPatch":true,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sat, 7 Jan 2006, Junio C Hamano wrote:\n> \n>  * Likes, dislikes?  This suits better for *my* purpose of\n>    calling this from git-status, but it might be undesirable for\n>    your Porcelain.\n\nLikes.\n\nHowever, I'd re-write it as just\n\n\tmemcpy(fullname + baselen + len, \"/\", 2);\n\tlen++;\n\tif (show_other_directories &&\n\t    !dir_exists(fullname, baselen + len))\n\t\tbreak;\n\tread_directory(fullname, fullname, baselen + len);\n\nbecause let's face it, every user wants the \"+1\", so just do it once \nup-front instead of adding one in three different places.\n\n\t\tLinus\n"},{"id":"14361","messageId":"1136819873.5991.0.camel@localhost.localdomain","threadId":"2992","inReplyTo":"7vy81racv7.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 2/3] ls-files --others --directory: give trailing slash","fromName":"Darrin Thompson","fromEmail":"darrint@progeny.com","sentAt":"2006-01-09T15:17:53Z","receivedAt":"2006-01-09T15:17:53Z","isPatch":true,"sender":{"key":"darrint@progeny.com","avatar":null},"body":"On Sat, 2006-01-07 at 14:31 -0800, Junio C Hamano wrote:\n>  * Likes, dislikes?  This suits better for *my* purpose of\n>    calling this from git-status, but it might be undesirable for\n>    your Porcelain.\n> \n\n+1 likes.\n\n--\nDarrin\n"}]}