{"thread":{"id":"24347","subject":"[PATCH] add configuration variable for --autosquash option of interactive rebase","startedAt":"2010-07-09T12:47:08Z","lastAt":"2010-07-14T11:59:57Z","messageCount":11,"participants":["Heiko Voigt","Andreas Schwab","Junio C Hamano","Santi Béjar","Stephen Boyd"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"145209","messageId":"20100709124659.GA17559@book.hvoigt.net","threadId":"24347","inReplyTo":null,"subject":"[PATCH] add configuration variable for --autosquash option of interactive rebase","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2010-07-09T12:47:08Z","receivedAt":"2010-07-09T12:47:08Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"If you use this feature regularly you can now enable it by default.\n\nSigned-off-by: Heiko Voigt <hvoigt@hvoigt.net>\n---\n Documentation/git-rebase.txt |    3 +++\n git-rebase--interactive.sh   |    1 +\n t/t3415-rebase-autosquash.sh |   38 ++++++++++++++++++++++++++++++--------\n 3 files changed, 34 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex be23ad2..8849758 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -199,6 +199,9 @@ rebase.stat::\n \tWhether to show a diffstat of what changed upstream since the last\n \trebase. False by default.\n \n+rebase.autosquash::\n+\tIf set to true enable --autosquash option by default.\n+\n OPTIONS\n -------\n <newbase>::\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 6b86abc..54dc983 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -111,6 +111,7 @@ VERBOSE=\n OK_TO_SKIP_PRE_REBASE=\n REBASE_ROOT=\n AUTOSQUASH=\n+test \"$(git config --bool rebase.autosquash)\" == \"true\" && AUTOSQUASH=t\n NEVER_FF=\n \n GIT_CHERRY_PICK_HELP=\"  After resolving the conflicts,\ndiff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh\nindex b63f4e2..ccc5e44 100755\n--- a/t/t3415-rebase-autosquash.sh\n+++ b/t/t3415-rebase-autosquash.sh\n@@ -21,38 +21,60 @@ test_expect_success setup '\n \tgit tag base\n '\n \n-test_expect_success 'auto fixup' '\n+test_auto_fixup() {\n \tgit reset --hard base &&\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n \tgit commit -m \"fixup! first\"\n \n-\tgit tag final-fixup &&\n+\tgit tag $1 &&\n \ttest_tick &&\n-\tgit rebase --autosquash -i HEAD^^^ &&\n+\tgit rebase $2 -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n \ttest 3 = $(wc -l <actual) &&\n-\tgit diff --exit-code final-fixup &&\n+\tgit diff --exit-code $1 &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 1 = $(git cat-file commit HEAD^ | grep first | wc -l)\n+}\n+\n+test_expect_success 'auto fixup (option)' '\n+\ttest_auto_fixup final-fixup-option --autosquash\n+'\n+\n+test_expect_success 'auto fixup (config)' '\n+\tgit config rebase.autosquash true &&\n+\ttest_auto_fixup final-fixup-config-true\n+\tgit config rebase.autosquash false &&\n+\ttest_must_fail test_auto_fixup final-fixup-config-false\n '\n \n-test_expect_success 'auto squash' '\n+test_auto_squash() {\n \tgit reset --hard base &&\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n \tgit commit -m \"squash! first\"\n \n-\tgit tag final-squash &&\n+\tgit tag $1 &&\n \ttest_tick &&\n-\tgit rebase --autosquash -i HEAD^^^ &&\n+\tgit rebase $2 -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n \ttest 3 = $(wc -l <actual) &&\n-\tgit diff --exit-code final-squash &&\n+\tgit diff --exit-code $1 &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 2 = $(git cat-file commit HEAD^ | grep first | wc -l)\n+}\n+\n+test_expect_success 'auto squash (option)' '\n+\ttest_auto_squash final-squash --autosquash\n+'\n+\n+test_expect_success 'auto squash (config)' '\n+\tgit config rebase.autosquash true &&\n+\ttest_auto_squash final-squash-config-true\n+\tgit config rebase.autosquash false &&\n+\ttest_must_fail test_auto_squash final-squash-config-false\n '\n \n test_expect_success 'misspelled auto squash' '\n-- \n1.7.2.rc2.1.geb6d9\n"},{"id":"145233","messageId":"m27hl4zg99.fsf@igel.home","threadId":"24347","inReplyTo":"20100709124659.GA17559@book.hvoigt.net","subject":"Re: [PATCH] add configuration variable for --autosquash option of interactive rebase","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2010-07-09T18:01:22Z","receivedAt":"2010-07-09T18:01:22Z","isPatch":true,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Heiko Voigt <hvoigt@hvoigt.net> writes:\n\n> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\n> index 6b86abc..54dc983 100755\n> --- a/git-rebase--interactive.sh\n> +++ b/git-rebase--interactive.sh\n> @@ -111,6 +111,7 @@ VERBOSE=\n>  OK_TO_SKIP_PRE_REBASE=\n>  REBASE_ROOT=\n>  AUTOSQUASH=\n> +test \"$(git config --bool rebase.autosquash)\" == \"true\" && AUTOSQUASH=t\n\nThat should be '=' instead of '==' (which is non-std).\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"145268","messageId":"20100710091517.GA27323@book.hvoigt.net","threadId":"24347","inReplyTo":"m27hl4zg99.fsf@igel.home","subject":"[PATCH v2] add configuration variable for --autosquash option of interactive rebase","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2010-07-10T09:15:29Z","receivedAt":"2010-07-10T09:15:29Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"If you use this feature regularly you can now enable it by default.\n\nSigned-off-by: Heiko Voigt <hvoigt@hvoigt.net>\n---\n\nOn Fri, Jul 09, 2010 at 08:01:22PM +0200, Andreas Schwab wrote:\n> Heiko Voigt <hvoigt@hvoigt.net> writes:\n> \n> > diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\n> > index 6b86abc..54dc983 100755\n> > --- a/git-rebase--interactive.sh\n> > +++ b/git-rebase--interactive.sh\n> > @@ -111,6 +111,7 @@ VERBOSE=\n> >  OK_TO_SKIP_PRE_REBASE=\n> >  REBASE_ROOT=\n> >  AUTOSQUASH=\n> > +test \"$(git config --bool rebase.autosquash)\" == \"true\" && AUTOSQUASH=t\n> \n> That should be '=' instead of '==' (which is non-std).\n\nTrue, too much C these days.\n\n\n Documentation/git-rebase.txt |    3 +++\n git-rebase--interactive.sh   |    1 +\n t/t3415-rebase-autosquash.sh |   38 ++++++++++++++++++++++++++++++--------\n 3 files changed, 34 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex be23ad2..8849758 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -199,6 +199,9 @@ rebase.stat::\n \tWhether to show a diffstat of what changed upstream since the last\n \trebase. False by default.\n \n+rebase.autosquash::\n+\tIf set to true enable --autosquash option by default.\n+\n OPTIONS\n -------\n <newbase>::\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 6b86abc..6e181f4 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -111,6 +111,7 @@ VERBOSE=\n OK_TO_SKIP_PRE_REBASE=\n REBASE_ROOT=\n AUTOSQUASH=\n+test \"$(git config --bool rebase.autosquash)\" = \"true\" && AUTOSQUASH=t\n NEVER_FF=\n \n GIT_CHERRY_PICK_HELP=\"  After resolving the conflicts,\ndiff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh\nindex b63f4e2..ccc5e44 100755\n--- a/t/t3415-rebase-autosquash.sh\n+++ b/t/t3415-rebase-autosquash.sh\n@@ -21,38 +21,60 @@ test_expect_success setup '\n \tgit tag base\n '\n \n-test_expect_success 'auto fixup' '\n+test_auto_fixup() {\n \tgit reset --hard base &&\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n \tgit commit -m \"fixup! first\"\n \n-\tgit tag final-fixup &&\n+\tgit tag $1 &&\n \ttest_tick &&\n-\tgit rebase --autosquash -i HEAD^^^ &&\n+\tgit rebase $2 -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n \ttest 3 = $(wc -l <actual) &&\n-\tgit diff --exit-code final-fixup &&\n+\tgit diff --exit-code $1 &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 1 = $(git cat-file commit HEAD^ | grep first | wc -l)\n+}\n+\n+test_expect_success 'auto fixup (option)' '\n+\ttest_auto_fixup final-fixup-option --autosquash\n+'\n+\n+test_expect_success 'auto fixup (config)' '\n+\tgit config rebase.autosquash true &&\n+\ttest_auto_fixup final-fixup-config-true\n+\tgit config rebase.autosquash false &&\n+\ttest_must_fail test_auto_fixup final-fixup-config-false\n '\n \n-test_expect_success 'auto squash' '\n+test_auto_squash() {\n \tgit reset --hard base &&\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n \tgit commit -m \"squash! first\"\n \n-\tgit tag final-squash &&\n+\tgit tag $1 &&\n \ttest_tick &&\n-\tgit rebase --autosquash -i HEAD^^^ &&\n+\tgit rebase $2 -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n \ttest 3 = $(wc -l <actual) &&\n-\tgit diff --exit-code final-squash &&\n+\tgit diff --exit-code $1 &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 2 = $(git cat-file commit HEAD^ | grep first | wc -l)\n+}\n+\n+test_expect_success 'auto squash (option)' '\n+\ttest_auto_squash final-squash --autosquash\n+'\n+\n+test_expect_success 'auto squash (config)' '\n+\tgit config rebase.autosquash true &&\n+\ttest_auto_squash final-squash-config-true\n+\tgit config rebase.autosquash false &&\n+\ttest_must_fail test_auto_squash final-squash-config-false\n '\n \n test_expect_success 'misspelled auto squash' '\n-- \n1.7.2.rc2.1.geb6d9.dirty\n"},{"id":"145343","messageId":"7vk4p1fdlg.fsf@alter.siamese.dyndns.org","threadId":"24347","inReplyTo":"20100710091517.GA27323@book.hvoigt.net","subject":"Re: [PATCH v2] add configuration variable for --autosquash option of interactive rebase","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-12T05:55:55Z","receivedAt":"2010-07-12T05:55:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Heiko Voigt <hvoigt@hvoigt.net> writes:\n\n> If you use this feature regularly you can now enable it by default.\n\nAnd if you use this often _but_ you sometimes need to countermand from the\ncommand line, do you provide a way to do so (I didn't bother to check).\n"},{"id":"145445","messageId":"20100713112316.GA758@book.hvoigt.net","threadId":"24347","inReplyTo":"7vk4p1fdlg.fsf@alter.siamese.dyndns.org","subject":"[PATCH v3] add configuration variable for --autosquash option of interactive rebase","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2010-07-13T11:24:40Z","receivedAt":"2010-07-13T11:24:40Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"If you use this feature regularly you can now enable it by default. In\ncase the user wants to override this config on the commandline\n--no-autosquash can be used to force disabling.\n\nSigned-off-by: Heiko Voigt <hvoigt@hvoigt.net>\n---\nOn Sun, Jul 11, 2010 at 10:55:55PM -0700, Junio C Hamano wrote:\n> Heiko Voigt <hvoigt@hvoigt.net> writes:\n> \n> > If you use this feature regularly you can now enable it by default.\n> \n> And if you use this often _but_ you sometimes need to countermand from the\n> command line, do you provide a way to do so (I didn't bother to check).\n\nNo I did not see the exact use case because you could simply not prefix\nyou commits with 'fixup!' or 'squash!' and if your project regularly\nuses those on commits you probably would like to configure different\nprefixes.\n\nOn the other hand I think it is a good convention to always provide a\n--no-... option for things you can enable in the config and it does not\nhurt to do so. So here is a new patch implementing this. I also fixed\nsome places with missing && in the testcases I implemented.\n\ncheers Heiko\n\n Documentation/git-rebase.txt |    8 ++++++++\n git-rebase--interactive.sh   |    4 ++++\n t/t3415-rebase-autosquash.sh |   40 ++++++++++++++++++++++++++++++++--------\n 3 files changed, 44 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex be23ad2..d357ab1 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -199,6 +199,9 @@ rebase.stat::\n \tWhether to show a diffstat of what changed upstream since the last\n \trebase. False by default.\n \n+rebase.autosquash::\n+\tIf set to true enable '--autosquash' option by default.\n+\n OPTIONS\n -------\n <newbase>::\n@@ -335,6 +338,11 @@ idea unless you know what you are doing (see BUGS below).\n +\n This option is only valid when the '--interactive' option is used.\n \n+--no-autosquash::\n+\tIf the '--autosquash' option is enabled by default using the\n+\tconfiguration variable `rebase.autosquash` this option can be\n+\tused to override and disable this setting.\n+\n --no-ff::\n \tWith --interactive, cherry-pick all rebased commits instead of\n \tfast-forwarding over the unchanged ones.  This ensures that the\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 6b86abc..7b35f80 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -111,6 +111,7 @@ VERBOSE=\n OK_TO_SKIP_PRE_REBASE=\n REBASE_ROOT=\n AUTOSQUASH=\n+test \"$(git config --bool rebase.autosquash)\" = \"true\" && AUTOSQUASH=t\n NEVER_FF=\n \n GIT_CHERRY_PICK_HELP=\"  After resolving the conflicts,\n@@ -795,6 +796,9 @@ first and then run 'git rebase --continue' again.\"\n \t--autosquash)\n \t\tAUTOSQUASH=t\n \t\t;;\n+\t--no-autosquash)\n+\t\tAUTOSQUASH=\n+\t\t;;\n \t--onto)\n \t\tshift\n \t\tONTO=$(parse_onto \"$1\") ||\ndiff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh\nindex b63f4e2..37cb89a 100755\n--- a/t/t3415-rebase-autosquash.sh\n+++ b/t/t3415-rebase-autosquash.sh\n@@ -21,38 +21,62 @@ test_expect_success setup '\n \tgit tag base\n '\n \n-test_expect_success 'auto fixup' '\n+test_auto_fixup() {\n \tgit reset --hard base &&\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n \tgit commit -m \"fixup! first\"\n \n-\tgit tag final-fixup &&\n+\tgit tag $1 &&\n \ttest_tick &&\n-\tgit rebase --autosquash -i HEAD^^^ &&\n+\tgit rebase $2 -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n \ttest 3 = $(wc -l <actual) &&\n-\tgit diff --exit-code final-fixup &&\n+\tgit diff --exit-code $1 &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 1 = $(git cat-file commit HEAD^ | grep first | wc -l)\n+}\n+\n+test_expect_success 'auto fixup (option)' '\n+\ttest_auto_fixup final-fixup-option --autosquash\n+'\n+\n+test_expect_success 'auto fixup (config)' '\n+\tgit config rebase.autosquash true &&\n+\ttest_auto_fixup final-fixup-config-true &&\n+\ttest_must_fail test_auto_fixup fixup-config-true-no --no-autosquash &&\n+\tgit config rebase.autosquash false &&\n+\ttest_must_fail test_auto_fixup final-fixup-config-false\n '\n \n-test_expect_success 'auto squash' '\n+test_auto_squash() {\n \tgit reset --hard base &&\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n \tgit commit -m \"squash! first\"\n \n-\tgit tag final-squash &&\n+\tgit tag $1 &&\n \ttest_tick &&\n-\tgit rebase --autosquash -i HEAD^^^ &&\n+\tgit rebase $2 -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n \ttest 3 = $(wc -l <actual) &&\n-\tgit diff --exit-code final-squash &&\n+\tgit diff --exit-code $1 &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 2 = $(git cat-file commit HEAD^ | grep first | wc -l)\n+}\n+\n+test_expect_success 'auto squash (option)' '\n+\ttest_auto_squash final-squash --autosquash\n+'\n+\n+test_expect_success 'auto squash (config)' '\n+\tgit config rebase.autosquash true &&\n+\ttest_auto_squash final-squash-config-true &&\n+\ttest_must_fail test_auto_squash squash-config-true-no --no-autosquash &&\n+\tgit config rebase.autosquash false &&\n+\ttest_must_fail test_auto_squash final-squash-config-false\n '\n \n test_expect_success 'misspelled auto squash' '\n-- \n1.7.2.rc2.1.gf1735.dirty\n"},{"id":"145447","messageId":"AANLkTilFOOK1eXkzWJXlr3zf78xZ82nIK9Jrr1END3-Y@mail.gmail.com","threadId":"24347","inReplyTo":"20100713112316.GA758@book.hvoigt.net","subject":"Re: [PATCH v3] add configuration variable for --autosquash option of interactive rebase","fromName":"Santi Béjar","fromEmail":"santi@agolina.net","sentAt":"2010-07-13T12:34:54Z","receivedAt":"2010-07-13T12:34:54Z","isPatch":true,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Tue, Jul 13, 2010 at 1:24 PM, Heiko Voigt <hvoigt@hvoigt.net> wrote:\n> If you use this feature regularly you can now enable it by default. In\n> case the user wants to override this config on the commandline\n> --no-autosquash can be used to force disabling.\n>\n> Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>\n\n[...]\n\n> @@ -335,6 +338,11 @@ idea unless you know what you are doing (see BUGS below).\n>  +\n>  This option is only valid when the '--interactive' option is used.\n>\n> +--no-autosquash::\n> +       If the '--autosquash' option is enabled by default using the\n> +       configuration variable `rebase.autosquash` this option can be\n> +       used to override and disable this setting.\n> +\n\nYou could also merge this entry with the --autosquash as with --squash\noption in git-pull(1):\n\n--autosquash::\n--noautosquash::\n[original text]\n+\nIf the '--autosquash' option is enabled by default using the\nconfiguration variable `rebase.autosquash` this option can be\nused to override and disable this setting.\n\nSanti\n"},{"id":"145452","messageId":"7vlj9f4b5a.fsf@alter.siamese.dyndns.org","threadId":"24347","inReplyTo":"AANLkTilFOOK1eXkzWJXlr3zf78xZ82nIK9Jrr1END3-Y@mail.gmail.com","subject":"Re: [PATCH v3] add configuration variable for --autosquash option of interactive rebase","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-13T16:08:49Z","receivedAt":"2010-07-13T16:08:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Santi Béjar <santi@agolina.net> writes:\n\n> You could also merge this entry with the --autosquash as with --squash\n> option in git-pull(1):\n>\n> --autosquash::\n> --noautosquash::\n> [original text]\n> +\n> If the '--autosquash' option is enabled by default using the\n> configuration variable `rebase.autosquash` this option can be\n> used to override and disable this setting.\n\nThanks for the suggestion; that probably reads better.\n"},{"id":"145512","messageId":"4C3D4802.2010707@gmail.com","threadId":"24347","inReplyTo":"20100713112316.GA758@book.hvoigt.net","subject":"Re: [PATCH v3] add configuration variable for --autosquash option of interactive rebase","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2010-07-14T05:15:46Z","receivedAt":"2010-07-14T05:15:46Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"  On 07/13/2010 04:24 AM, Heiko Voigt wrote:\n> diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\n> index be23ad2..d357ab1 100644\n> --- a/Documentation/git-rebase.txt\n> +++ b/Documentation/git-rebase.txt\n> @@ -199,6 +199,9 @@ rebase.stat::\n>   \tWhether to show a diffstat of what changed upstream since the last\n>   \trebase. False by default.\n>\n> +rebase.autosquash::\n> +\tIf set to true enable '--autosquash' option by default.\n> +\n\nCan you squash this in too? I know we duplicate the wording, but rebase.stat has set some precedence here on that one.\n\n---->8-------\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 79d54e5..9e3c48b 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1533,6 +1533,9 @@ rebase.stat::\n         Whether to show a diffstat of what changed upstream since the last\n         rebase. False by default.\n\n+rebase.autosquash::\n+       If set to true enable '--autosquash' option by default.\n+\n  receive.autogc::\n         By default, git-receive-pack will run \"git-gc --auto\" after\n         receiving data from git-push and updating refs.  You can stop\n"},{"id":"145528","messageId":"20100714115003.GA15316@book.hvoigt.net","threadId":"24347","inReplyTo":"7vlj9f4b5a.fsf@alter.siamese.dyndns.org","subject":"Re: Re: [PATCH v3] add configuration variable for --autosquash option of interactive rebase","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2010-07-14T11:50:03Z","receivedAt":"2010-07-14T11:50:03Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"Hi,\n\nOn Tue, Jul 13, 2010 at 09:08:49AM -0700, Junio C Hamano wrote:\n> Santi Béjar <santi@agolina.net> writes:\n> \n> > You could also merge this entry with the --autosquash as with --squash\n> > option in git-pull(1):\n> >\n> > --autosquash::\n> > --noautosquash::\n> > [original text]\n> > +\n> > If the '--autosquash' option is enabled by default using the\n> > configuration variable `rebase.autosquash` this option can be\n> > used to override and disable this setting.\n> \n> Thanks for the suggestion; that probably reads better.\n\nSame from me. Will change the patch accordingly.\n\ncheers Heiko\n"},{"id":"145529","messageId":"20100714115422.GB15316@book.hvoigt.net","threadId":"24347","inReplyTo":"4C3D4802.2010707@gmail.com","subject":"Re: Re: [PATCH v3] add configuration variable for --autosquash option of interactive rebase","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2010-07-14T11:54:22Z","receivedAt":"2010-07-14T11:54:22Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"On Tue, Jul 13, 2010 at 10:15:46PM -0700, Stephen Boyd wrote:\n> Can you squash this in too? I know we duplicate the wording, but rebase.stat has set some precedence here on that one.\n>\n> ---->8-------\n>\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 79d54e5..9e3c48b 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -1533,6 +1533,9 @@ rebase.stat::\n>         Whether to show a diffstat of what changed upstream since the last\n>         rebase. False by default.\n>\n> +rebase.autosquash::\n> +       If set to true enable '--autosquash' option by default.\n> +\n>  receive.autogc::\n>         By default, git-receive-pack will run \"git-gc --auto\" after\n>         receiving data from git-push and updating refs.  You can stop\n\nThanks for noticing. Will do. I find it helpful to have an overview of\nall configuration variables in one place.\n\ncheers Heiko\n"},{"id":"145530","messageId":"20100714115957.GC15316@book.hvoigt.net","threadId":"24347","inReplyTo":"4C3D4802.2010707@gmail.com","subject":"[PATCH v4] add configuration variable for --autosquash option of interactive rebase","fromName":"Heiko Voigt","fromEmail":"hvoigt@hvoigt.net","sentAt":"2010-07-14T11:59:57Z","receivedAt":"2010-07-14T11:59:57Z","isPatch":true,"sender":{"key":"hvoigt@hvoigt.net","avatar":"https://avatars.githubusercontent.com/u/184958?v=4"},"body":"If you use this feature regularly you can now enable it by default. In\ncase the user wants to override this config on the commandline\n--no-autosquash can be used to force disabling.\n\nSigned-off-by: Heiko Voigt <hvoigt@hvoigt.net>\n---\n\nChanges since v3:\n\n  * Add documentation of configuration variable to config.txt\n  * Merge description of --no-autosquash with the one of --autosquash\n\n Documentation/config.txt     |    3 +++\n Documentation/git-rebase.txt |    8 ++++++++\n git-rebase--interactive.sh   |    4 ++++\n t/t3415-rebase-autosquash.sh |   40 ++++++++++++++++++++++++++++++++--------\n 4 files changed, 47 insertions(+), 8 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 72949e7..d0c985e 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1531,6 +1531,9 @@ rebase.stat::\n \tWhether to show a diffstat of what changed upstream since the last\n \trebase. False by default.\n \n+rebase.autosquash::\n+\tIf set to true enable '--autosquash' option by default.\n+\n receive.autogc::\n \tBy default, git-receive-pack will run \"git-gc --auto\" after\n \treceiving data from git-push and updating refs.  You can stop\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex be23ad2..1e2a564 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -199,6 +199,9 @@ rebase.stat::\n \tWhether to show a diffstat of what changed upstream since the last\n \trebase. False by default.\n \n+rebase.autosquash::\n+\tIf set to true enable '--autosquash' option by default.\n+\n OPTIONS\n -------\n <newbase>::\n@@ -326,6 +329,7 @@ idea unless you know what you are doing (see BUGS below).\n \tinstead.\n \n --autosquash::\n+--no-autosquash::\n \tWhen the commit log message begins with \"squash! ...\" (or\n \t\"fixup! ...\"), and there is a commit whose title begins with\n \tthe same ..., automatically modify the todo list of rebase -i\n@@ -334,6 +338,10 @@ idea unless you know what you are doing (see BUGS below).\n \tcommit from `pick` to `squash` (or `fixup`).\n +\n This option is only valid when the '--interactive' option is used.\n++\n+If the '--autosquash' option is enabled by default using the\n+configuration variable `rebase.autosquash` this option can be\n+used to override and disable this setting.\n \n --no-ff::\n \tWith --interactive, cherry-pick all rebased commits instead of\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 6b86abc..7b35f80 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -111,6 +111,7 @@ VERBOSE=\n OK_TO_SKIP_PRE_REBASE=\n REBASE_ROOT=\n AUTOSQUASH=\n+test \"$(git config --bool rebase.autosquash)\" = \"true\" && AUTOSQUASH=t\n NEVER_FF=\n \n GIT_CHERRY_PICK_HELP=\"  After resolving the conflicts,\n@@ -795,6 +796,9 @@ first and then run 'git rebase --continue' again.\"\n \t--autosquash)\n \t\tAUTOSQUASH=t\n \t\t;;\n+\t--no-autosquash)\n+\t\tAUTOSQUASH=\n+\t\t;;\n \t--onto)\n \t\tshift\n \t\tONTO=$(parse_onto \"$1\") ||\ndiff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh\nindex b63f4e2..37cb89a 100755\n--- a/t/t3415-rebase-autosquash.sh\n+++ b/t/t3415-rebase-autosquash.sh\n@@ -21,38 +21,62 @@ test_expect_success setup '\n \tgit tag base\n '\n \n-test_expect_success 'auto fixup' '\n+test_auto_fixup() {\n \tgit reset --hard base &&\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n \tgit commit -m \"fixup! first\"\n \n-\tgit tag final-fixup &&\n+\tgit tag $1 &&\n \ttest_tick &&\n-\tgit rebase --autosquash -i HEAD^^^ &&\n+\tgit rebase $2 -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n \ttest 3 = $(wc -l <actual) &&\n-\tgit diff --exit-code final-fixup &&\n+\tgit diff --exit-code $1 &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 1 = $(git cat-file commit HEAD^ | grep first | wc -l)\n+}\n+\n+test_expect_success 'auto fixup (option)' '\n+\ttest_auto_fixup final-fixup-option --autosquash\n+'\n+\n+test_expect_success 'auto fixup (config)' '\n+\tgit config rebase.autosquash true &&\n+\ttest_auto_fixup final-fixup-config-true &&\n+\ttest_must_fail test_auto_fixup fixup-config-true-no --no-autosquash &&\n+\tgit config rebase.autosquash false &&\n+\ttest_must_fail test_auto_fixup final-fixup-config-false\n '\n \n-test_expect_success 'auto squash' '\n+test_auto_squash() {\n \tgit reset --hard base &&\n \techo 1 >file1 &&\n \tgit add -u &&\n \ttest_tick &&\n \tgit commit -m \"squash! first\"\n \n-\tgit tag final-squash &&\n+\tgit tag $1 &&\n \ttest_tick &&\n-\tgit rebase --autosquash -i HEAD^^^ &&\n+\tgit rebase $2 -i HEAD^^^ &&\n \tgit log --oneline >actual &&\n \ttest 3 = $(wc -l <actual) &&\n-\tgit diff --exit-code final-squash &&\n+\tgit diff --exit-code $1 &&\n \ttest 1 = \"$(git cat-file blob HEAD^:file1)\" &&\n \ttest 2 = $(git cat-file commit HEAD^ | grep first | wc -l)\n+}\n+\n+test_expect_success 'auto squash (option)' '\n+\ttest_auto_squash final-squash --autosquash\n+'\n+\n+test_expect_success 'auto squash (config)' '\n+\tgit config rebase.autosquash true &&\n+\ttest_auto_squash final-squash-config-true &&\n+\ttest_must_fail test_auto_squash squash-config-true-no --no-autosquash &&\n+\tgit config rebase.autosquash false &&\n+\ttest_must_fail test_auto_squash final-squash-config-false\n '\n \n test_expect_success 'misspelled auto squash' '\n-- \n1.7.2.rc2.1.gf1735.dirty\n"}]}