From: Junio C Hamano Date: Thu, 18 Apr 2013 18:49:11 +0000 (-0700) Subject: Merge branch 'fc/send-email-annotate' X-Git-Tag: v1.8.3-rc0~56 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/288aa7534ae79eef03f79aaec355a7eedb08ddfa?ds=inline;hp=-c Merge branch 'fc/send-email-annotate' Allows format-patch --cover-letter to be configurable; the most notable is the "auto" mode to create cover-letter only for multi patch series. * fc/send-email-annotate: rebase-am: explicitly disable cover-letter format-patch: trivial cleanups format-patch: add format.coverLetter configuration variable log: update to OPT_BOOL format-patch: refactor branch name calculation format-patch: improve head calculation for cover-letter send-email: make annotate configurable --- 288aa7534ae79eef03f79aaec355a7eedb08ddfa diff --combined Documentation/config.txt index 3d750e0452,83b924494c..42b0f3ba42 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@@ -727,22 -727,9 +727,22 @@@ branch.autosetuprebase: This option defaults to never. branch..remote:: - When in branch , it tells 'git fetch' and 'git push' which - remote to fetch from/push to. It defaults to `origin` if no remote is - configured. `origin` is also used if you are not on any branch. + When on branch , it tells 'git fetch' and 'git push' + which remote to fetch from/push to. The remote to push to + may be overridden with `remote.pushdefault` (for all branches). + The remote to push to, for the current branch, may be further + overridden by `branch..pushremote`. If no remote is + configured, or if you are not on any branch, it defaults to + `origin` for fetching and `remote.pushdefault` for pushing. + +branch..pushremote:: + When on branch , it overrides `branch..remote` for + pushing. It also overrides `remote.pushdefault` for pushing + from branch . When you pull from one place (e.g. your + upstream) and push to another place (e.g. your own publishing + repository), you would want to set `remote.pushdefault` to + specify the remote to push to for all branches, and use this + option to override it for a specific branch. branch..merge:: Defines, together with branch..remote, the upstream branch @@@ -1109,6 -1096,11 +1109,11 @@@ format.signoff: the rights to submit this work under the same open source license. Please see the 'SubmittingPatches' document for further discussion. + format.coverLetter:: + A boolean that controls whether to generate a cover-letter when + format-patch is invoked, but in addition can be set to "auto", to + generate a cover-letter only when there's more than one patch. + filter..clean:: The command which is used to convert the content of a worktree file to a blob upon checkin. See linkgit:gitattributes[5] for @@@ -1911,11 -1903,6 +1916,11 @@@ receive.updateserverinfo: If set to true, git-receive-pack will run git-update-server-info after receiving data from git-push and updating refs. +remote.pushdefault:: + The remote to push to by default. Overrides + `branch..remote` for all branches, and is overridden by + `branch..pushremote` for specific branches. + remote..url:: The URL of a remote repository. See linkgit:git-fetch[1] or linkgit:git-push[1]. @@@ -2016,6 -2003,7 +2021,7 @@@ sendemail..*: sendemail.aliasesfile:: sendemail.aliasfiletype:: + sendemail.annotate:: sendemail.bcc:: sendemail.cc:: sendemail.cccmd:: diff --combined t/t4014-format-patch.sh index 86ee077107,8368181d6c..58d418098d --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@@ -742,21 -742,21 +742,21 @@@ test_expect_success 'format-patch --sig test 2 = $(grep "my sig" output | wc -l) ' -test_expect_success 'format.signature="" supresses signatures' ' +test_expect_success 'format.signature="" suppresses signatures' ' git config format.signature "" && git format-patch --stdout -1 >output && check_patch output && ! grep "^-- \$" output ' -test_expect_success 'format-patch --no-signature supresses signatures' ' +test_expect_success 'format-patch --no-signature suppresses signatures' ' git config --unset-all format.signature && git format-patch --stdout --no-signature -1 >output && check_patch output && ! grep "^-- \$" output ' -test_expect_success 'format-patch --signature="" supresses signatures' ' +test_expect_success 'format-patch --signature="" suppresses signatures' ' git format-patch --stdout --signature="" -1 >output && check_patch output && ! grep "^-- \$" output @@@ -1284,4 -1284,37 +1284,37 @@@ test_expect_success 'cover letter usin grep hello actual >/dev/null ' + test_expect_success 'cover letter with nothing' ' + git format-patch --stdout --cover-letter >actual && + test_line_count = 0 actual + ' + + test_expect_success 'cover letter auto' ' + mkdir -p tmp && + test_when_finished "rm -rf tmp; + git config --unset format.coverletter" && + + git config format.coverletter auto && + git format-patch -o tmp -1 >list && + test_line_count = 1 list && + git format-patch -o tmp -2 >list && + test_line_count = 3 list + ' + + test_expect_success 'cover letter auto user override' ' + mkdir -p tmp && + test_when_finished "rm -rf tmp; + git config --unset format.coverletter" && + + git config format.coverletter auto && + git format-patch -o tmp --cover-letter -1 >list && + test_line_count = 2 list && + git format-patch -o tmp --cover-letter -2 >list && + test_line_count = 3 list && + git format-patch -o tmp --no-cover-letter -1 >list && + test_line_count = 1 list && + git format-patch -o tmp --no-cover-letter -2 >list && + test_line_count = 2 list + ' + test_done