{"thread":{"id":"21255","subject":"[PATCH] am: allow some defaults to be specified via git-config","startedAt":"2009-10-15T23:50:27Z","lastAt":"2009-10-20T06:30:56Z","messageCount":5,"participants":["Sam Vilain","Junio C Hamano","Wesley J. Landaker"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"125123","messageId":"1255650627-17576-1-git-send-email-sam.vilain@catalyst.net.nz","threadId":"21255","inReplyTo":null,"subject":"[PATCH] am: allow some defaults to be specified via git-config","fromName":"Sam Vilain","fromEmail":"sam.vilain@catalyst.net.nz","sentAt":"2009-10-15T23:50:27Z","receivedAt":"2009-10-15T23:50:27Z","isPatch":true,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Some users prefer in particular '3way' to be the default, let them\nspecify it via the config file - and some other boolean settings while\nwe're at it.\n\nSigned-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>\n---\n Documentation/config.txt |    4 ++++\n Documentation/git-am.txt |   11 +++++++++--\n git-am.sh                |    5 +++++\n 3 files changed, 18 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex cd17814..82adca5 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -476,6 +476,10 @@ it will be treated as a shell command.  For example, defining\n executed from the top-level directory of a repository, which may\n not necessarily be the current directory.\n \n+am.*::\n+\tSpecify defaults for linkgit:git-am[1].  Currently, the three\n+\tboolean options, 'sign', 'utf8' and 'keep' may be specified.\n+\n apply.ignorewhitespace::\n \tWhen set to 'change', tells 'git-apply' to ignore changes in\n \twhitespace, in the same way as the '--ignore-space-change'\ndiff --git a/Documentation/git-am.txt b/Documentation/git-am.txt\nindex 67ad5da..c22bca2 100644\n--- a/Documentation/git-am.txt\n+++ b/Documentation/git-am.txt\n@@ -38,6 +38,7 @@ OPTIONS\n -k::\n --keep::\n \tPass `-k` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1]).\n+\tMay be specified via 'am.keep' (see linkgit:git-config[1]).\n \n -c::\n --scissors::\n@@ -60,7 +61,8 @@ OPTIONS\n \tpreferred encoding if it is not UTF-8).\n +\n This was optional in prior versions of git, but now it is the\n-default.   You can use `--no-utf8` to override this.\n+default.   You can use `--no-utf8` to override this, or set\n+'am.utf8' to no via linkgit:git-config[1].\n \n --no-utf8::\n \tPass `-n` flag to 'git-mailinfo' (see\n@@ -71,7 +73,12 @@ default.   You can use `--no-utf8` to override this.\n \tWhen the patch does not apply cleanly, fall back on\n \t3-way merge if the patch records the identity of blobs\n \tit is supposed to apply to and we have those blobs\n-\tavailable locally.\n+\tavailable locally.  This can be configured via\n+\tlinkgit:git-config[1] using the 'am.3way' option\n+\n+--no-3way::\n+\tIf 'am.3way' is specified to be true in the configuration file,\n+\tthis switch allows it to be disabled.\n \n --ignore-date::\n --ignore-space-change::\ndiff --git a/git-am.sh b/git-am.sh\nindex c132f50..a22fa3b 100755\n--- a/git-am.sh\n+++ b/git-am.sh\n@@ -294,6 +294,9 @@ git_apply_opt=\n committer_date_is_author_date=\n ignore_date=\n \n+# apply defaults from config\n+eval \"$(git config --bool --get-regexp '^am\\.(sign|utf8|keep)' | sed 's/^am\\.\\([a-z0-9]*\\) /\\1=/;s/true/t/;s/false//')\"\n+\n while test $# != 0\n do\n \tcase \"$1\" in\n@@ -303,6 +306,8 @@ do\n \t\t: ;;\n \t-3|--3way)\n \t\tthreeway=t ;;\n+\t--no-3way)\n+\t\tthreeway= ;;\n \t-s|--signoff)\n \t\tsign=t ;;\n \t-u|--utf8)\n-- \n1.6.3.3\n"},{"id":"125223","messageId":"7v3a5iq1wk.fsf@alter.siamese.dyndns.org","threadId":"21255","inReplyTo":"1255650627-17576-1-git-send-email-sam.vilain@catalyst.net.nz","subject":"Re: [PATCH] am: allow some defaults to be specified via git-config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-10-17T00:50:35Z","receivedAt":"2009-10-17T00:50:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sam Vilain <sam.vilain@catalyst.net.nz> writes:\n\n> Some users prefer in particular '3way' to be the default, let them\n> specify it via the config file - and some other boolean settings while\n> we're at it.\n\nI have to wonder how this will interact with the internal call rebase\nmakes into am.  Would there be unexpected fallouts?\n"},{"id":"125401","messageId":"200910191149.13698.wjl@icecavern.net","threadId":"21255","inReplyTo":"1255650627-17576-1-git-send-email-sam.vilain@catalyst.net.nz","subject":"Re: [PATCH] am: allow some defaults to be specified via git-config","fromName":"Wesley J. Landaker","fromEmail":"wjl@icecavern.net","sentAt":"2009-10-19T17:49:13Z","receivedAt":"2009-10-19T17:49:13Z","isPatch":true,"sender":{"key":"wjl@icecavern.net","avatar":"https://avatars.githubusercontent.com/u/67229?v=4"},"body":"On Thursday 15 October 2009 17:50:27 Sam Vilain wrote:\n> +am.*::\n> +\tSpecify defaults for linkgit:git-am[1].  Currently, the three\n> +\tboolean options, 'sign', 'utf8' and 'keep' may be specified.\n> +\n\nThe 'git am' option is 'signoff', not 'sign'. Shouldn't the command option \nand config option names match?\n"},{"id":"125435","messageId":"4ADD241F.9060004@catalyst.net.nz","threadId":"21255","inReplyTo":"200910191149.13698.wjl@icecavern.net","subject":"Re: [PATCH] am: allow some defaults to be specified via git-config","fromName":"Sam Vilain","fromEmail":"sam.vilain@catalyst.net.nz","sentAt":"2009-10-20T02:44:47Z","receivedAt":"2009-10-20T02:44:47Z","isPatch":true,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Wesley J. Landaker wrote:\n> On Thursday 15 October 2009 17:50:27 Sam Vilain wrote:\n>> +am.*::\n>> +\tSpecify defaults for linkgit:git-am[1].  Currently, the three\n>> +\tboolean options, 'sign', 'utf8' and 'keep' may be specified.\n>> +\n> \n> The 'git am' option is 'signoff', not 'sign'. Shouldn't the command option \n> and config option names match?\n\nThanks for pointing that out.  Yes, it should be.\n-- \nSam Vilain, Perl Hacker, Catalyst IT (NZ) Ltd.\nphone: +64 4 499 2267        PGP ID: 0x66B25843\n"},{"id":"125444","messageId":"7vzl7mshjz.fsf@alter.siamese.dyndns.org","threadId":"21255","inReplyTo":"4ADD241F.9060004@catalyst.net.nz","subject":"Re: [PATCH] am: allow some defaults to be specified via git-config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-10-20T06:30:56Z","receivedAt":"2009-10-20T06:30:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sam Vilain <sam.vilain@catalyst.net.nz> writes:\n\n> Wesley J. Landaker wrote:\n>> On Thursday 15 October 2009 17:50:27 Sam Vilain wrote:\n>>> +am.*::\n>>> +\tSpecify defaults for linkgit:git-am[1].  Currently, the three\n>>> +\tboolean options, 'sign', 'utf8' and 'keep' may be specified.\n>>> +\n>> \n>> The 'git am' option is 'signoff', not 'sign'. Shouldn't the command option \n>> and config option names match?\n>\n> Thanks for pointing that out.  Yes, it should be.\n\nWouldn't this patch make issues like $gmane/130744 even worse, unless you\nadd some disabling code to rebase?\n"}]}