{"thread":{"id":"39169","subject":"git-rebase doesn't forward --quiet to git-checkout","startedAt":"2015-04-27T19:05:41Z","lastAt":"2015-04-28T05:17:37Z","messageCount":2,"participants":["Sam Cates","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"260074","messageId":"CAFGg4-hsRY9S4ok0-KSUWN7AWS=Eptk4E5B-LZcPFPsKrOP-_A@mail.gmail.com","threadId":"39169","inReplyTo":null,"subject":"git-rebase doesn't forward --quiet to git-checkout","fromName":"Sam Cates","fromEmail":"sam@samcates.com","sentAt":"2015-04-27T19:05:41Z","receivedAt":"2015-04-27T19:05:41Z","isPatch":false,"sender":{"key":"sam@samcates.com","avatar":null},"body":"STEPS TO REPRODUCE:\n1. git checkout master\n2. git rebase --quiet master topic\n\nEXPECTED RESULTS:\nThe checkout and rebase occur with no output.\n\nACTUAL RESULTS:\nThe output from the checkout is not suppressed.\n\nThanks,\nSam\n"},{"id":"260096","messageId":"20150428051737.GE24580@peff.net","threadId":"39169","inReplyTo":"CAFGg4-hsRY9S4ok0-KSUWN7AWS=Eptk4E5B-LZcPFPsKrOP-_A@mail.gmail.com","subject":"[PATCH] rebase: silence \"git checkout\" for noop rebase","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-04-28T05:17:37Z","receivedAt":"2015-04-28T05:17:37Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Apr 27, 2015 at 12:05:41PM -0700, Sam Cates wrote:\n\n> STEPS TO REPRODUCE:\n> 1. git checkout master\n> 2. git rebase --quiet master topic\n> \n> EXPECTED RESULTS:\n> The checkout and rebase occur with no output.\n> \n> ACTUAL RESULTS:\n> The output from the checkout is not suppressed.\n\nCan you be more specific about your setup? What is the relationship\nbetween \"master\" and \"topic\"?\n\nIf \"topic\" is already up to date with master, I get:\n\n  $ git rebase --quiet master topic\n  Switched to branch 'topic'\n\n(the --quiet does suppress \"Current branch topic is up to date\").  The\npatch below addresses that. But there may be other calls to git-checkout\nthat would need similar treatment (either unconditional \"-q\" as below,\nor respecting $GIT_QUIET, depending on the individual case).\n\n-- >8 --\nSubject: rebase: silence \"git checkout\" for noop rebase\n\nWhen the branch to be rebased is already up to date, we\n\"git checkout\" the branch, print an \"up to date\" message,\nand end the rebase early. However, our checkout may print\n\"Switched to branch 'foo'\" or \"Already on 'foo'\", even if\nthe user has asked for \"--quiet\".\n\nWe should avoid printing these messages at all, \"--quiet\" or\nno. Since the rebase is a noop, this checkout can be seen as\noptimizing out these other two checkout operations (that\nhappen in a real rebase):\n\n  1. Moving to the detached HEAD to start the rebase; we\n     always feed \"-q\" to checkout there, and instead rely on\n     our own custom message (which respects --quiet).\n\n  2. Finishing a rebase, where we move to the final branch.\n     Here we actually use update-ref rather than\n     git-checkout, and produce no messages.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\n git-rebase.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 55da9db..90854e3 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -582,7 +582,7 @@ then\n \t\t# Lazily switch to the target branch if needed...\n \t\ttest -z \"$switch_to\" ||\n \t\tGIT_REFLOG_ACTION=\"$GIT_REFLOG_ACTION: checkout $switch_to\" \\\n-\t\t\tgit checkout \"$switch_to\" --\n+\t\t\tgit checkout -q \"$switch_to\" --\n \t\tsay \"$(eval_gettext \"Current branch \\$branch_name is up to date.\")\"\n \t\tfinish_rebase\n \t\texit 0\n-- \n2.4.0.rc3.477.gc25258d\n"}]}