[PATCH] builtin/commit.c: prevent bad commits

2018-04-01 Thread Dan Aloni
d'. Note that this change does not affect actual software quality maintained using Git. Thus, it is recommended keep testing all generated versions regardless of commit hash jinxes. Signed-off-by: Dan Aloni --- builtin/commit.c | 34 +- 1 file changed, 29 ins

[PATCH v9] ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-05 Thread Dan Aloni
Changes between v8 -> v9: * Rebased and tested on v2.7.1. * Made a small correction suggested by Junio in the documentation for the new option: s/upon/before v8: http://article.gmane.org/gmane.comp.version-control.git/285646 -- To unsubscribe from this list: send the line "unsubscribe git" in

[PATCH v9 2/2] ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-05 Thread Dan Aloni
ident_config_given |= IDENT_MAIL_GIVEN; return 0; } diff --git a/t/t7517-per-repo-email.sh b/t/t7517-per-repo-email.sh new file mode 100755 index ..337e6e30c35f --- /dev/null +++ b/t/t7517-per-repo-email.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Copyright (c) 20

[PATCH v9 1/2] fmt_ident: refactor strictness checks

2016-02-05 Thread Dan Aloni
From: Jeff King This function has evolved quite a bit over time, and as a result, the logic for "is this an OK ident" has been sprinkled throughout. This ends up with a lot of redundant conditionals, like checking want_name repeatedly. Worse, we want to know in many cases whether we are using the

[PATCH v8 2/2] ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-05 Thread Dan Aloni
ident_config_given |= IDENT_MAIL_GIVEN; return 0; } diff --git a/t/t7517-per-repo-email.sh b/t/t7517-per-repo-email.sh new file mode 100755 index ..337e6e30c35f --- /dev/null +++ b/t/t7517-per-repo-email.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# +# Copyright (c) 20

[PATCH v8] ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-05 Thread Dan Aloni
Changes between v7 -> v8: * Proofing fixes suggestions by Eric. * Test script cleanup by Jeff. * Renumbered test script. v7: http://article.gmane.org/gmane.comp.version-control.git/285636 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger

[PATCH v8 1/2] fmt_ident: refactor strictness checks

2016-02-05 Thread Dan Aloni
From: Jeff King This function has evolved quite a bit over time, and as a result, the logic for "is this an OK ident" has been sprinkled throughout. This ends up with a lot of redundant conditionals, like checking want_name repeatedly. Worse, we want to know in many cases whether we are using the

Re: [PATCH v7 2/2] ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-05 Thread Dan Aloni
On Fri, Feb 05, 2016 at 04:59:52PM -0500, Eric Sunshine wrote: > On Fri, Feb 05, 2016 at 11:29:06PM +0200, Dan Aloni wrote: > > It used to be that: > > > >git config --global user.email "(none)" > > > > was a viable way for people to force themselv

Re: [PATCH v7 2/2] ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-05 Thread Dan Aloni
On Fri, Feb 05, 2016 at 04:48:33PM -0500, Jeff King wrote: > On Fri, Feb 05, 2016 at 11:29:06PM +0200, Dan Aloni wrote: > > > diff --git a/t/t9904-per-repo-email.sh b/t/t9904-per-repo-email.sh > > new file mode 100755 > > index ..f2b33881e46b > > --- /

[PATCH v7 2/2] ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-05 Thread Dan Aloni
this hack no longer works. Provide the same functionality by adding a new configuration variable user.useConfigOnly; when this variable is set, the user must explicitly set user.email configuration. Signed-off-by: Dan Aloni Helped-by: Jeff King Signed-off-by: Junio C Hamano Cc: Eri

[PATCH v7] ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-05 Thread Dan Aloni
Changes between v6 -> v7: * Dropped patch: ident: cleanup wrt ident's source * Revised the documentation of the feature according to comments. * Revised the test according to comments. * Styling fix. v6: http://article.gmane.org/gmane.comp.version-control.git/285550 -- To unsubscribe from this l

[PATCH v7 1/2] fmt_ident: refactor strictness checks

2016-02-05 Thread Dan Aloni
From: Jeff King This function has evolved quite a bit over time, and as a result, the logic for "is this an OK ident" has been sprinkled throughout. This ends up with a lot of redundant conditionals, like checking want_name repeatedly. Worse, we want to know in many cases whether we are using the

Re: [PATCH v6 2/3] ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-05 Thread Dan Aloni
p;& > test_must_fail git commit -m msg > ' > > Note that you do not need "test_unconfig user.email" in reprepare, > as the variable is set in one test with test_config, which uses > test_when_finished to arrange the variable to be removed a

Re: [PATCH v6 3/3] ident: cleanup wrt ident's source

2016-02-05 Thread Dan Aloni
On Fri, Feb 05, 2016 at 02:24:13PM -0500, Jeff King wrote: > On Fri, Feb 05, 2016 at 11:05:19AM -0800, Junio C Hamano wrote: > > > Dan Aloni writes: > > > > > This change condenses the variables that tells where we got the user's > > > ident into single

[PATCH v6 2/3] ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-04 Thread Dan Aloni
this hack no longer works. Provide the same functionality by adding a new configuration variable user.useConfigOnly; when this variable is set, the user must explicitly set user.email configuration. Signed-off-by: Dan Aloni Helped-by: Jeff King Signed-off-by: Junio C Hamano Cc: Eri

[PATCH v6 1/3] fmt_ident: refactor strictness checks

2016-02-04 Thread Dan Aloni
From: Jeff King This function has evolved quite a bit over time, and as a result, the logic for "is this an OK ident" has been sprinkled throughout. This ends up with a lot of redundant conditionals, like checking want_name repeatedly. Worse, we want to know in many cases whether we are using the

[PATCH v6 3/3] ident: cleanup wrt ident's source

2016-02-04 Thread Dan Aloni
itter,author}_info to do so. Signed-off-by: Dan Aloni Helped-by: Jeff King Helped-by: Junio C Hamano --- ident.c | 126 1 file changed, 80 insertions(+), 46 deletions(-) diff --git a/ident.c b/ident.c index 9bd6ac69bfe8..9bb0591

[PATCH v6] ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-04 Thread Dan Aloni
Change between v5 -> v6: * Removed trailing comma in 'enum ident_person'. v5: http://article.gmane.org/gmane.comp.version-control.git/285544 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger

[PATCH v5 3/3] ident: cleanup wrt ident's source

2016-02-04 Thread Dan Aloni
itter,author}_info to do so. Signed-off-by: Dan Aloni Helped-by: Jeff King Helped-by: Junio C Hamano --- ident.c | 126 1 file changed, 80 insertions(+), 46 deletions(-) diff --git a/ident.c b/ident.c index 9bd6ac69bfe8..725d0ae

[PATCH v5 2/3] ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-04 Thread Dan Aloni
this hack no longer works. Provide the same functionality by adding a new configuration variable user.useConfigOnly; when this variable is set, the user must explicitly set user.email configuration. Signed-off-by: Dan Aloni Helped-by: Jeff King Signed-off-by: Junio C Hamano Cc: Eri

[PATCH v5] ident: add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-04 Thread Dan Aloni
Changes between v4 -> v5: * Fixes for compiler warnings under standard compilation. * Revised commit messages according to remarks. * Cleanups and fixes of the added test script. * Indentation and styling fixes. v4: http://thread.gmane.org/gmane.comp.version-control.git/285441 -- To unsubscr

[PATCH v5 1/3] fmt_ident: refactor strictness checks

2016-02-04 Thread Dan Aloni
From: Jeff King This function has evolved quite a bit over time, and as a result, the logic for "is this an OK ident" has been sprinkled throughout. This ends up with a lot of redundant conditionals, like checking want_name repeatedly. Worse, we want to know in many cases whether we are using the

Re: [PATCH v4 2/3] Add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-04 Thread Dan Aloni
to_commit && > > + > > + EMAIL=t...@fail.com EDITOR=: VISUAL=: test_must_fail git commit -m msg > > This is a good place to use the "test_must_fail env" pattern, i.e. > > test_must_fail env EMAIL=t...@fail.com git commit -m msg > > I would think. Yes, and the fixed test still passes. Will resubmit the patches. -- Dan Aloni -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v4 3/3] ident.c: cleanup wrt ident's source

2016-02-04 Thread Dan Aloni
On Thu, Feb 04, 2016 at 02:42:55PM -0800, Junio C Hamano wrote: > Dan Aloni writes: > > > +static int ident_source_is_sufficient(enum ident_source source) > > +{ > > + switch (source) { > > + case IDENT_SOURCE_CONFIG: > > + case IDENT_SOURCE_E

[PATCH v4 3/3] ident.c: cleanup wrt ident's source

2016-02-04 Thread Dan Aloni
to do so. Signed-off-by: Dan Aloni --- ident.c | 122 1 file changed, 77 insertions(+), 45 deletions(-) diff --git a/ident.c b/ident.c index 1216079d0b0d..b9aad38e0621 100644 --- a/ident.c +++ b/ident.c @@ -10,17 +10,19 @@ static s

[PATCH v4 2/3] Add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-04 Thread Dan Aloni
ail config was set in the per-repo config to the correct email address. This commit provides the same functionality by adding a new configuration variable. Signed-off-by: Dan Aloni Cc: Eric Sunshine Cc: Jeff King Cc: Git List --- Documentation/config.txt | 9 ident.c

[PATCH v4 1/3] fmt_ident: refactor strictness checks

2016-02-04 Thread Dan Aloni
From: Jeff King This function has evolved quite a bit over time, and as a result, the logic for "is this an OK ident" has been sprinkled throughout. This ends up with a lot of redundant conditionals, like checking want_name repeatedly. Worse, we want to know in many cases whether we are using the

[PATCH v4] Add user.useConfigOnly boolean for when ident shouldn't be guessed

2016-02-04 Thread Dan Aloni
v3->v4 changes: * Added cleanup patch for ident.c * Added Jeff's refactoring to fmt_indent * Renamed configuration option to useConfigOnly. * Extended tests to include a clone, EMAIL env. Also, ran the entire Git test suite to make sure nothing's broken. -- To unsubscribe from this list: sen

Re: [PATCH v3] Add user.explicit boolean for when ident shouldn't be guessed

2016-02-04 Thread Dan Aloni
On Thu, Feb 04, 2016 at 12:50:35AM -0500, Jeff King wrote: > On Thu, Feb 04, 2016 at 07:36:46AM +0200, Dan Aloni wrote: >[..] > > The code should be cleaned up anyway. I only delved into that code for > > the first time two days ago, so it would take me more time to come up

Re: [PATCH v3] Add user.explicit boolean for when ident shouldn't be guessed

2016-02-03 Thread Dan Aloni
levels of above in a > variable, and default it to type-3. That would let people loosen or > tighten as they see fit. But it would be a more complicated patch, so if > nobody really cares about it beyond this use case, it may be overkill. I get the impression from this and your later E-Mails that there are much more cases to cover when testing this feature (and I would not like to break stuff implementing this, obviously). The code should be cleaned up anyway. I only delved into that code for the first time two days ago, so it would take me more time to come up with a new one (though reading your overview here of the cases is going to be helpful, thanks). -- Dan Aloni -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH v3] Add user.explicit boolean for when ident shouldn't be guessed

2016-02-03 Thread Dan Aloni
different email addresses for different clones. as it barred git from creating commit unless the user.email config was set in the per-repo config to the correct email address. This commit provides the same functionality by adding a new configuration variable. Signed-off-by: Dan Aloni --- Documentation/c

Re: [PATCH] Trick to force setup of a specific configured E-Mail per repo

2016-02-03 Thread Dan Aloni
(resend - my mailer was misconfigured) On Tue, Feb 02, 2016 at 10:56:48PM -0500, Jeff King wrote: > On Tue, Feb 02, 2016 at 09:54:21PM +0200, Dan Aloni wrote: >[..] > > + if (strict && email && !strcmp(email, "(per-repo)")) { > > + d

[PATCH] Trick to force setup of a specific configured E-Mail per repo

2016-02-02 Thread Dan Aloni
ail config was set in the per-clone config to the correct E-Mail address. Now, since the original 'bug' was fixed, and practically every string is acceptable for user.email and user.name, it is best to reimplement the feature not as an exploit of a bug, but as an actual feature. Sign