{"thread":{"id":"18081","subject":"[PATCH 0/2] git-pull: Allow --stat and --no-stat to be used with --rebase","startedAt":"2009-03-01T21:28:26Z","lastAt":"2009-03-01T22:11:38Z","messageCount":5,"participants":["Tor Arne Vestbø","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"106637","messageId":"1235942908-5419-1-git-send-email-torarnv@gmail.com","threadId":"18081","inReplyTo":null,"subject":"[PATCH 0/2] git-pull: Allow --stat and --no-stat to be used with --rebase","fromName":"Tor Arne Vestbø","fromEmail":"torarnv@gmail.com","sentAt":"2009-03-01T21:28:26Z","receivedAt":"2009-03-01T21:28:26Z","isPatch":true,"sender":{"key":"torarnv@gmail.com","avatar":"https://gravatar.com/avatar/847af0150a5a28ad86d9db1556a48aba04e7642c6a29a5a767f8c2bdf1720321?d=mp&s=160"},"body":"These two small patches teach git-rebase to understand --stat, and git-pull\nto forward --stat to git-rebase when used with --rebase. Comments welcome!\n\nTor Arne VestbÃ¸ (2):\n  git-rebase: Add --stat and --no-stat for producing diffstat on rebase\n  git-pull: Allow --stat and --no-stat to be used with --rebase\n\n Documentation/git-rebase.txt |   17 ++++++++++++++++-\n git-pull.sh                  |   10 +++++-----\n git-rebase.sh                |   25 ++++++++++++++++++-------\n t/t3406-rebase-message.sh    |   23 ++++++++++++++++++++++-\n 4 files changed, 61 insertions(+), 14 deletions(-)\n"},{"id":"106639","messageId":"1235942908-5419-2-git-send-email-torarnv@gmail.com","threadId":"18081","inReplyTo":"1235942908-5419-1-git-send-email-torarnv@gmail.com","subject":"[PATCH 1/2] git-rebase: Add --stat and --no-stat for producing diffstat on rebase","fromName":"Tor Arne Vestbø","fromEmail":"torarnv@gmail.com","sentAt":"2009-03-01T21:28:27Z","receivedAt":"2009-03-01T21:28:27Z","isPatch":true,"sender":{"key":"torarnv@gmail.com","avatar":"https://gravatar.com/avatar/847af0150a5a28ad86d9db1556a48aba04e7642c6a29a5a767f8c2bdf1720321?d=mp&s=160"},"body":"The behavior of --verbose is unchanged, but uses a different state\nvariable internally, so that the meaning of verbose output may be\nexpanded without affecting the diffstat. This is also reflected in\nthe documentation.\n\nThe configuration option rebase.stat works the same was as merg.stat,\nbut the default is currently false.\n\nSigned-off-by: Tor Arne Vestbø <torarnv@gmail.com>\n---\n Documentation/git-rebase.txt |   17 ++++++++++++++++-\n git-rebase.sh                |   25 ++++++++++++++++++-------\n t/t3406-rebase-message.sh    |   23 ++++++++++++++++++++++-\n 3 files changed, 56 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex da3c38c..57bd333 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -192,6 +192,13 @@ Alternatively, you can undo the 'git-rebase' with\n \n     git rebase --abort\n \n+CONFIGURATION\n+-------------\n+\n+rebase.stat::\n+\tWhether to show a diffstat of what changed upstream since the last\n+\trebase. False by default.\n+\n OPTIONS\n -------\n <newbase>::\n@@ -232,7 +239,15 @@ OPTIONS\n \n -v::\n --verbose::\n-\tDisplay a diffstat of what changed upstream since the last rebase.\n+\tBe verbose. Implies --stat.\n+\n+--stat::\n+\tShow a diffstat of what changed upstream since the last rebase. The\n+\tdiffstat is also controlled by the configuration option rebase.stat.\n+\n+-n::\n+--no-stat::\n+\tDo not show a diffstat as part of the rebase process.\n \n --no-verify::\n \tThis option bypasses the pre-rebase hook.  See also linkgit:githooks[5].\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 368c0ef..26d7566 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -46,6 +46,7 @@ do_merge=\n dotest=\"$GIT_DIR\"/rebase-merge\n prec=4\n verbose=\n+diffstat=$(git config --bool rebase.stat)\n git_am_opt=\n rebase_root=\n \n@@ -289,8 +290,15 @@ do\n \t\tesac\n \t\tdo_merge=t\n \t\t;;\n+\t-n|--no-stat)\n+\t\tdiffstat=\n+\t\t;;\n+\t--stat)\n+\t\tdiffstat=t\n+\t\t;;\n \t-v|--verbose)\n \t\tverbose=t\n+\t\tdiffstat=t\n \t\t;;\n \t--whitespace=*)\n \t\tgit_am_opt=\"$git_am_opt $1\"\n@@ -426,18 +434,21 @@ then\n \texit 0\n fi\n \n-if test -n \"$verbose\"\n-then\n-\techo \"Changes from $mb to $onto:\"\n-\t# We want color (if set), but no pager\n-\tGIT_PAGER='' git diff --stat --summary \"$mb\" \"$onto\"\n-fi\n-\n # Detach HEAD and reset the tree\n echo \"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+if test -n \"$diffstat\"\n+then\n+\tif test -n \"$verbose\"\n+\tthen\n+\t\techo \"Changes from $mb to $onto:\"\n+\tfi\n+\t# We want color (if set), but no pager\n+\tGIT_PAGER='' git diff --stat --summary \"$mb\" \"$onto\"\n+fi\n+\n # If the $onto is a proper descendant of the tip of the branch, then\n # we just fast forwarded.\n if test \"$mb\" = \"$branch\"\ndiff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh\nindex 5391080..85fc7c4 100755\n--- a/t/t3406-rebase-message.sh\n+++ b/t/t3406-rebase-message.sh\n@@ -22,7 +22,8 @@ test_expect_success setup '\n \tgit checkout topic &&\n \tquick_one A &&\n \tquick_one B &&\n-\tquick_one Z\n+\tquick_one Z &&\n+\tgit tag start\n \n '\n \n@@ -41,4 +42,24 @@ test_expect_success 'rebase -m' '\n \n '\n \n+test_expect_success 'rebase --stat' '\n+        git reset --hard start\n+        git rebase --stat master >diffstat.txt &&\n+        grep \"^ fileX |  *1 +$\" diffstat.txt\n+'\n+\n+test_expect_success 'rebase w/config rebase.stat' '\n+        git reset --hard start\n+        git config rebase.stat true &&\n+        git rebase master >diffstat.txt &&\n+        grep \"^ fileX |  *1 +$\" diffstat.txt\n+'\n+\n+test_expect_success 'rebase -n overrides config rebase.stat config' '\n+        git reset --hard start\n+        git config rebase.stat true &&\n+        git rebase -n master >diffstat.txt &&\n+        ! grep \"^ fileX |  *1 +$\" diffstat.txt\n+'\n+\n test_done\n-- \n1.6.2.rc2.11.g80931\n"},{"id":"106638","messageId":"1235942908-5419-3-git-send-email-torarnv@gmail.com","threadId":"18081","inReplyTo":"1235942908-5419-2-git-send-email-torarnv@gmail.com","subject":"[PATCH 2/2] git-pull: Allow --stat and --no-stat to be used with --rebase","fromName":"Tor Arne Vestbø","fromEmail":"torarnv@gmail.com","sentAt":"2009-03-01T21:28:28Z","receivedAt":"2009-03-01T21:28:28Z","isPatch":true,"sender":{"key":"torarnv@gmail.com","avatar":"https://gravatar.com/avatar/847af0150a5a28ad86d9db1556a48aba04e7642c6a29a5a767f8c2bdf1720321?d=mp&s=160"},"body":"Forwards the --stat, --no-stat, and --summary options on to git-rebase.\n\nSigned-off-by: Tor Arne Vestbø <torarnv@gmail.com>\n---\n git-pull.sh |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/git-pull.sh b/git-pull.sh\nindex 25adddf..8a26763 100755\n--- a/git-pull.sh\n+++ b/git-pull.sh\n@@ -16,7 +16,7 @@ cd_to_toplevel\n test -z \"$(git ls-files -u)\" ||\n \tdie \"You are in the middle of a conflicted merge.\"\n \n-strategy_args= no_stat= no_commit= squash= no_ff= log_arg= verbosity=\n+strategy_args= diffstat= no_commit= squash= no_ff= log_arg= verbosity=\n curr_branch=$(git symbolic-ref -q HEAD)\n curr_branch_short=$(echo \"$curr_branch\" | sed \"s|refs/heads/||\")\n rebase=$(git config --bool branch.$curr_branch_short.rebase)\n@@ -28,9 +28,9 @@ do\n \t-v|--verbose)\n \t\tverbosity=\"$verbosity -v\" ;;\n \t-n|--no-stat|--no-summary)\n-\t\tno_stat=-n ;;\n+\t\tdiffstat=--no-stat ;;\n \t--stat|--summary)\n-\t\tno_stat=$1 ;;\n+\t\tdiffstat=--stat ;;\n \t--log|--no-log)\n \t\tlog_arg=$1 ;;\n \t--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)\n@@ -188,7 +188,7 @@ fi\n \n merge_name=$(git fmt-merge-msg $log_arg <\"$GIT_DIR/FETCH_HEAD\") || exit\n test true = \"$rebase\" &&\n-\texec git-rebase $strategy_args --onto $merge_head \\\n+\texec git-rebase $diffstat $strategy_args --onto $merge_head \\\n \t${oldremoteref:-$merge_head}\n-exec git-merge $no_stat $no_commit $squash $no_ff $log_arg $strategy_args \\\n+exec git-merge $diffstat $no_commit $squash $no_ff $log_arg $strategy_args \\\n \t\"$merge_name\" HEAD $merge_head $verbosity\n-- \n1.6.2.rc2.11.g80931\n"},{"id":"106645","messageId":"m3zlg4ud9v.fsf@localhost.localdomain","threadId":"18081","inReplyTo":"1235942908-5419-2-git-send-email-torarnv@gmail.com","subject":"Re: [PATCH 1/2] git-rebase: Add --stat and --no-stat for producing diffstat on rebase","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-03-01T21:47:06Z","receivedAt":"2009-03-01T21:47:06Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Tor Arne Vestbø <torarnv@gmail.com> writes:\n\n> The behavior of --verbose is unchanged, but uses a different state\n> variable internally, so that the meaning of verbose output may be\n> expanded without affecting the diffstat. This is also reflected in\n> the documentation.\n> \n> The configuration option rebase.stat works the same was as merg.stat,\n> but the default is currently false.\n> \n> Signed-off-by: Tor Arne Vestbø <torarnv@gmail.com>\n> ---\n>  Documentation/git-rebase.txt |   17 ++++++++++++++++-\n>  git-rebase.sh                |   25 ++++++++++++++++++-------\n>  t/t3406-rebase-message.sh    |   23 ++++++++++++++++++++++-\n>  3 files changed, 56 insertions(+), 9 deletions(-)\n> \n\nYou have to update also Documentation/config.txt\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"106651","messageId":"1235945498-12631-1-git-send-email-torarnv@gmail.com","threadId":"18081","inReplyTo":"m3zlg4ud9v.fsf@localhost.localdomain","subject":"[PATCH v2] git-rebase: Add --stat and --no-stat for producing diffstat on rebase","fromName":"Tor Arne Vestbø","fromEmail":"torarnv@gmail.com","sentAt":"2009-03-01T22:11:38Z","receivedAt":"2009-03-01T22:11:38Z","isPatch":true,"sender":{"key":"torarnv@gmail.com","avatar":"https://gravatar.com/avatar/847af0150a5a28ad86d9db1556a48aba04e7642c6a29a5a767f8c2bdf1720321?d=mp&s=160"},"body":"The behavior of --verbose is unchanged, but uses a different state\nvariable internally, so that the meaning of verbose output may be\nexpanded without affecting the diffstat. This is also reflected in\nthe documentation.\n\nThe configuration option rebase.stat works the same was as merg.stat,\nbut the default is currently false.\n\nSigned-off-by: Tor Arne Vestbø <torarnv@gmail.com>\n---\n\nThanks Jakub, I knew there was a reason that git-config.txt was so empty ;)\n\nAnd sorry for the double post, --cc to git-send-email seems to override\nwhat's in the config, not compliment it.\n\n Documentation/config.txt     |    4 ++++\n Documentation/git-rebase.txt |   17 ++++++++++++++++-\n git-rebase.sh                |   25 ++++++++++++++++++-------\n t/t3406-rebase-message.sh    |   23 ++++++++++++++++++++++-\n 4 files changed, 60 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex f5152c5..6be2e99 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1160,6 +1160,10 @@ pull.octopus::\n pull.twohead::\n \tThe default merge strategy to use when pulling a single branch.\n \n+rebase.stat::\n+\tWhether to show a diffstat of what changed upstream since the last\n+\trebase. False by default.\n+\n receive.fsckObjects::\n \tIf it is set to true, git-receive-pack will check all received\n \tobjects. It will abort in the case of a malformed object or a\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex da3c38c..57bd333 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -192,6 +192,13 @@ Alternatively, you can undo the 'git-rebase' with\n \n     git rebase --abort\n \n+CONFIGURATION\n+-------------\n+\n+rebase.stat::\n+\tWhether to show a diffstat of what changed upstream since the last\n+\trebase. False by default.\n+\n OPTIONS\n -------\n <newbase>::\n@@ -232,7 +239,15 @@ OPTIONS\n \n -v::\n --verbose::\n-\tDisplay a diffstat of what changed upstream since the last rebase.\n+\tBe verbose. Implies --stat.\n+\n+--stat::\n+\tShow a diffstat of what changed upstream since the last rebase. The\n+\tdiffstat is also controlled by the configuration option rebase.stat.\n+\n+-n::\n+--no-stat::\n+\tDo not show a diffstat as part of the rebase process.\n \n --no-verify::\n \tThis option bypasses the pre-rebase hook.  See also linkgit:githooks[5].\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 368c0ef..26d7566 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -46,6 +46,7 @@ do_merge=\n dotest=\"$GIT_DIR\"/rebase-merge\n prec=4\n verbose=\n+diffstat=$(git config --bool rebase.stat)\n git_am_opt=\n rebase_root=\n \n@@ -289,8 +290,15 @@ do\n \t\tesac\n \t\tdo_merge=t\n \t\t;;\n+\t-n|--no-stat)\n+\t\tdiffstat=\n+\t\t;;\n+\t--stat)\n+\t\tdiffstat=t\n+\t\t;;\n \t-v|--verbose)\n \t\tverbose=t\n+\t\tdiffstat=t\n \t\t;;\n \t--whitespace=*)\n \t\tgit_am_opt=\"$git_am_opt $1\"\n@@ -426,18 +434,21 @@ then\n \texit 0\n fi\n \n-if test -n \"$verbose\"\n-then\n-\techo \"Changes from $mb to $onto:\"\n-\t# We want color (if set), but no pager\n-\tGIT_PAGER='' git diff --stat --summary \"$mb\" \"$onto\"\n-fi\n-\n # Detach HEAD and reset the tree\n echo \"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+if test -n \"$diffstat\"\n+then\n+\tif test -n \"$verbose\"\n+\tthen\n+\t\techo \"Changes from $mb to $onto:\"\n+\tfi\n+\t# We want color (if set), but no pager\n+\tGIT_PAGER='' git diff --stat --summary \"$mb\" \"$onto\"\n+fi\n+\n # If the $onto is a proper descendant of the tip of the branch, then\n # we just fast forwarded.\n if test \"$mb\" = \"$branch\"\ndiff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh\nindex 5391080..85fc7c4 100755\n--- a/t/t3406-rebase-message.sh\n+++ b/t/t3406-rebase-message.sh\n@@ -22,7 +22,8 @@ test_expect_success setup '\n \tgit checkout topic &&\n \tquick_one A &&\n \tquick_one B &&\n-\tquick_one Z\n+\tquick_one Z &&\n+\tgit tag start\n \n '\n \n@@ -41,4 +42,24 @@ test_expect_success 'rebase -m' '\n \n '\n \n+test_expect_success 'rebase --stat' '\n+        git reset --hard start\n+        git rebase --stat master >diffstat.txt &&\n+        grep \"^ fileX |  *1 +$\" diffstat.txt\n+'\n+\n+test_expect_success 'rebase w/config rebase.stat' '\n+        git reset --hard start\n+        git config rebase.stat true &&\n+        git rebase master >diffstat.txt &&\n+        grep \"^ fileX |  *1 +$\" diffstat.txt\n+'\n+\n+test_expect_success 'rebase -n overrides config rebase.stat config' '\n+        git reset --hard start\n+        git config rebase.stat true &&\n+        git rebase -n master >diffstat.txt &&\n+        ! grep \"^ fileX |  *1 +$\" diffstat.txt\n+'\n+\n test_done\n-- \n1.6.2.rc2.11.g80931\n"}]}