* [PATCH] am: allow some defaults to be specified via git-config
@ 2009-10-15 23:50 Sam Vilain
2009-10-17 0:50 ` Junio C Hamano
2009-10-19 17:49 ` Wesley J. Landaker
0 siblings, 2 replies; 5+ messages in thread
From: Sam Vilain @ 2009-10-15 23:50 UTC (permalink / raw)
To: git; +Cc: Nigel McNie, Sam Vilain
Some users prefer in particular '3way' to be the default, let them
specify it via the config file - and some other boolean settings while
we're at it.
Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>
---
Documentation/config.txt | 4 ++++
Documentation/git-am.txt | 11 +++++++++--
git-am.sh | 5 +++++
3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index cd17814..82adca5 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -476,6 +476,10 @@ it will be treated as a shell command. For example, defining
executed from the top-level directory of a repository, which may
not necessarily be the current directory.
+am.*::
+ Specify defaults for linkgit:git-am[1]. Currently, the three
+ boolean options, 'sign', 'utf8' and 'keep' may be specified.
+
apply.ignorewhitespace::
When set to 'change', tells 'git-apply' to ignore changes in
whitespace, in the same way as the '--ignore-space-change'
diff --git a/Documentation/git-am.txt b/Documentation/git-am.txt
index 67ad5da..c22bca2 100644
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
@@ -38,6 +38,7 @@ OPTIONS
-k::
--keep::
Pass `-k` flag to 'git-mailinfo' (see linkgit:git-mailinfo[1]).
+ May be specified via 'am.keep' (see linkgit:git-config[1]).
-c::
--scissors::
@@ -60,7 +61,8 @@ OPTIONS
preferred encoding if it is not UTF-8).
+
This was optional in prior versions of git, but now it is the
-default. You can use `--no-utf8` to override this.
+default. You can use `--no-utf8` to override this, or set
+'am.utf8' to no via linkgit:git-config[1].
--no-utf8::
Pass `-n` flag to 'git-mailinfo' (see
@@ -71,7 +73,12 @@ default. You can use `--no-utf8` to override this.
When the patch does not apply cleanly, fall back on
3-way merge if the patch records the identity of blobs
it is supposed to apply to and we have those blobs
- available locally.
+ available locally. This can be configured via
+ linkgit:git-config[1] using the 'am.3way' option
+
+--no-3way::
+ If 'am.3way' is specified to be true in the configuration file,
+ this switch allows it to be disabled.
--ignore-date::
--ignore-space-change::
diff --git a/git-am.sh b/git-am.sh
index c132f50..a22fa3b 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -294,6 +294,9 @@ git_apply_opt=
committer_date_is_author_date=
ignore_date=
+# apply defaults from config
+eval "$(git config --bool --get-regexp '^am\.(sign|utf8|keep)' | sed 's/^am\.\([a-z0-9]*\) /\1=/;s/true/t/;s/false//')"
+
while test $# != 0
do
case "$1" in
@@ -303,6 +306,8 @@ do
: ;;
-3|--3way)
threeway=t ;;
+ --no-3way)
+ threeway= ;;
-s|--signoff)
sign=t ;;
-u|--utf8)
--
1.6.3.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] am: allow some defaults to be specified via git-config
2009-10-15 23:50 [PATCH] am: allow some defaults to be specified via git-config Sam Vilain
@ 2009-10-17 0:50 ` Junio C Hamano
2009-10-19 17:49 ` Wesley J. Landaker
1 sibling, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2009-10-17 0:50 UTC (permalink / raw)
To: Sam Vilain; +Cc: git, Nigel McNie
Sam Vilain <sam.vilain@catalyst.net.nz> writes:
> Some users prefer in particular '3way' to be the default, let them
> specify it via the config file - and some other boolean settings while
> we're at it.
I have to wonder how this will interact with the internal call rebase
makes into am. Would there be unexpected fallouts?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] am: allow some defaults to be specified via git-config
2009-10-15 23:50 [PATCH] am: allow some defaults to be specified via git-config Sam Vilain
2009-10-17 0:50 ` Junio C Hamano
@ 2009-10-19 17:49 ` Wesley J. Landaker
2009-10-20 2:44 ` Sam Vilain
1 sibling, 1 reply; 5+ messages in thread
From: Wesley J. Landaker @ 2009-10-19 17:49 UTC (permalink / raw)
To: Sam Vilain; +Cc: git, Nigel McNie
On Thursday 15 October 2009 17:50:27 Sam Vilain wrote:
> +am.*::
> + Specify defaults for linkgit:git-am[1]. Currently, the three
> + boolean options, 'sign', 'utf8' and 'keep' may be specified.
> +
The 'git am' option is 'signoff', not 'sign'. Shouldn't the command option
and config option names match?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] am: allow some defaults to be specified via git-config
2009-10-19 17:49 ` Wesley J. Landaker
@ 2009-10-20 2:44 ` Sam Vilain
2009-10-20 6:30 ` Junio C Hamano
0 siblings, 1 reply; 5+ messages in thread
From: Sam Vilain @ 2009-10-20 2:44 UTC (permalink / raw)
To: Wesley J. Landaker; +Cc: git, Nigel McNie
Wesley J. Landaker wrote:
> On Thursday 15 October 2009 17:50:27 Sam Vilain wrote:
>> +am.*::
>> + Specify defaults for linkgit:git-am[1]. Currently, the three
>> + boolean options, 'sign', 'utf8' and 'keep' may be specified.
>> +
>
> The 'git am' option is 'signoff', not 'sign'. Shouldn't the command option
> and config option names match?
Thanks for pointing that out. Yes, it should be.
--
Sam Vilain, Perl Hacker, Catalyst IT (NZ) Ltd.
phone: +64 4 499 2267 PGP ID: 0x66B25843
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] am: allow some defaults to be specified via git-config
2009-10-20 2:44 ` Sam Vilain
@ 2009-10-20 6:30 ` Junio C Hamano
0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2009-10-20 6:30 UTC (permalink / raw)
To: Sam Vilain; +Cc: Wesley J. Landaker, git, Nigel McNie
Sam Vilain <sam.vilain@catalyst.net.nz> writes:
> Wesley J. Landaker wrote:
>> On Thursday 15 October 2009 17:50:27 Sam Vilain wrote:
>>> +am.*::
>>> + Specify defaults for linkgit:git-am[1]. Currently, the three
>>> + boolean options, 'sign', 'utf8' and 'keep' may be specified.
>>> +
>>
>> The 'git am' option is 'signoff', not 'sign'. Shouldn't the command option
>> and config option names match?
>
> Thanks for pointing that out. Yes, it should be.
Wouldn't this patch make issues like $gmane/130744 even worse, unless you
add some disabling code to rebase?
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-10-20 6:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-15 23:50 [PATCH] am: allow some defaults to be specified via git-config Sam Vilain
2009-10-17 0:50 ` Junio C Hamano
2009-10-19 17:49 ` Wesley J. Landaker
2009-10-20 2:44 ` Sam Vilain
2009-10-20 6:30 ` Junio C Hamano
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.