{"thread":{"id":"2485","subject":"[PATCH] Bugfix: stop if directory already exists","startedAt":"2005-11-13T14:03:31Z","lastAt":"2005-11-14T21:30:19Z","messageCount":8,"participants":["Josef Weidendorfer","Junio C Hamano","Andreas Ericsson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"11731","messageId":"200511131503.32078.Josef.Weidendorfer@gmx.de","threadId":"2485","inReplyTo":null,"subject":"[PATCH] Bugfix: stop if directory already exists","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2005-11-13T14:03:31Z","receivedAt":"2005-11-13T14:03:31Z","isPatch":true,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"Fix a typo: We do not want to run the directory as command,\nand want to terminate if the directory exists\nAdditionally, update the usage message\n\nSigned-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de>\n\n---\n\nRegarding the usage: I do not think that on an error condition\nthe usage string should be outputted. This helps nothing:\neither the user knows the usage, and can see what is wrong by\nthe error message, or he should look up the man page.\nShould we use \"git clone\" or \"git-clone\" in the usage message?\nOr perhaps\n usage: git clone ...\n For more details, see 'man git-clone'\n?\n\n git-clone.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\napplies-to: 62fad3f1275b9bbf07fba50c328a3bd730c3454c\n3de065bff303bd4caa433dfa685fdc1164be2b81\ndiff --git a/git-clone.sh b/git-clone.sh\nindex f99e0ad..c09979a 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -9,7 +9,7 @@\n unset CDPATH\n \n usage() {\n-\techo >&2 \"* git clone [-l [-s]] [-q] [-u <upload-pack>] [-n] <repo> <dir>\"\n+\techo >&2 \"* git clone [-l [-s]] [-q] [-u <upload-pack>] [-n] <repo> [<dir>]\"\n \texit 1\n }\n \n@@ -98,7 +98,7 @@ fi\n dir=\"$2\"\n # Try using \"humanish\" part of source repo if user didn't specify one\n [ -z \"$dir\" ] && dir=$(echo \"$repo\" | sed -e 's|/$||' -e 's|:*/*\\.git$||' -e 's|.*/||g')\n-[ -e \"$dir\" ] && $(echo \"$dir already exists.\"; usage)\n+[ -e \"$dir\" ] && echo \"$dir already exists.\" && usage\n mkdir -p \"$dir\" &&\n D=$(\n \t(cd \"$dir\" && git-init-db && pwd)\n---\n0.99.9.GIT\n"},{"id":"11766","messageId":"7vpsp3zjwm.fsf@assigned-by-dhcp.cox.net","threadId":"2485","inReplyTo":"200511131503.32078.Josef.Weidendorfer@gmx.de","subject":"Re: [PATCH] Bugfix: stop if directory already exists","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-14T08:57:29Z","receivedAt":"2005-11-14T08:57:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:\n\n> Fix a typo: We do not want to run the directory as command,\n> and want to terminate if the directory exists\n> Additionally, update the usage message\n\nThanks.\n\n> Should we use \"git clone\" or \"git-clone\" in the usage message?\n\nI think \"git clone\" is probably preferred, given that we would\neventually want to be able to install them outside /usr/bin/,\nleaving \"git\" wrapper (and very small number of other programs)\nin /usr/bin/.\n\n>  usage: git clone ...\n>  For more details, see 'man git-clone'\n\nMy understanding of UNIX tradition of \"usage:\" is to be short\nand sweet, to primarily help people who already know the command\nbut sometimes cannot remember how exactly the options are\nspelled (e.g. \"was that -F to specify the inter-field separator\nto \"sort\" command?  Ah, no, it wants -t -- silly me must be\ndoing too much awk these days\").  And \"for more details see man\"\ngoes without saying.\n"},{"id":"11770","messageId":"437858A1.9010007@op5.se","threadId":"2485","inReplyTo":"7vpsp3zjwm.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Bugfix: stop if directory already exists","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2005-11-14T09:28:01Z","receivedAt":"2005-11-14T09:28:01Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> \n>> usage: git clone ...\n>> For more details, see 'man git-clone'\n> \n> \n> And \"for more details see man\" goes without saying.\n> \n\nBut we name them differently, as hpa pointed out some week ago.\n\nWhen I see \"usage: <prog> <command>\" I expect to find the info in \"man \n<prog>\". Soon, this will work to get the right page\n\n\tgit --help <command>\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"11771","messageId":"200511141029.18256.Josef.Weidendorfer@gmx.de","threadId":"2485","inReplyTo":"7vpsp3zjwm.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Bugfix: stop if directory already exists","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2005-11-14T09:29:18Z","receivedAt":"2005-11-14T09:29:18Z","isPatch":true,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Monday 14 November 2005 09:57, Junio C Hamano wrote:\n> Josef Weidendorfer <Josef.Weidendorfer@gmx.de> writes:\n> >  usage: git clone ...\n> >  For more details, see 'man git-clone'\n> \n> doing too much awk these days\").  And \"for more details see man\"\n> goes without saying.\n\nOf course; it was more about the current inconsistency: usage\nsays \"git clone\", but for the man page, you have to know that\nthere is an additional command \"git-clone\" with extra man page.\nUsually, if I see e.g. \"usage: cvs diff\", I look up the man\npage of \"cvs\" searching for \"diff\" on it, not \"cvs-diff\".\n\nSo just another suggestion: Why not put most of the\ndocumentation in a huge \"git\" man page? cvs does this (3601 lines\nhere), all the shells have huge man pages (bash: 4794).\nWe would be in a good tradition ;-)\n\nJosef\n"},{"id":"11773","messageId":"43785AD4.7020201@op5.se","threadId":"2485","inReplyTo":"200511141029.18256.Josef.Weidendorfer@gmx.de","subject":"Re: [PATCH] Bugfix: stop if directory already exists","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2005-11-14T09:37:24Z","receivedAt":"2005-11-14T09:37:24Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Josef Weidendorfer wrote:\n> So just another suggestion: Why not put most of the\n> documentation in a huge \"git\" man page?\n\nBecuase it's horrible. I like the fact that they are split up.\n\n> cvs does this (3601 lines\n> here), all the shells have huge man pages (bash: 4794).\n> We would be in a good tradition ;-)\n> \n\nWe would be in tradition, but not necessarily a good one. Just because \nsome stupid swede let some herrings ferment in a tin can some 800 years \nago there's really no need to say \"surströmming! What a clever idea!!\" \nand actually eat the horrible things.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"11776","messageId":"200511141136.19192.Josef.Weidendorfer@gmx.de","threadId":"2485","inReplyTo":"437858A1.9010007@op5.se","subject":"Re: [PATCH] Bugfix: stop if directory already exists","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2005-11-14T10:36:18Z","receivedAt":"2005-11-14T10:36:18Z","isPatch":true,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Monday 14 November 2005 10:28, Andreas Ericsson wrote:\n> But we name them differently, as hpa pointed out some week ago.\n> \n> When I see \"usage: <prog> <command>\" I expect to find the info in \"man \n> <prog>\". Soon, this will work to get the right page\n> \n> \tgit --help <command>\n\nThis is a nice feature, but still needs educating the user.\nI think that the idea of a huge git man page is not that bad; for sure,\nit can be created automatically.\n\nA huge man page helps searching a command name (Ah, what was the\ncommand to see commit logs per file? What is the counterpart of\n\"cvs update\" called?).\n\nJosef\n"},{"id":"11777","messageId":"43786B26.703@op5.se","threadId":"2485","inReplyTo":"200511141136.19192.Josef.Weidendorfer@gmx.de","subject":"Re: [PATCH] Bugfix: stop if directory already exists","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2005-11-14T10:47:02Z","receivedAt":"2005-11-14T10:47:02Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Josef Weidendorfer wrote:\n> On Monday 14 November 2005 10:28, Andreas Ericsson wrote:\n> \n>>But we name them differently, as hpa pointed out some week ago.\n>>\n>>When I see \"usage: <prog> <command>\" I expect to find the info in \"man \n>><prog>\". Soon, this will work to get the right page\n>>\n>>\tgit --help <command>\n> \n> \n> This is a nice feature, but still needs educating the user.\n\nThis feature goes away with the huge man-page.\n\n> I think that the idea of a huge git man page is not that bad; for sure,\n> it can be created automatically.\n> \n> A huge man page helps searching a command name (Ah, what was the\n> command to see commit logs per file?  What is the counterpart of\n> \"cvs update\" called?).\n> \n\nThis is already implemented (sort of), but perhaps have both? Or \npointers to the other man-pages from the \"git\" one (as is already sort \nof done).\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"11843","messageId":"7vlkzqx6hg.fsf@assigned-by-dhcp.cox.net","threadId":"2485","inReplyTo":"437858A1.9010007@op5.se","subject":"Re: [PATCH] Bugfix: stop if directory already exists","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-14T21:30:19Z","receivedAt":"2005-11-14T21:30:19Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Ericsson <ae@op5.se> writes:\n\n> Junio C Hamano wrote:\n>>\n>>> usage: git clone ...\n>>> For more details, see 'man git-clone'\n>> And \"for more details see man\" goes without saying.\n>\n> But we name them differently, as hpa pointed out some week ago.\n>\n> When I see \"usage: <prog> <command>\" I expect to find the info in \"man \n> <prog>\".\n\n... meaning, \"man git\", which would list the subcommands.\n\nAnd a user who got \"usage: git clone blah\" and did \"man git\"\nonce is intelligent enough to know and remember \"man git\" lists\nthe subcommands, what she wanted to know about was listed as\n\"git-clone(1)\", and she had to do \"man git-clone\", so next time\naround we should be able to expect her to do \"man git-commit\".\nAm I overestimating the users or overtaxing them?\n"}]}