{"thread":{"id":"23165","subject":"color (red) for error messages on all git commands","startedAt":"2010-03-24T22:44:09Z","lastAt":"2010-04-23T12:37:22Z","messageCount":18,"participants":["Neal Kreitzinger","Sverre Rabbelier","Alex Riesen","Michael J Gruber","Tilo Schwarz","Junio C Hamano","Nicolas Pitre"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"137752","messageId":"hoe4j3$2vg$1@dough.gmane.org","threadId":"23165","inReplyTo":null,"subject":"color (red) for error messages on all git commands","fromName":"Neal Kreitzinger","fromEmail":"neal@rsss.com","sentAt":"2010-03-24T22:44:09Z","receivedAt":"2010-03-24T22:44:09Z","isPatch":false,"sender":{"key":"neal@rsss.com","avatar":null},"body":"Problem Scenario:  programmer doesn't pay attention to messages as he \nbecomes more familiar with git and as a result doesn't notice error messages \nuntil its too late.  Mistakes take longer to remediate because the original \nerror message was not resolved at the time it occurred.\n\nDesired Solution:  configure git to display all error messages in color, \ne.g. red, so that the programmer does not overlook error messages.\n\nDoes anyone know how to configure this in git?\n\n\nv/r,\nNeal \n"},{"id":"137753","messageId":"fabb9a1e1003241558t4c4c5cf8t3a7d9b9856937c4f@mail.gmail.com","threadId":"23165","inReplyTo":"hoe4j3$2vg$1@dough.gmane.org","subject":"Re: color (red) for error messages on all git commands","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-03-24T22:58:31Z","receivedAt":"2010-03-24T22:58:31Z","isPatch":false,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Wed, Mar 24, 2010 at 23:44, Neal Kreitzinger <neal@rsss.com> wrote:\n> Problem Scenario:  programmer doesn't pay attention to messages as he\n> becomes more familiar with git and as a result doesn't notice error messages\n> until its too late.  Mistakes take longer to remediate because the original\n> error message was not resolved at the time it occurred.\n>\n> Desired Solution:  configure git to display all error messages in color,\n> e.g. red, so that the programmer does not overlook error messages.\n\nThat's actually something I run into as well, I am so used to git just\ndoing what I want that I don't notice the error messages when they\noccur. If this is indeed desired (probably controlled by color.warning\nand color.error?) it should be fairly easy to implement (see usage.c).\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"137754","messageId":"81b0412b1003241612m41f6ae2ctaa5b89ed37b58da2@mail.gmail.com","threadId":"23165","inReplyTo":"fabb9a1e1003241558t4c4c5cf8t3a7d9b9856937c4f@mail.gmail.com","subject":"Re: color (red) for error messages on all git commands","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2010-03-24T23:12:28Z","receivedAt":"2010-03-24T23:12:28Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On Wed, Mar 24, 2010 at 23:58, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n> On Wed, Mar 24, 2010 at 23:44, Neal Kreitzinger <neal@rsss.com> wrote:\n>> Desired Solution:  configure git to display all error messages in color,\n>> e.g. red, so that the programmer does not overlook error messages.\n\nIt is considered a good behavior for a UNIX program only to display\nsomething if there is an error. Git just tries to follow this tradition.\n\n> That's actually something I run into as well, I am so used to git just\n> doing what I want that I don't notice the error messages when they\n> occur. If this is indeed desired (probably controlled by color.warning\n> and color.error?) it should be fairly easy to implement (see usage.c).\n\nThat said, I also like the idea. Don't forget to check for tty in the patch.\n"},{"id":"137787","messageId":"4BAB2234.4070202@drmicha.warpmail.net","threadId":"23165","inReplyTo":"81b0412b1003241612m41f6ae2ctaa5b89ed37b58da2@mail.gmail.com","subject":"Re: color (red) for error messages on all git commands","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-03-25T08:43:32Z","receivedAt":"2010-03-25T08:43:32Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Alex Riesen venit, vidit, dixit 25.03.2010 00:12:\n> On Wed, Mar 24, 2010 at 23:58, Sverre Rabbelier <srabbelier@gmail.com> wrote:\n>> On Wed, Mar 24, 2010 at 23:44, Neal Kreitzinger <neal@rsss.com> wrote:\n>>> Desired Solution:  configure git to display all error messages in color,\n>>> e.g. red, so that the programmer does not overlook error messages.\n> \n> It is considered a good behavior for a UNIX program only to display\n> something if there is an error. Git just tries to follow this tradition.\n\nOh well... Then I presume I'm not the only one who is annoyed by\n\"Initialized empty Git repository in ...\", especially when you clone\nlocally and that is the only response you get! I'm embracing for the\nresponse to my upcoming RFC...\n\nNote that we also do a lot of progress messages (fetch from remotes,\ncommitting, checking out, ...), and that is why distinguishing\nwarnings/error messages makes a lot of sense.\n\n>> That's actually something I run into as well, I am so used to git just\n>> doing what I want that I don't notice the error messages when they\n>> occur. If this is indeed desired (probably controlled by color.warning\n>> and color.error?) it should be fairly easy to implement (see usage.c).\n> \n> That said, I also like the idea. Don't forget to check for tty in the patch.\n\nMe too :)\n\nMichael\n"},{"id":"137788","messageId":"7b9006620fab4214ee0db53ebc9e0caffc397959.1269506526.git.git@drmicha.warpmail.net","threadId":"23165","inReplyTo":"4BAB2234.4070202@drmicha.warpmail.net","subject":"[PATCH RFC/RFD] clone: quell the progress report from init","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-03-25T08:46:16Z","receivedAt":"2010-03-25T08:46:16Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Currently, cloning a local repository results in the progress report\n\"Initialized empty Git repository in ...\" from init but no other output,\nleaving the user to wonder what happened to the actual cloning.\n\nTherefore, quell the progress report from init (unless -v is given) to\nbe in line with the many other commands which report nothing on success.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nThis is RFC/RFD. An actual patch will also adjust several tests to\nthe new expected output. Also, one might want to change init's default\nverbosity level accordingly.\n\nThe current output is really confusing for local cloning. There are\nseveral alternative ways to resolve this:\n- Make the local cloning process report something.\n- Check whether the clone is remote or not and report init or don't.\n\nCurrently, we really have two philosophies:\n- report only on error\n- be chatty on success\n\nI don't think that's a problem, but \"simple\" commands (e.g. branch, init,\nadd) should be in the former camp.\n\n builtin/clone.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 05f8fb4..f98c5c5 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -461,7 +461,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\tdie(\"could not create leading directories of '%s'\", git_dir);\n \tset_git_dir(make_absolute_path(git_dir));\n \n-\tinit_db(option_template, (option_verbosity < 0) ? INIT_DB_QUIET : 0);\n+\tinit_db(option_template, (option_verbosity <= 0) ? INIT_DB_QUIET : 0);\n \n \t/*\n \t * At this point, the config exists, so we do not need the\n-- \n1.7.0.3.448.g82eeb\n"},{"id":"137789","messageId":"81b0412b1003250202m67dc4d2m9042d1242800cd27@mail.gmail.com","threadId":"23165","inReplyTo":"7b9006620fab4214ee0db53ebc9e0caffc397959.1269506526.git.git@drmicha.warpmail.net","subject":"Re: [PATCH RFC/RFD] clone: quell the progress report from init","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2010-03-25T09:02:49Z","receivedAt":"2010-03-25T09:02:49Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On Thu, Mar 25, 2010 at 09:46, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Currently, we really have two philosophies:\n> - report only on error\n> - be chatty on success\n>\n> I don't think that's a problem, but \"simple\" commands (e.g. branch, init,\n> add) should be in the former camp.\n\nRight. Everytime add scrolls out the current terminal buffer I wish I\nhad it sent to /dev/null.\n\n>  builtin/clone.c |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n\nSometimes I think a statistics like \"1 byte inserted\" are more appropriate :)\n\n> -       init_db(option_template, (option_verbosity < 0) ? INIT_DB_QUIET : 0);\n> +       init_db(option_template, (option_verbosity <= 0) ? INIT_DB_QUIET : 0);\n"},{"id":"137792","messageId":"4BAB2C4F.3080305@drmicha.warpmail.net","threadId":"23165","inReplyTo":"81b0412b1003250202m67dc4d2m9042d1242800cd27@mail.gmail.com","subject":"Re: [PATCH RFC/RFD] clone: quell the progress report from init","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-03-25T09:26:39Z","receivedAt":"2010-03-25T09:26:39Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Alex Riesen venit, vidit, dixit 25.03.2010 10:02:\n> On Thu, Mar 25, 2010 at 09:46, Michael J Gruber\n> <git@drmicha.warpmail.net> wrote:\n>> Currently, we really have two philosophies:\n>> - report only on error\n>> - be chatty on success\n>>\n>> I don't think that's a problem, but \"simple\" commands (e.g. branch, init,\n>> add) should be in the former camp.\n> \n> Right. Everytime add scrolls out the current terminal buffer I wish I\n> had it sent to /dev/null.\n> \n>>  builtin/clone.c |    2 +-\n>>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> Sometimes I think a statistics like \"1 byte inserted\" are more appropriate :)\n\nYeah, I was thinking this would be the/a minimal patch, but I screwed it\nwith the commit message :)\n\n> \n>> -       init_db(option_template, (option_verbosity < 0) ? INIT_DB_QUIET : 0);\n>> +       init_db(option_template, (option_verbosity <= 0) ? INIT_DB_QUIET : 0);\n\nMichael\n"},{"id":"137801","messageId":"op.u94tipqya8ed4e@dellschleppa","threadId":"23165","inReplyTo":"7b9006620fab4214ee0db53ebc9e0caffc397959.1269506526.git.git@drmicha.warpmail.net","subject":"Re: [PATCH RFC/RFD] clone: quell the progress report from init","fromName":"Tilo Schwarz","fromEmail":"tilo@tilo-schwarz.de","sentAt":"2010-03-25T16:31:27Z","receivedAt":"2010-03-25T16:31:27Z","isPatch":true,"sender":{"key":"tilo@tilo-schwarz.de","avatar":null},"body":"On Thu, 25 Mar 2010 09:46:16 +0100, Michael J Gruber  \n<git@drmicha.warpmail.net> wrote:\n\n> Currently, cloning a local repository results in the progress report\n> \"Initialized empty Git repository in ...\" from init but no other output,\n> leaving the user to wonder what happened to the actual cloning.\n\n/me, (as just being an interested git user reading this list), likes this  \npatch: As a Unix user I always wonder after a \"git clone\", why git tells  \nme something about an \"empty Git repository\" (I think I saw the same  \nmessage initializing submodules). I'd rather prefer no message, indicating  \nthe command completed with success.\n\nRegards,\n\n     Tilo\n"},{"id":"137886","messageId":"7veij6lvze.fsf@alter.siamese.dyndns.org","threadId":"23165","inReplyTo":"7b9006620fab4214ee0db53ebc9e0caffc397959.1269506526.git.git@drmicha.warpmail.net","subject":"Re: [PATCH RFC/RFD] clone: quell the progress report from init","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-26T19:32:37Z","receivedAt":"2010-03-26T19:32:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> Currently, cloning a local repository results in the progress report\n> \"Initialized empty Git repository in ...\" from init but no other output,\n> leaving the user to wonder what happened to the actual cloning.\n\nWith your patch, local variant will become totally silent, but it may want\nto give some feedback like real transports do; it is not entirely clear\nwhat it should say, though.  The progress report given by the real\ntransports are to assure the user that we are not stuck, and the local one\nis usually reasonably fast.\n\nIt's pointless to say \"initialized empty\" and then say \"I am working hard\nto clone\".  As the command always creates a new directory and clones into\nit, it makes sense to say only the latter, and your 1-byte patch may be a\ngood first step in that direction.\n\nAn alternative might be to squelch init_db() like your patch did, and then\nreplace it with a message of our own, perhaps like this:\n\n $ git clone -n /var/tmp/gomi victim-003\n Cloning into victim-003...\n done.\n $ git clone -n file:///var/tmp/gomi victim-004\n Cloning into victim-004...\n remote: Counting objects: ...\n Receiving objects: 100% (120/120), done.\n\nHere I am assuming we would add \"done.\" to the local codepath.\n\nPersonally I like the total silence your patch gives (i.e. no \"Cloning\ninto\" line in either case, and no \"done.\" in local case) slightly better;\nothers may disagree and/or have better ideas.\n\n> This is RFC/RFD. An actual patch will also adjust several tests to\n> the new expected output.\n\nAnd documentation, especially the tutorials.\n\n\"git init\" as a top-level command may want to stay as-is; it is not like\nyou run \"init\" over and over again.  But we probably should make it an\nindependent issue from the \"clone\" one.\n\nThanks.\n"},{"id":"137895","messageId":"alpine.LFD.2.00.1003261611130.694@xanadu.home","threadId":"23165","inReplyTo":"7veij6lvze.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH RFC/RFD] clone: quell the progress report from init","fromName":"Nicolas Pitre","fromEmail":"nico@fluxnic.net","sentAt":"2010-03-26T20:16:50Z","receivedAt":"2010-03-26T20:16:50Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Fri, 26 Mar 2010, Junio C Hamano wrote:\n\n> An alternative might be to squelch init_db() like your patch did, and then\n> replace it with a message of our own, perhaps like this:\n> \n>  $ git clone -n /var/tmp/gomi victim-003\n>  Cloning into victim-003...\n>  done.\n>  $ git clone -n file:///var/tmp/gomi victim-004\n>  Cloning into victim-004...\n>  remote: Counting objects: ...\n>  Receiving objects: 100% (120/120), done.\n> \n> Here I am assuming we would add \"done.\" to the local codepath.\n> \n> Personally I like the total silence your patch gives (i.e. no \"Cloning\n> into\" line in either case, and no \"done.\" in local case) slightly better;\n> others may disagree and/or have better ideas.\n\nPersonally I like your suggestion above.  A clone is not something you \nperform repeatedly, and it is the first thing that random people told to \nuse Git to grab a piece of code will do.  Better give them some comfort \nby telling them what is happening.\n\n\nNicolas\n"},{"id":"137897","messageId":"7vzl1uhlw8.fsf@alter.siamese.dyndns.org","threadId":"23165","inReplyTo":"alpine.LFD.2.00.1003261611130.694@xanadu.home","subject":"Re: [PATCH RFC/RFD] clone: quell the progress report from init","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-26T20:24:07Z","receivedAt":"2010-03-26T20:24:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nicolas Pitre <nico@fluxnic.net> writes:\n\n> On Fri, 26 Mar 2010, Junio C Hamano wrote:\n>\n>> An alternative might be to squelch init_db() like your patch did, and then\n>> replace it with a message of our own, perhaps like this:\n>> \n>>  $ git clone -n /var/tmp/gomi victim-003\n>>  Cloning into victim-003...\n>>  done.\n>>  $ git clone -n file:///var/tmp/gomi victim-004\n>>  Cloning into victim-004...\n>>  remote: Counting objects: ...\n>>  Receiving objects: 100% (120/120), done.\n>> \n>> Here I am assuming we would add \"done.\" to the local codepath.\n> ...\n> Personally I like your suggestion above.  A clone is not something you \n> perform repeatedly, and it is the first thing that random people told to \n> use Git to grab a piece of code will do.  Better give them some comfort \n> by telling them what is happening.\n\nOk, I can agree with that.  People who like silence can always say -q ;-)\n"},{"id":"138160","messageId":"7v7houxu8n.fsf@alter.siamese.dyndns.org","threadId":"23165","inReplyTo":"alpine.LFD.2.00.1003261611130.694@xanadu.home","subject":"Re: [PATCH RFC/RFD] clone: quell the progress report from init","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-30T05:18:32Z","receivedAt":"2010-03-30T05:18:32Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nicolas Pitre <nico@fluxnic.net> writes:\n\n> Personally I like your suggestion above.  A clone is not something you \n> perform repeatedly, and it is the first thing that random people told to \n> use Git to grab a piece of code will do.  Better give them some comfort \n> by telling them what is happening.\n\nHere is what such a change may look like.  I'll leave adjusting\ndocumentation (namely, tutorials) and perhaps tests as an exercise to the\nreaders ;-)\n\n\n builtin/clone.c  |    6 +++++-\n t/t5601-clone.sh |    2 +-\n 2 files changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 05f8fb4..0bedde4 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -302,6 +302,8 @@ static const struct ref *clone_local(const char *src_repo,\n \ttransport = transport_get(remote, src_repo);\n \tret = transport_get_remote_refs(transport);\n \ttransport_disconnect(transport);\n+\tif (0 <= option_verbosity)\n+\t\tprintf(\"done.\\n\");\n \treturn ret;\n }\n \n@@ -461,7 +463,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\tdie(\"could not create leading directories of '%s'\", git_dir);\n \tset_git_dir(make_absolute_path(git_dir));\n \n-\tinit_db(option_template, (option_verbosity < 0) ? INIT_DB_QUIET : 0);\n+\tif (0 <= option_verbosity)\n+\t\tprintf(\"Cloning into %s...\\n\", get_git_dir());\n+\tinit_db(option_template, INIT_DB_QUIET);\n \n \t/*\n \t * At this point, the config exists, so we do not need the\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 2147567..678cee5 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -34,7 +34,7 @@ test_expect_success 'clone with excess parameters (2)' '\n test_expect_success 'output from clone' '\n \trm -fr dst &&\n \tgit clone -n \"file://$(pwd)/src\" dst >output &&\n-\ttest $(grep Initialized output | wc -l) = 1\n+\ttest $(grep Clon output | wc -l) = 1\n '\n \n test_expect_success 'clone does not keep pack' '\n"},{"id":"138166","messageId":"4BB1B0AF.7060206@drmicha.warpmail.net","threadId":"23165","inReplyTo":"7v7houxu8n.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH RFC/RFD] clone: quell the progress report from init","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-03-30T08:05:03Z","receivedAt":"2010-03-30T08:05:03Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Junio C Hamano venit, vidit, dixit 30.03.2010 07:18:\n> Nicolas Pitre <nico@fluxnic.net> writes:\n> \n>> Personally I like your suggestion above.  A clone is not something you \n>> perform repeatedly, and it is the first thing that random people told to \n>> use Git to grab a piece of code will do.  Better give them some comfort \n>> by telling them what is happening.\n> \n> Here is what such a change may look like.  I'll leave adjusting\n> documentation (namely, tutorials) and perhaps tests as an exercise to the\n> readers ;-)\n\nOK, I'll take it since I kicked this off.\n\n>  builtin/clone.c  |    6 +++++-\n>  t/t5601-clone.sh |    2 +-\n>  2 files changed, 6 insertions(+), 2 deletions(-)\n> \n> diff --git a/builtin/clone.c b/builtin/clone.c\n> index 05f8fb4..0bedde4 100644\n> --- a/builtin/clone.c\n> +++ b/builtin/clone.c\n> @@ -302,6 +302,8 @@ static const struct ref *clone_local(const char *src_repo,\n>  \ttransport = transport_get(remote, src_repo);\n>  \tret = transport_get_remote_refs(transport);\n>  \ttransport_disconnect(transport);\n> +\tif (0 <= option_verbosity)\n> +\t\tprintf(\"done.\\n\");\n>  \treturn ret;\n>  }\n>  \n> @@ -461,7 +463,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n>  \t\tdie(\"could not create leading directories of '%s'\", git_dir);\n>  \tset_git_dir(make_absolute_path(git_dir));\n>  \n> -\tinit_db(option_template, (option_verbosity < 0) ? INIT_DB_QUIET : 0);\n> +\tif (0 <= option_verbosity)\n> +\t\tprintf(\"Cloning into %s...\\n\", get_git_dir());\n> +\tinit_db(option_template, INIT_DB_QUIET);\n\nDon't we want init to report at least with -v?\n\n>  \n>  \t/*\n>  \t * At this point, the config exists, so we do not need the\n> diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\n> index 2147567..678cee5 100755\n> --- a/t/t5601-clone.sh\n> +++ b/t/t5601-clone.sh\n> @@ -34,7 +34,7 @@ test_expect_success 'clone with excess parameters (2)' '\n>  test_expect_success 'output from clone' '\n>  \trm -fr dst &&\n>  \tgit clone -n \"file://$(pwd)/src\" dst >output &&\n> -\ttest $(grep Initialized output | wc -l) = 1\n> +\ttest $(grep Clon output | wc -l) = 1\n>  '\n>  \n>  test_expect_success 'clone does not keep pack' '\n\nMichael\n"},{"id":"138169","messageId":"81b0412b1003300143s55a93fcqf9a6d5d727a4e786@mail.gmail.com","threadId":"23165","inReplyTo":"7v7houxu8n.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH RFC/RFD] clone: quell the progress report from init","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2010-03-30T08:43:03Z","receivedAt":"2010-03-30T08:43:03Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On Tue, Mar 30, 2010 at 07:18, Junio C Hamano <gitster@pobox.com> wrote:\n> Nicolas Pitre <nico@fluxnic.net> writes:\n>\n>> Personally I like your suggestion above.  A clone is not something you\n>> perform repeatedly, and it is the first thing that random people told to\n\nWell, I have git clone in my top-20 used commands. I'm reasonably sure\nit is used many times in a row too.\n\n>> use Git to grab a piece of code will do.  Better give them some comfort\n>> by telling them what is happening.\n>\n> Here is what such a change may look like.  I'll leave adjusting\n> documentation (namely, tutorials) and perhaps tests as an exercise to the\n> readers ;-)\n\nThere still is no way to make things quiet by default.\n\nAnd at least for me the annoyance was when using it in command line,\ninteractively. So yes, it makes it possible to make clone quieter, but I\nwont use it, because I have to either make an alias for git (and that\non every system I might come upon), or type in \"-q\" every time, at which\ncase I can also live with a little more output.\n\nBut even if it is of no immediate use to me personall, I still like the patch:\nnow I can make some scripts quieter (with less risk of removing something\ninteresting by piping everything to /dev/null).\n"},{"id":"138364","messageId":"4462210481812dc3b720b34f59e3051a65e41336.1270159202.git.git@drmicha.warpmail.net","threadId":"23165","inReplyTo":"7v7houxu8n.fsf@alter.siamese.dyndns.org","subject":"[PATCH] clone: quell the progress report from init and report on clone","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-04-01T22:03:06Z","receivedAt":"2010-04-01T22:03:06Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"From: Junio C Hamano <gitster@pobox.com>\n\nCurrently, a local glit clone reports only initializing an empty\ngit dir, which is potentially confusing.\n\nInstead, report that cloning is in progress and when it is done\n(unless -q) is given, and suppres the init report (unless -v\nis given).\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nI checked the documentation, there is really no place where the output\nof git clone is documented - no documentation or test change is necesessary.\n\nI made it so that -v will restore the init message. Other than that this is really\nyour path, Junio.\n\n builtin/clone.c  |    4 ++++\n t/t5601-clone.sh |    2 +-\n 2 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 05f8fb4..6e0584c 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -302,6 +302,8 @@ static const struct ref *clone_local(const char *src_repo,\n \ttransport = transport_get(remote, src_repo);\n \tret = transport_get_remote_refs(transport);\n \ttransport_disconnect(transport);\n+\tif (0 <= option_verbosity)\n+\t\tprintf(\"done.\\n\");\n \treturn ret;\n }\n \n@@ -462,6 +464,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \tset_git_dir(make_absolute_path(git_dir));\n \n \tinit_db(option_template, (option_verbosity < 0) ? INIT_DB_QUIET : 0);\n+\tif (0 <= option_verbosity)\n+\t\tprintf(\"Cloning into %s...\\n\", get_git_dir());\n \n \t/*\n \t * At this point, the config exists, so we do not need the\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 2147567..678cee5 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -34,7 +34,7 @@ test_expect_success 'clone with excess parameters (2)' '\n test_expect_success 'output from clone' '\n \trm -fr dst &&\n \tgit clone -n \"file://$(pwd)/src\" dst >output &&\n-\ttest $(grep Initialized output | wc -l) = 1\n+\ttest $(grep Clon output | wc -l) = 1\n '\n \n test_expect_success 'clone does not keep pack' '\n-- \n1.7.0.3.448.g82eeb\n"},{"id":"138397","messageId":"7vljd6l3dn.fsf@alter.siamese.dyndns.org","threadId":"23165","inReplyTo":"4462210481812dc3b720b34f59e3051a65e41336.1270159202.git.git@drmicha.warpmail.net","subject":"Re: [PATCH] clone: quell the progress report from init and report on clone","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-04-02T07:28:36Z","receivedAt":"2010-04-02T07:28:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n\n> From: Junio C Hamano <gitster@pobox.com>\n>\n> Currently, a local glit clone reports only initializing an empty\n> git dir, which is potentially confusing.\n\nglit?\n\n> Instead, report that cloning is in progress and when it is done\n> (unless -q) is given, and suppres the init report (unless -v\n> is given).\n>\n> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n> ---\n> I checked the documentation, there is really no place where the output\n> of git clone is documented - no documentation or test change is necesessary.\n\nThanks.\n\n> I made it so that -v will restore the init message.\n\nI wonder how that would be useful, though.  The new message already says\nwhich directory is being worked on.  I didn't see a point of repeating\nthat and made it silent on purpose.\n"},{"id":"138531","messageId":"1270386135.1675.1368217929@webmail.messagingengine.com","threadId":"23165","inReplyTo":"7vljd6l3dn.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] clone: quell the progress report from init and report on clone","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-04-04T13:02:15Z","receivedAt":"2010-04-04T13:02:15Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"On Fri, 02 Apr 2010 00:28 -0700, \"Junio C Hamano\" <gitster@pobox.com>\nwrote:\n> Michael J Gruber <git@drmicha.warpmail.net> writes:\n> \n> > From: Junio C Hamano <gitster@pobox.com>\n> >\n> > Currently, a local glit clone reports only initializing an empty\n> > git dir, which is potentially confusing.\n> \n> glit?\n\nSorry, this glitch clomes from the clone clommand of glit.\n \n> > Instead, report that cloning is in progress and when it is done\n> > (unless -q) is given, and suppres the init report (unless -v\n> > is given).\n> >\n> > Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n> > ---\n> > I checked the documentation, there is really no place where the output\n> > of git clone is documented - no documentation or test change is necesessary.\n> \n> Thanks.\n> \n> > I made it so that -v will restore the init message.\n> \n> I wonder how that would be useful, though.  The new message already says\n> which directory is being worked on.  I didn't see a point of repeating\n> that and made it silent on purpose.\n \nWell, the idea is that '-v' should do at least something, and often (for\nother commands) shows the individual steps of an action. The steps here\nare init+clone.\nPersonally, I don't really care for either option.\n\nMichael\nP.S.: I'm sparsely online this week. Please don't mind if my responses\ncome in late.\n"},{"id":"140212","messageId":"35f1aab26b685ab5f124cfe1bf99b2d3a9fbaaa5.1272025319.git.git@drmicha.warpmail.net","threadId":"23165","inReplyTo":"1270386135.1675.1368217929@webmail.messagingengine.com","subject":"[PATCH] clone: quell the progress report from init and report on clone","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-04-23T12:37:22Z","receivedAt":"2010-04-23T12:37:22Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"From: Junio C Hamano <gitster@pobox.com>\n\nCurrently, a local git clone reports only initializing an empty\ngit dir, which is potentially confusing.\n\nInstead, report that cloning is in progress and when it is done\n(unless -q) is given, and suppress the init report.\n\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nBasically this is your patch now, Junio, which is why it disappeared from my\nradar. But I don't think you applied it, so I'm resubmitting.\n\nv2 shuts up init unconditionally (even with -v), as you preferred.\n\n builtin/clone.c  |    6 +++++-\n t/t5601-clone.sh |    2 +-\n 2 files changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/clone.c b/builtin/clone.c\nindex 05f8fb4..0bedde4 100644\n--- a/builtin/clone.c\n+++ b/builtin/clone.c\n@@ -302,6 +302,8 @@ static const struct ref *clone_local(const char *src_repo,\n \ttransport = transport_get(remote, src_repo);\n \tret = transport_get_remote_refs(transport);\n \ttransport_disconnect(transport);\n+\tif (0 <= option_verbosity)\n+\t\tprintf(\"done.\\n\");\n \treturn ret;\n }\n \n@@ -461,7 +463,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \t\tdie(\"could not create leading directories of '%s'\", git_dir);\n \tset_git_dir(make_absolute_path(git_dir));\n \n-\tinit_db(option_template, (option_verbosity < 0) ? INIT_DB_QUIET : 0);\n+\tif (0 <= option_verbosity)\n+\t\tprintf(\"Cloning into %s...\\n\", get_git_dir());\n+\tinit_db(option_template, INIT_DB_QUIET);\n \n \t/*\n \t * At this point, the config exists, so we do not need the\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 2147567..678cee5 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -34,7 +34,7 @@ test_expect_success 'clone with excess parameters (2)' '\n test_expect_success 'output from clone' '\n \trm -fr dst &&\n \tgit clone -n \"file://$(pwd)/src\" dst >output &&\n-\ttest $(grep Initialized output | wc -l) = 1\n+\ttest $(grep Clon output | wc -l) = 1\n '\n \n test_expect_success 'clone does not keep pack' '\n-- \n1.7.1.rc1.248.gcefbb\n"}]}