{"thread":{"id":"19805","subject":"[PATCH 1/2] am: teach quiet option","startedAt":"2009-06-13T20:21:38Z","lastAt":"2009-06-15T06:33:46Z","messageCount":18,"participants":["Stephen Boyd","Junio C Hamano","Sverre Rabbelier","Thomas Adam","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"116252","messageId":"1244924500-27391-1-git-send-email-bebarino@gmail.com","threadId":"19805","inReplyTo":null,"subject":"[PATCH 0/2] teach am and rebase -q/--quiet","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-06-13T20:21:38Z","receivedAt":"2009-06-13T20:21:38Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"am and rebase are talkative scripts. Teach them to be less verbose.\nThis is useful for script writers incorporating rebase or am into\ntheir scripts.\n\nI am not sure why \"current branch $branch is up to date\" and\n\"Fast-forwarded $branch to $onto\" is echoed to stderr, but I've\nwrapped those in a quiet check because it doesn't seem to be\nan error. Maybe those should be changed to stdout?\n\nStephen Boyd (2):\n  am: teach quiet option\n  rebase: teach quiet option\n\n Documentation/git-am.txt     |    6 ++++-\n Documentation/git-rebase.txt |    4 +++\n git-am.sh                    |   27 ++++++++++++++++++----\n git-rebase.sh                |   49 ++++++++++++++++++++++++++++++++---------\n t/t3400-rebase.sh            |    7 ++++++\n t/t4150-am.sh                |    7 ++++++\n 6 files changed, 83 insertions(+), 17 deletions(-)\n"},{"id":"116251","messageId":"1244924500-27391-2-git-send-email-bebarino@gmail.com","threadId":"19805","inReplyTo":"1244924500-27391-1-git-send-email-bebarino@gmail.com","subject":"[PATCH 1/2] am: teach quiet option","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-06-13T20:21:39Z","receivedAt":"2009-06-13T20:21:39Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"git-rebase will use this when invoked with -q.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n Documentation/git-am.txt |    6 +++++-\n git-am.sh                |   27 ++++++++++++++++++++++-----\n t/t4150-am.sh            |    7 +++++++\n 3 files changed, 34 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex 6d92cbe..32e689b 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -13,7 +13,7 @@ SYNOPSIS\n \t [--3way] [--interactive] [--committer-date-is-author-date]\n \t [--ignore-date]\n \t [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]\n-\t [--reject]\n+\t [--reject] [-q | --quiet]\n \t [<mbox> | <Maildir>...]\n 'git am' (--skip | --resolved | --abort)\n \n@@ -39,6 +39,10 @@ OPTIONS\n --keep::\n \tPass `-k` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1]).\n \n+-q::\n+--quiet::\n+\tBe quiet. Only print error messages.\n+\n -u::\n --utf8::\n \tPass `-u` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1]).\ndiff --git a/git-am.sh b/git-am.sh\nindex 578780b..f04aca5 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -11,6 +11,7 @@ git am [options] (--resolved | --skip | --abort)\n i,interactive   run interactively\n b,binary*       (historical option -- no-op)\n 3,3way          allow fall back on 3way merging if needed\n+q,quiet         be quiet\n s,signoff       add a Signed-off-by line to the commit message\n u,utf8          recode into utf8 (default)\n k,keep          pass -k flag to git-mailinfo\n@@ -52,6 +53,16 @@ stop_here () {\n     exit 1\n }\n \n+quiet=\n+\n+say ()\n+{\n+    if test -z \"$quiet\"\n+    then\n+\techo $@\n+    fi\n+}\n+\n stop_here_user_resolve () {\n     if [ -n \"$resolvemsg\" ]; then\n \t    printf '%s\\n' \"$resolvemsg\"\n@@ -99,7 +110,7 @@ fall_back_3way () {\n     git write-tree >\"$dotest/patch-merge-base+\" ||\n     cannot_fallback \"Repository lacks necessary blobs to fall back on 3-way merge.\"\n \n-    echo Using index info to reconstruct a base tree...\n+    say Using index info to reconstruct a base tree...\n     if GIT_INDEX_FILE=\"$dotest/patch-merge-tmp-index\" \\\n \tgit apply --cached <\"$dotest/patch\"\n     then\n@@ -115,7 +126,7 @@ It does not apply to blobs recorded in its index.\"\n     orig_tree=$(cat \"$dotest/patch-merge-base\") &&\n     rm -fr \"$dotest\"/patch-merge-* || exit 1\n \n-    echo Falling back to patching base and 3-way merge...\n+    say Falling back to patching base and 3-way merge...\n \n     # This is not so wrong.  Depending on which base we picked,\n     # orig_tree may be wildly different from ours, but his_tree\n@@ -125,6 +136,10 @@ It does not apply to blobs recorded in its index.\"\n \n     eval GITHEAD_$his_tree='\"$FIRSTLINE\"'\n     export GITHEAD_$his_tree\n+    if test -n \"$quiet\"\n+    then\n+\t    export GIT_MERGE_VERBOSITY=0\n+    fi\n     git-merge-recursive $orig_tree -- HEAD $his_tree || {\n \t    git rerere\n \t    echo Failed to merge in the changes.\n@@ -181,6 +196,8 @@ do\n \t\tcommitter_date_is_author_date=t ;;\n \t--ignore-date)\n \t\tignore_date=t ;;\n+\t-q|--quiet)\n+\t\tquiet=t ;;\n \t--)\n \t\tshift; break ;;\n \t*)\n@@ -352,7 +369,7 @@ fi\n \n if test \"$this\" -gt \"$last\"\n then\n-\techo Nothing to do.\n+\tsay Nothing to do.\n \trm -fr \"$dotest\"\n \texit\n fi\n@@ -498,7 +515,7 @@ do\n \t\tstop_here $this\n \tfi\n \n-\tprintf 'Applying: %s\\n' \"$FIRSTLINE\"\n+\tsay \"Applying: $FIRSTLINE\"\n \n \tcase \"$resolved\" in\n \t'')\n@@ -534,7 +551,7 @@ do\n \t\t    # Applying the patch to an earlier tree and merging the\n \t\t    # result may have produced the same tree as ours.\n \t\t    git diff-index --quiet --cached HEAD -- && {\n-\t\t\techo No changes -- Patch already applied.\n+\t\t\tsay No changes -- Patch already applied.\n \t\t\tgo_next\n \t\t\tcontinue\n \t\t    }\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex d6ebbae..f8725a9 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -305,4 +305,11 @@ test_expect_success 'am into an unborn branch' '\n \ttest \"z$result\" = \"z$(git rev-parse first^{tree})\"\n '\n \n+test_expect_success 'am -q is quiet' '\n+\tgit checkout first &&\n+\ttest_tick &&\n+\tgit am -q <patch1 > output.out &&\n+\ttest ! -s output.out\n+'\n+\n test_done\n-- \n1.6.3.2.225.gb8364\n"},{"id":"116253","messageId":"1244924500-27391-3-git-send-email-bebarino@gmail.com","threadId":"19805","inReplyTo":"1244924500-27391-2-git-send-email-bebarino@gmail.com","subject":"[PATCH 2/2] rebase: teach quiet option","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-06-13T20:21:40Z","receivedAt":"2009-06-13T20:21:40Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"This is useful for scripts using rebase. Instead of redirecting to\n/dev/null, the script writers can just use -q\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n Documentation/git-rebase.txt |    4 +++\n git-rebase.sh                |   49 ++++++++++++++++++++++++++++++++---------\n t/t3400-rebase.sh            |    7 ++++++\n 3 files changed, 49 insertions(+), 11 deletions(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex 26f3b7b..db1b71d 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -236,6 +236,10 @@ OPTIONS\n \tis used instead ('git-merge-recursive' when merging a single\n \thead, 'git-merge-octopus' otherwise).  This implies --merge.\n \n+-q::\n+--quiet::\n+\tBe quiet. Implies --no-stat.\n+\n -v::\n --verbose::\n \tBe verbose. Implies --stat.\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex b83fd3f..9a39f0f 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -3,7 +3,7 @@\n # Copyright (c) 2005 Junio C Hamano.\n #\n \n-USAGE='[--interactive | -i] [-v] [--force-rebase | -f] [--onto <newbase>] [<upstream>|--root] [<branch>]'\n+USAGE='[--interactive | -i] [-v] [--force-rebase | -f] [--onto <newbase>] [<upstream>|--root] [<branch>] [--quiet | -q]'\n LONG_USAGE='git-rebase replaces <branch> with a new branch of the\n same name.  When the --onto option is provided the new branch starts\n out with a HEAD equal to <newbase>, otherwise it is equal to <upstream>\n@@ -46,11 +46,20 @@ do_merge=\n dotest=\"$GIT_DIR\"/rebase-merge\n prec=4\n verbose=\n+quiet=\n diffstat=$(git config --bool rebase.stat)\n git_am_opt=\n rebase_root=\n force_rebase=\n \n+say ()\n+{\n+    if test -z \"$quiet\"\n+    then\n+\techo $@\n+    fi\n+}\n+\n continue_merge () {\n \ttest -n \"$prev_head\" || die \"prev_head must be defined\"\n \ttest -d \"$dotest\" || die \"$dotest directory does not exist\"\n@@ -72,9 +81,15 @@ continue_merge () {\n \t\t\techo \"directly, but instead do one of the following: \"\n \t\t\tdie \"$RESOLVEMSG\"\n \t\tfi\n-\t\tprintf \"Committed: %0${prec}d \" $msgnum\n+\t\tif test -z \"$quiet\"\n+\t\tthen\n+\t\t\tprintf \"Committed: %0${prec}d \" $msgnum\n+\t\tfi\n \telse\n-\t\tprintf \"Already applied: %0${prec}d \" $msgnum\n+\t\tif test -z \"$quiet\"\n+\t\tthen\n+\t\t\tprintf \"Already applied: %0${prec}d \" $msgnum\n+\t\tfi\n \tfi\n \tgit rev-list --pretty=oneline -1 \"$cmt\" | sed -e 's/^[^ ]* //'\n \n@@ -138,7 +153,7 @@ move_to_original_branch () {\n finish_rb_merge () {\n \tmove_to_original_branch\n \trm -r \"$dotest\"\n-\techo \"All done.\"\n+\tsay \"All done.\"\n }\n \n is_interactive () {\n@@ -221,7 +236,7 @@ do\n \t\thead_name=$(cat \"$GIT_DIR\"/rebase-apply/head-name) &&\n \t\tonto=$(cat \"$GIT_DIR\"/rebase-apply/onto) &&\n \t\torig_head=$(cat \"$GIT_DIR\"/rebase-apply/orig-head) &&\n-\t\tgit am --resolved --3way --resolvemsg=\"$RESOLVEMSG\" &&\n+\t\tgit am --resolved $quiet --3way --resolvemsg=\"$RESOLVEMSG\" &&\n \t\tmove_to_original_branch\n \t\texit\n \t\t;;\n@@ -249,7 +264,7 @@ do\n \t\thead_name=$(cat \"$GIT_DIR\"/rebase-apply/head-name) &&\n \t\tonto=$(cat \"$GIT_DIR\"/rebase-apply/onto) &&\n \t\torig_head=$(cat \"$GIT_DIR\"/rebase-apply/orig-head) &&\n-\t\tgit am -3 --skip --resolvemsg=\"$RESOLVEMSG\" &&\n+\t\tgit am -3 --skip $quiet --resolvemsg=\"$RESOLVEMSG\" &&\n \t\tmove_to_original_branch\n \t\texit\n \t\t;;\n@@ -300,6 +315,12 @@ do\n \t-v|--verbose)\n \t\tverbose=t\n \t\tdiffstat=t\n+\t\tquiet=\n+\t\t;;\n+\t-q|--quiet)\n+\t\tquiet=\"-q\"\n+\t\tverbose=\n+\t\tdiffstat=\n \t\t;;\n \t--whitespace=*)\n \t\tgit_am_opt=\"$git_am_opt $1\"\n@@ -445,15 +466,18 @@ then\n \tthen\n \t\t# Lazily switch to the target branch if needed...\n \t\ttest -z \"$switch_to\" || git checkout \"$switch_to\"\n-\t\techo >&2 \"Current branch $branch_name is up to date.\"\n+\t\tif test -z \"$quiet\"\n+\t\tthen\n+\t\t\techo >&2 \"Current branch $branch_name is up to date.\"\n+\t\tfi\n \t\texit 0\n \telse\n-\t\techo \"Current branch $branch_name is up to date, rebase forced.\"\n+\t\tsay \"Current branch $branch_name is up to date, rebase forced.\"\n \tfi\n fi\n \n # Detach HEAD and reset the tree\n-echo \"First, rewinding head to replay your work on top of it...\"\n+say \"First, rewinding head to replay your work on top of it...\"\n git checkout -q \"$onto^0\" || die \"could not detach HEAD\"\n git update-ref ORIG_HEAD $branch\n \n@@ -471,7 +495,10 @@ fi\n # we just fast forwarded.\n if test \"$mb\" = \"$branch\"\n then\n-\techo >&2 \"Fast-forwarded $branch_name to $onto_name.\"\n+\tif test -z \"$quiet\"\n+\tthen\n+\t\techo >&2 \"Fast-forwarded $branch_name to $onto_name.\"\n+\tfi\n \tmove_to_original_branch\n \texit 0\n fi\n@@ -487,7 +514,7 @@ if test -z \"$do_merge\"\n then\n \tgit format-patch -k --stdout --full-index --ignore-if-in-upstream \\\n \t\t$root_flag \"$revisions\" |\n-\tgit am $git_am_opt --rebasing --resolvemsg=\"$RESOLVEMSG\" &&\n+\tgit am $git_am_opt $quiet --rebasing --resolvemsg=\"$RESOLVEMSG\" &&\n \tmove_to_original_branch\n \tret=$?\n \ttest 0 != $ret -a -d \"$GIT_DIR\"/rebase-apply &&\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 7f62bfb..9456b2f 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -126,4 +126,11 @@ test_expect_success 'Show verbose error when HEAD could not be detached' '\n      grep \"Untracked working tree file .B. would be overwritten\" output.err\n '\n \n+test_expect_success 'rebase -q is quiet' '\n+    rm B &&\n+    git checkout -b quiet topic &&\n+    git rebase -q master > output.out &&\n+    test ! -s output.out\n+'\n+\n test_done\n-- \n1.6.3.2.225.gb8364\n"},{"id":"116256","messageId":"7vk53fvini.fsf@alter.siamese.dyndns.org","threadId":"19805","inReplyTo":"1244924500-27391-1-git-send-email-bebarino@gmail.com","subject":"Re: [PATCH 0/2] teach am and rebase -q/--quiet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-13T23:05:53Z","receivedAt":"2009-06-13T23:05:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> writes:\n\n> I am not sure why \"current branch $branch is up to date\" and\n> \"Fast-forwarded $branch to $onto\" is echoed to stderr, but I've\n> wrapped those in a quiet check because it doesn't seem to be\n> an error. Maybe those should be changed to stdout?\n\nThere are many valid cases where it makes sense to use stderr for messages\nthat are not errors (e.g. diagnostics, prompts, progress reports, and\ninformational messages that otherwise would clutter machine parsable\noutput meant to go to stdout).\n\nI do not understand why some people seem to think stderr is only for\nerrors.  I think we even saw a broken interpretive language environment\nwhere the system considers it an error if a program it launched said\nanything to stderr, instead of correctly diagnosing the exit status from\nit?\n\nIt is a disease.\n"},{"id":"116257","messageId":"7vfxe3vil9.fsf@alter.siamese.dyndns.org","threadId":"19805","inReplyTo":"1244924500-27391-1-git-send-email-bebarino@gmail.com","subject":"Re: [PATCH 0/2] teach am and rebase -q/--quiet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-13T23:07:14Z","receivedAt":"2009-06-13T23:07:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Perhaps you would want to do the same for \"stash apply/pop\" that runs \"git\nstatus\", listing untracked files and whatnot?\n"},{"id":"116268","messageId":"4A34A1AC.2070808@gmail.com","threadId":"19805","inReplyTo":"7vk53fvini.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 0/2] teach am and rebase -q/--quiet","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-06-14T07:07:24Z","receivedAt":"2009-06-14T07:07:24Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"Junio C Hamano wrote:\n> There are many valid cases where it makes sense to use stderr for messages\n> that are not errors (e.g. diagnostics, prompts, progress reports, and\n> informational messages that otherwise would clutter machine parsable\n> output meant to go to stdout).\n>\n> I do not understand why some people seem to think stderr is only for\n> errors.  I think we even saw a broken interpretive language environment\n> where the system considers it an error if a program it launched said\n> anything to stderr, instead of correctly diagnosing the exit status from\n> it?\n>\n> It is a disease.\n>   \n\nIf I understand you correctly, wrapping them in quiet checks is fine.\nAlso, thanks for the explanation. I'll consider my self inoculated.\n"},{"id":"116272","messageId":"4A34A3D0.9020407@gmail.com","threadId":"19805","inReplyTo":"7vfxe3vil9.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 0/2] teach am and rebase -q/--quiet","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-06-14T07:16:32Z","receivedAt":"2009-06-14T07:16:32Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"Junio C Hamano wrote:\n> Perhaps you would want to do the same for \"stash apply/pop\" that runs \"git\n> status\", listing untracked files and whatnot?\n\nThis sounds fine for a follow up, or even a v2. I'm curious though,\nwould adding say() to git-sh-setup be a good idea? Otherwise I'll be\nadding a say function another time.\n"},{"id":"116273","messageId":"7vocsrql2i.fsf@alter.siamese.dyndns.org","threadId":"19805","inReplyTo":"4A34A3D0.9020407@gmail.com","subject":"Re: [PATCH 0/2] teach am and rebase -q/--quiet","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-14T08:24:53Z","receivedAt":"2009-06-14T08:24:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephen Boyd <bebarino@gmail.com> writes:\n\n> Junio C Hamano wrote:\n>> Perhaps you would want to do the same for \"stash apply/pop\" that runs \"git\n>> status\", listing untracked files and whatnot?\n>\n> This sounds fine for a follow up, or even a v2.\n\nYeah, I should have been clearer that I was suggesting a follow-up, and\nnot even necessarily by you.\n\n> I'm curious though,\n> would adding say() to git-sh-setup be a good idea?\n\nWe have die(); I'd say why not say() ;-)\n"},{"id":"116276","messageId":"fabb9a1e0906140127q3b6a7a56l9b90a1e1e19b03fa@mail.gmail.com","threadId":"19805","inReplyTo":"7vk53fvini.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 0/2] teach am and rebase -q/--quiet","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2009-06-14T08:27:15Z","receivedAt":"2009-06-14T08:27:15Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Sun, Jun 14, 2009 at 01:05, Junio C Hamano<gitster@pobox.com> wrote:\n> Stephen Boyd <bebarino@gmail.com> writes:\n> I do not understand why some people seem to think stderr is only for\n> errors.\n\nThe name might be setting people off? ;)\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"116298","messageId":"1245021374-8430-1-git-send-email-bebarino@gmail.com","threadId":"19805","inReplyTo":"1244924500-27391-1-git-send-email-bebarino@gmail.com","subject":"[PATCHv2 0/3] Teach shell scripts to be quiet","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-06-14T23:16:11Z","receivedAt":"2009-06-14T23:16:11Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"The main goal of this is to teach git-am and git-rebase to be\nquiet. To do that, I've implemented a generic say function in\ngit-sh-setup so that script writers can implement a quiet\noption by setting GIT_QUIET and using say instead of echo.\n\ngit-stash is still left out, but hopefully this makes that easier\nfor someone else later.\n\nChanges since v1:\n    - introduction of say()\n    - migration of submodule and repack\n\nStephen Boyd (3):\n  git-sh-setup: introduce say() for quiet options\n  submodule, repack: migrate to git-sh-setup's say()\n  am, rebase: teach quiet option\n\n Documentation/git-am.txt     |    6 +++++-\n Documentation/git-rebase.txt |    4 ++++\n git-am.sh                    |   17 ++++++++++++-----\n git-rebase.sh                |   40 +++++++++++++++++++++++++++++-----------\n git-repack.sh                |   12 +++++-------\n git-sh-setup.sh              |    7 +++++++\n git-submodule.sh             |   24 ++++++------------------\n t/t3400-rebase.sh            |    7 +++++++\n t/t4150-am.sh                |    7 +++++++\n 9 files changed, 82 insertions(+), 42 deletions(-)\n"},{"id":"116297","messageId":"1245021374-8430-2-git-send-email-bebarino@gmail.com","threadId":"19805","inReplyTo":"1245021374-8430-1-git-send-email-bebarino@gmail.com","subject":"[PATCHv2 1/3] git-sh-setup: introduce say() for quiet options","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-06-14T23:16:12Z","receivedAt":"2009-06-14T23:16:12Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"Scripts should use say() when they want to echo to stdout. Setting\nGIT_QUIET will mute say(), allowing scripts to easily implement a quiet\noption.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n git-sh-setup.sh |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/git-sh-setup.sh b/git-sh-setup.sh\nindex 80acb7d..f88184e 100755\n--- a/git-sh-setup.sh\n+++ b/git-sh-setup.sh\n@@ -44,6 +44,13 @@ die() {\n \texit 1\n }\n \n+say () {\n+\tif test -z \"$GIT_QUIET\"\n+\tthen\n+\t\techo \"$@\"\n+\tfi\n+}\n+\n if test -n \"$OPTIONS_SPEC\"; then\n \tusage() {\n \t\t\"$0\" -h\n-- \n1.6.3.2.306.g4f4fa\n"},{"id":"116299","messageId":"1245021374-8430-3-git-send-email-bebarino@gmail.com","threadId":"19805","inReplyTo":"1245021374-8430-2-git-send-email-bebarino@gmail.com","subject":"[PATCHv2 2/3] submodule, repack: migrate to git-sh-setup's say()","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-06-14T23:16:13Z","receivedAt":"2009-06-14T23:16:13Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"Now that there is say() in git-sh-setup, these scripts don't need to use\ntheir own. Migrate them over by setting GIT_QUIET and removing their\ncustom say() functions.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n git-repack.sh    |   12 +++++-------\n git-submodule.sh |   24 ++++++------------------\n 2 files changed, 11 insertions(+), 25 deletions(-)\n\ndiff --git a/git-repack.sh b/git-repack.sh\nindex 0868734..efb527c 100755\n--- a/git-repack.sh\n+++ b/git-repack.sh\n@@ -24,7 +24,7 @@ SUBDIRECTORY_OK='Yes'\n . git-sh-setup\n \n no_update_info= all_into_one= remove_redundant= unpack_unreachable=\n-local= quiet= no_reuse= extra=\n+local= no_reuse= extra=\n while test $# != 0\n do\n \tcase \"$1\" in\n@@ -33,7 +33,7 @@ do\n \t-A)\tall_into_one=t\n \t\tunpack_unreachable=--unpack-unreachable ;;\n \t-d)\tremove_redundant=t ;;\n-\t-q)\tquiet=-q ;;\n+\t-q)\tGIT_QUIET=-q ;;\n \t-f)\tno_reuse=--no-reuse-object ;;\n \t-l)\tlocal=--local ;;\n \t--max-pack-size|--window|--window-memory|--depth)\n@@ -80,13 +80,11 @@ case \",$all_into_one,\" in\n \t;;\n esac\n \n-args=\"$args $local $quiet $no_reuse$extra\"\n+args=\"$args $local $GIT_QUIET $no_reuse$extra\"\n names=$(git pack-objects --honor-pack-keep --non-empty --all --reflog $args </dev/null \"$PACKTMP\") ||\n \texit 1\n if [ -z \"$names\" ]; then\n-\tif test -z \"$quiet\"; then\n-\t\techo Nothing new to pack.\n-\tfi\n+\tsay Nothing new to pack.\n fi\n \n # Ok we have prepared all new packfiles.\n@@ -176,7 +174,7 @@ then\n \t\t  done\n \t\t)\n \tfi\n-\tgit prune-packed $quiet\n+\tgit prune-packed $GIT_QUIET\n fi\n \n case \"$no_update_info\" in\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 19a3a84..58d2fd2 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -14,23 +14,11 @@ require_work_tree\n \n command=\n branch=\n-quiet=\n reference=\n cached=\n nofetch=\n update=\n \n-#\n-# print stuff on stdout unless -q was specified\n-#\n-say()\n-{\n-\tif test -z \"$quiet\"\n-\tthen\n-\t\techo \"$@\"\n-\tfi\n-}\n-\n # Resolve relative url by appending to parent's url\n resolve_relative_url ()\n {\n@@ -137,7 +125,7 @@ cmd_add()\n \t\t\tshift\n \t\t\t;;\n \t\t-q|--quiet)\n-\t\t\tquiet=1\n+\t\t\tGIT_QUIET=1\n \t\t\t;;\n \t\t--reference)\n \t\t\tcase \"$2\" in '') usage ;; esac\n@@ -273,7 +261,7 @@ cmd_init()\n \tdo\n \t\tcase \"$1\" in\n \t\t-q|--quiet)\n-\t\t\tquiet=1\n+\t\t\tGIT_QUIET=1\n \t\t\t;;\n \t\t--)\n \t\t\tshift\n@@ -333,7 +321,7 @@ cmd_update()\n \t\tcase \"$1\" in\n \t\t-q|--quiet)\n \t\t\tshift\n-\t\t\tquiet=1\n+\t\t\tGIT_QUIET=1\n \t\t\t;;\n \t\t-i|--init)\n \t\t\tinit=1\n@@ -650,7 +638,7 @@ cmd_status()\n \tdo\n \t\tcase \"$1\" in\n \t\t-q|--quiet)\n-\t\t\tquiet=1\n+\t\t\tGIT_QUIET=1\n \t\t\t;;\n \t\t--cached)\n \t\t\tcached=1\n@@ -704,7 +692,7 @@ cmd_sync()\n \tdo\n \t\tcase \"$1\" in\n \t\t-q|--quiet)\n-\t\t\tquiet=1\n+\t\t\tGIT_QUIET=1\n \t\t\tshift\n \t\t\t;;\n \t\t--)\n@@ -759,7 +747,7 @@ do\n \t\tcommand=$1\n \t\t;;\n \t-q|--quiet)\n-\t\tquiet=1\n+\t\tGIT_QUIET=1\n \t\t;;\n \t-b|--branch)\n \t\tcase \"$2\" in\n-- \n1.6.3.2.306.g4f4fa\n"},{"id":"116300","messageId":"1245021374-8430-4-git-send-email-bebarino@gmail.com","threadId":"19805","inReplyTo":"1245021374-8430-3-git-send-email-bebarino@gmail.com","subject":"[PATCHv2 3/3] am, rebase: teach quiet option","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-06-14T23:16:14Z","receivedAt":"2009-06-14T23:16:14Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"git-rebase and git-am are talkative scripts. This option will quiet\nthem and allow them to speak only when they fail or experience errors.\n\nSigned-off-by: Stephen Boyd <bebarino@gmail.com>\n---\n Documentation/git-am.txt     |    6 +++++-\n Documentation/git-rebase.txt |    4 ++++\n git-am.sh                    |   17 ++++++++++++-----\n git-rebase.sh                |   40 +++++++++++++++++++++++++++++-----------\n t/t3400-rebase.sh            |    7 +++++++\n t/t4150-am.sh                |    7 +++++++\n 6 files changed, 64 insertions(+), 17 deletions(-)\n\ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex 6d92cbe..32e689b 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -13,7 +13,7 @@ SYNOPSIS\n \t [--3way] [--interactive] [--committer-date-is-author-date]\n \t [--ignore-date]\n \t [--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]\n-\t [--reject]\n+\t [--reject] [-q | --quiet]\n \t [<mbox> | <Maildir>...]\n 'git am' (--skip | --resolved | --abort)\n \n@@ -39,6 +39,10 @@ OPTIONS\n --keep::\n \tPass `-k` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1]).\n \n+-q::\n+--quiet::\n+\tBe quiet. Only print error messages.\n+\n -u::\n --utf8::\n \tPass `-u` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1]).\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex 26f3b7b..db1b71d 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -236,6 +236,10 @@ OPTIONS\n \tis used instead ('git-merge-recursive' when merging a single\n \thead, 'git-merge-octopus' otherwise).  This implies --merge.\n \n+-q::\n+--quiet::\n+\tBe quiet. Implies --no-stat.\n+\n -v::\n --verbose::\n \tBe verbose. Implies --stat.\ndiff --git a/git-am.sh b/git-am.sh\nindex 578780b..899ab83 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -11,6 +11,7 @@ git am [options] (--resolved | --skip | --abort)\n i,interactive   run interactively\n b,binary*       (historical option -- no-op)\n 3,3way          allow fall back on 3way merging if needed\n+q,quiet         be quiet\n s,signoff       add a Signed-off-by line to the commit message\n u,utf8          recode into utf8 (default)\n k,keep          pass -k flag to git-mailinfo\n@@ -99,7 +100,7 @@ fall_back_3way () {\n     git write-tree >\"$dotest/patch-merge-base+\" ||\n     cannot_fallback \"Repository lacks necessary blobs to fall back on 3-way merge.\"\n \n-    echo Using index info to reconstruct a base tree...\n+    say Using index info to reconstruct a base tree...\n     if GIT_INDEX_FILE=\"$dotest/patch-merge-tmp-index\" \\\n \tgit apply --cached <\"$dotest/patch\"\n     then\n@@ -115,7 +116,7 @@ It does not apply to blobs recorded in its index.\"\n     orig_tree=$(cat \"$dotest/patch-merge-base\") &&\n     rm -fr \"$dotest\"/patch-merge-* || exit 1\n \n-    echo Falling back to patching base and 3-way merge...\n+    say Falling back to patching base and 3-way merge...\n \n     # This is not so wrong.  Depending on which base we picked,\n     # orig_tree may be wildly different from ours, but his_tree\n@@ -125,6 +126,10 @@ It does not apply to blobs recorded in its index.\"\n \n     eval GITHEAD_$his_tree='\"$FIRSTLINE\"'\n     export GITHEAD_$his_tree\n+    if test -n \"$GIT_QUIET\"\n+    then\n+\t    export GIT_MERGE_VERBOSITY=0\n+    fi\n     git-merge-recursive $orig_tree -- HEAD $his_tree || {\n \t    git rerere\n \t    echo Failed to merge in the changes.\n@@ -181,6 +186,8 @@ do\n \t\tcommitter_date_is_author_date=t ;;\n \t--ignore-date)\n \t\tignore_date=t ;;\n+\t-q|--quiet)\n+\t\tGIT_QUIET=t ;;\n \t--)\n \t\tshift; break ;;\n \t*)\n@@ -352,7 +359,7 @@ fi\n \n if test \"$this\" -gt \"$last\"\n then\n-\techo Nothing to do.\n+\tsay Nothing to do.\n \trm -fr \"$dotest\"\n \texit\n fi\n@@ -498,7 +505,7 @@ do\n \t\tstop_here $this\n \tfi\n \n-\tprintf 'Applying: %s\\n' \"$FIRSTLINE\"\n+\tsay \"Applying: $FIRSTLINE\"\n \n \tcase \"$resolved\" in\n \t'')\n@@ -534,7 +541,7 @@ do\n \t\t    # Applying the patch to an earlier tree and merging the\n \t\t    # result may have produced the same tree as ours.\n \t\t    git diff-index --quiet --cached HEAD -- && {\n-\t\t\techo No changes -- Patch already applied.\n+\t\t\tsay No changes -- Patch already applied.\n \t\t\tgo_next\n \t\t\tcontinue\n \t\t    }\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex b83fd3f..e6d44ff 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -3,7 +3,7 @@\n # Copyright (c) 2005 Junio C Hamano.\n #\n \n-USAGE='[--interactive | -i] [-v] [--force-rebase | -f] [--onto <newbase>] [<upstream>|--root] [<branch>]'\n+USAGE='[--interactive | -i] [-v] [--force-rebase | -f] [--onto <newbase>] [<upstream>|--root] [<branch>] [--quiet | -q]'\n LONG_USAGE='git-rebase replaces <branch> with a new branch of the\n same name.  When the --onto option is provided the new branch starts\n out with a HEAD equal to <newbase>, otherwise it is equal to <upstream>\n@@ -72,9 +72,15 @@ continue_merge () {\n \t\t\techo \"directly, but instead do one of the following: \"\n \t\t\tdie \"$RESOLVEMSG\"\n \t\tfi\n-\t\tprintf \"Committed: %0${prec}d \" $msgnum\n+\t\tif test -z \"$GIT_QUIET\"\n+\t\tthen\n+\t\t\tprintf \"Committed: %0${prec}d \" $msgnum\n+\t\tfi\n \telse\n-\t\tprintf \"Already applied: %0${prec}d \" $msgnum\n+\t\tif test -z \"$GIT_QUIET\"\n+\t\tthen\n+\t\t\tprintf \"Already applied: %0${prec}d \" $msgnum\n+\t\tfi\n \tfi\n \tgit rev-list --pretty=oneline -1 \"$cmt\" | sed -e 's/^[^ ]* //'\n \n@@ -138,7 +144,7 @@ move_to_original_branch () {\n finish_rb_merge () {\n \tmove_to_original_branch\n \trm -r \"$dotest\"\n-\techo \"All done.\"\n+\tsay \"All done.\"\n }\n \n is_interactive () {\n@@ -221,7 +227,7 @@ do\n \t\thead_name=$(cat \"$GIT_DIR\"/rebase-apply/head-name) &&\n \t\tonto=$(cat \"$GIT_DIR\"/rebase-apply/onto) &&\n \t\torig_head=$(cat \"$GIT_DIR\"/rebase-apply/orig-head) &&\n-\t\tgit am --resolved --3way --resolvemsg=\"$RESOLVEMSG\" &&\n+\t\tgit am --resolved $GIT_QUIET --3way --resolvemsg=\"$RESOLVEMSG\" &&\n \t\tmove_to_original_branch\n \t\texit\n \t\t;;\n@@ -249,7 +255,7 @@ do\n \t\thead_name=$(cat \"$GIT_DIR\"/rebase-apply/head-name) &&\n \t\tonto=$(cat \"$GIT_DIR\"/rebase-apply/onto) &&\n \t\torig_head=$(cat \"$GIT_DIR\"/rebase-apply/orig-head) &&\n-\t\tgit am -3 --skip --resolvemsg=\"$RESOLVEMSG\" &&\n+\t\tgit am -3 --skip $GIT_QUIET --resolvemsg=\"$RESOLVEMSG\" &&\n \t\tmove_to_original_branch\n \t\texit\n \t\t;;\n@@ -300,6 +306,12 @@ do\n \t-v|--verbose)\n \t\tverbose=t\n \t\tdiffstat=t\n+\t\tGIT_QUIET=\n+\t\t;;\n+\t-q|--quiet)\n+\t\tGIT_QUIET=\"-q\"\n+\t\tverbose=\n+\t\tdiffstat=\n \t\t;;\n \t--whitespace=*)\n \t\tgit_am_opt=\"$git_am_opt $1\"\n@@ -445,15 +457,18 @@ then\n \tthen\n \t\t# Lazily switch to the target branch if needed...\n \t\ttest -z \"$switch_to\" || git checkout \"$switch_to\"\n-\t\techo >&2 \"Current branch $branch_name is up to date.\"\n+\t\tif test -z \"$GIT_QUIET\"\n+\t\tthen\n+\t\t\techo >&2 \"Current branch $branch_name is up to date.\"\n+\t\tfi\n \t\texit 0\n \telse\n-\t\techo \"Current branch $branch_name is up to date, rebase forced.\"\n+\t\tsay \"Current branch $branch_name is up to date, rebase forced.\"\n \tfi\n fi\n \n # Detach HEAD and reset the tree\n-echo \"First, rewinding head to replay your work on top of it...\"\n+say \"First, rewinding head to replay your work on top of it...\"\n git checkout -q \"$onto^0\" || die \"could not detach HEAD\"\n git update-ref ORIG_HEAD $branch\n \n@@ -471,7 +486,10 @@ fi\n # we just fast forwarded.\n if test \"$mb\" = \"$branch\"\n then\n-\techo >&2 \"Fast-forwarded $branch_name to $onto_name.\"\n+\tif test -z \"$GIT_QUIET\"\n+\tthen\n+\t\techo >&2 \"Fast-forwarded $branch_name to $onto_name.\"\n+\tfi\n \tmove_to_original_branch\n \texit 0\n fi\n@@ -487,7 +505,7 @@ if test -z \"$do_merge\"\n then\n \tgit format-patch -k --stdout --full-index --ignore-if-in-upstream \\\n \t\t$root_flag \"$revisions\" |\n-\tgit am $git_am_opt --rebasing --resolvemsg=\"$RESOLVEMSG\" &&\n+\tgit am $git_am_opt $GIT_QUIET --rebasing --resolvemsg=\"$RESOLVEMSG\" &&\n \tmove_to_original_branch\n \tret=$?\n \ttest 0 != $ret -a -d \"$GIT_DIR\"/rebase-apply &&\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex 7f62bfb..fe6445b 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -126,4 +126,11 @@ test_expect_success 'Show verbose error when HEAD could not be detached' '\n      grep \"Untracked working tree file .B. would be overwritten\" output.err\n '\n \n+test_expect_success 'rebase -q is quiet' '\n+     rm B &&\n+     git checkout -b quiet topic &&\n+     git rebase -q master > output.out &&\n+     test ! -s output.out\n+'\n+\n test_done\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex d6ebbae..f8725a9 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -305,4 +305,11 @@ test_expect_success 'am into an unborn branch' '\n \ttest \"z$result\" = \"z$(git rev-parse first^{tree})\"\n '\n \n+test_expect_success 'am -q is quiet' '\n+\tgit checkout first &&\n+\ttest_tick &&\n+\tgit am -q <patch1 > output.out &&\n+\ttest ! -s output.out\n+'\n+\n test_done\n-- \n1.6.3.2.306.g4f4fa\n"},{"id":"116301","messageId":"18071eea0906141621t676a965aqc3056b481b8e8796@mail.gmail.com","threadId":"19805","inReplyTo":"1245021374-8430-2-git-send-email-bebarino@gmail.com","subject":"Re: [PATCHv2 1/3] git-sh-setup: introduce say() for quiet options","fromName":"Thomas Adam","fromEmail":"thomas.adam22@gmail.com","sentAt":"2009-06-14T23:21:53Z","receivedAt":"2009-06-14T23:21:53Z","isPatch":false,"sender":{"key":"thomas.adam22@gmail.com","avatar":"https://gravatar.com/avatar/137f9858bc6bfd5b2f743aefd988c81ce0cbd306248889df80e269519cfc8741?d=mp&s=160"},"body":"2009/6/15 Stephen Boyd <bebarino@gmail.com>:\n> Scripts should use say() when they want to echo to stdout. Setting\n> GIT_QUIET will mute say(), allowing scripts to easily implement a quiet\n> option.\n>\n> Signed-off-by: Stephen Boyd <bebarino@gmail.com>\n> ---\n>  git-sh-setup.sh |    7 +++++++\n>  1 files changed, 7 insertions(+), 0 deletions(-)\n>\n> diff --git a/git-sh-setup.sh b/git-sh-setup.sh\n> index 80acb7d..f88184e 100755\n> --- a/git-sh-setup.sh\n> +++ b/git-sh-setup.sh\n> @@ -44,6 +44,13 @@ die() {\n>        exit 1\n>  }\n>\n> +say () {\n> +       if test -z \"$GIT_QUIET\"\n> +       then\n> +               echo \"$@\"\n\nExcept that where you've then replaced various calls with say() they\nwere originally using printf.  Please use printf here also, and not\necho.\n\n-- Thomas Adam\n"},{"id":"116310","messageId":"7vab4ap1lf.fsf@alter.siamese.dyndns.org","threadId":"19805","inReplyTo":"18071eea0906141621t676a965aqc3056b481b8e8796@mail.gmail.com","subject":"Re: [PATCHv2 1/3] git-sh-setup: introduce say() for quiet options","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-15T04:23:08Z","receivedAt":"2009-06-15T04:23:08Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Adam <thomas.adam22@gmail.com> writes:\n\n> 2009/6/15 Stephen Boyd <bebarino@gmail.com>:\n>> Scripts should use say() when they want to echo to stdout. Setting\n>> GIT_QUIET will mute say(), allowing scripts to easily implement a quiet\n>> option.\n>>\n>> Signed-off-by: Stephen Boyd <bebarino@gmail.com>\n>> ---\n>>  git-sh-setup.sh |    7 +++++++\n>>  1 files changed, 7 insertions(+), 0 deletions(-)\n>>\n>> diff --git a/git-sh-setup.sh b/git-sh-setup.sh\n>> index 80acb7d..f88184e 100755\n>> --- a/git-sh-setup.sh\n>> +++ b/git-sh-setup.sh\n>> @@ -44,6 +44,13 @@ die() {\n>>        exit 1\n>>  }\n>>\n>> +say () {\n>> +       if test -z \"$GIT_QUIET\"\n>> +       then\n>> +               echo \"$@\"\n>\n> Except that where you've then replaced various calls with say() they\n> were originally using printf.\n\nThe only difference I found in these three patch series is this hunk  on\ngit-am.sh in [PATCHv2 3/3]:\n\n    @@ -498,7 +505,7 @@ do\n                    stop_here $this\n            fi\n\n    -       printf 'Applying: %s\\n' \"$FIRSTLINE\"\n    +       say \"Applying: $FIRSTLINE\"\n\n            case \"$resolved\" in\n            '')\n\nThis was made from echo to printf with 4b7cc26 (git-am: use printf instead\nof echo on user-supplied strings, 2007-05-25), with reason:\n\n    Under some implementations of echo (such as that provided by\n    dash), backslash escapes are recognized without any other\n    options. This means that echo-ing user-supplied strings may\n    cause any backslash sequences in them to be converted. Using\n    printf resolves the ambiguity.\n    \n    This bug can be seen when using git-am to apply a patch\n    whose subject contains the character sequence \"\\n\"; the\n    characters are converted to a literal newline. Noticed by\n    Szekeres Istvan.\n\nTo make the conversion of the above hunk correct, say() must use\n\n\tprintf \"%s\" \"$*\"\n\nNeedless to say, all the conversions from \"echo\" to \"say\" in the patch\nseries need to be verified.\n"},{"id":"116314","messageId":"780e0a6b0906142315t74e64831k59e58bbc964c81f9@mail.gmail.com","threadId":"19805","inReplyTo":"7vab4ap1lf.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCHv2 1/3] git-sh-setup: introduce say() for quiet options","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-06-15T06:15:05Z","receivedAt":"2009-06-15T06:15:05Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On Sun, Jun 14, 2009 at 9:23 PM, Junio C Hamano<gitster@pobox.com> wrote:\n>\n> To make the conversion of the above hunk correct, say() must use\n>\n>        printf \"%s\" \"$*\"\n\nThanks for the background information. This hunk was in the original\nseries but I guess nobody noticed. I'll fixup these issues in the next\nround and maybe add a test for this case.\n"},{"id":"116315","messageId":"4A35E970.8080406@viscovery.net","threadId":"19805","inReplyTo":"1245021374-8430-2-git-send-email-bebarino@gmail.com","subject":"Re: [PATCHv2 1/3] git-sh-setup: introduce say() for quiet options","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-06-15T06:25:52Z","receivedAt":"2009-06-15T06:25:52Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Stephen Boyd schrieb:\n> diff --git a/git-sh-setup.sh b/git-sh-setup.sh\n> index 80acb7d..f88184e 100755\n> --- a/git-sh-setup.sh\n> +++ b/git-sh-setup.sh\n> @@ -44,6 +44,13 @@ die() {\n>  \texit 1\n>  }\n>  \n> +say () {\n> +\tif test -z \"$GIT_QUIET\"\n> +\tthen\n> +\t\techo \"$@\"\n> +\tfi\n> +}\n\nIs it intended that this obeys any GIT_QUIET that appears in the\nenvironment? If not, then you should add\n\nGIT_QUIET=\n\nhere to override the environment.\n\n-- Hannes\n"},{"id":"116317","messageId":"780e0a6b0906142333q72d2cdefh9db60ffdb0babc25@mail.gmail.com","threadId":"19805","inReplyTo":"4A35E970.8080406@viscovery.net","subject":"Re: [PATCHv2 1/3] git-sh-setup: introduce say() for quiet options","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-06-15T06:33:46Z","receivedAt":"2009-06-15T06:33:46Z","isPatch":false,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"On Sun, Jun 14, 2009 at 11:25 PM, Johannes Sixt<j.sixt@viscovery.net> wrote:\n>\n> Is it intended that this obeys any GIT_QUIET that appears in the\n> environment?\n\nI wasn't sure, therefore I left it up to interpretation. It's probably\nbetter to just override the environment though.\n\nThanks.\n"}]}