git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Show committer ident in some cases
@ 2008-05-02 18:22 Santi Béjar
  2008-05-02 18:22 ` [PATCH 1/2] commit: Show committer if automatic Santi Béjar
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Santi Béjar @ 2008-05-02 18:22 UTC (permalink / raw)
  To: git; +Cc: Santi Béjar

Hi *,

 This patch series tries to make more evident the committer ident
used in a commit to prevent using the wrong one.

The definition of "wrong committer" could be:

1) user.{name,email} or GIT_COMMITTER_{NAME,EMAIL} is not a wrong committer.
2) automatic without a domain name (user@hostname.(none)) is a wrong committer.
   (not handled with this patch series)
3) automatic or partially set ident:
   a) wrong committer for some users
   b) right committer for others

The different strategies are.. Show the committer:

1) always
2) when user.warn = yes (defaulting to yes)
3) when it is automatic
   a) always
   b) and different from parent
   c) and different from a list of valid committer idents
   d) and when user.WarnAutomatic = yes (defaulting to yes)

The first patch implements 3a
The second patch implements 3d

I prefer 3a.

Santi

Santi Béjar (2):
  commit: Show committer if automatic
  user.warnautomatic: add config to control if the committer ident is
    shown

 Documentation/config.txt |    4 ++++
 builtin-commit.c         |   40 +++++++++++++++++++++++++++++++++++++---
 cache.h                  |    2 ++
 config.c                 |    9 +++++++++
 environment.c            |    2 ++
 ident.c                  |    3 +++
 t/t7502-commit.sh        |   31 +++++++++++++++++++++++++++++--
 7 files changed, 86 insertions(+), 5 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/2] commit: Show committer if automatic
  2008-05-02 18:22 [PATCH 0/2] Show committer ident in some cases Santi Béjar
@ 2008-05-02 18:22 ` Santi Béjar
  2008-05-03 18:33   ` Junio C Hamano
  2008-05-02 18:22 ` [PATCH 2/2] user.warnautomatic: add config to control if the committer ident is shown Santi Béjar
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Santi Béjar @ 2008-05-02 18:22 UTC (permalink / raw)
  To: git; +Cc: Santi Béjar

To remind the committer ident in case it is not what you want
(taken from the gecos field, want to use different ident in
different repositories).

Signed-off-by: Santi Béjar <sbejar@gmail.com>
---
 builtin-commit.c  |   40 +++++++++++++++++++++++++++++++++++++---
 cache.h           |    1 +
 config.c          |    4 ++++
 environment.c     |    1 +
 ident.c           |    3 +++
 t/t7502-commit.sh |   13 +++++++++++++
 6 files changed, 59 insertions(+), 3 deletions(-)

diff --git a/builtin-commit.c b/builtin-commit.c
index 057749b..b7cc382 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -437,6 +437,29 @@ static void determine_author_info()
 	author_date = date;
 }
 
+const char *get_parent_ident()
+{
+	unsigned char sha1[20];
+	struct commit *commit;
+	const char *a, *lb, *rb, *eol;
+
+
+	get_sha1("HEAD", sha1);
+	commit = lookup_commit_reference(sha1);
+	if (!commit)
+		return NULL;
+
+	a = strstr(commit->buffer, "\ncommitter ");
+
+	lb = strstr(a + 11, " <");
+	rb = strstr(a + 11, "> ");
+	eol = strchr(a + 11, '\n');
+	if (!lb || !rb || !eol)
+		return NULL;
+
+	return xstrndup(a + 11, rb + 1 - (a + 11));
+}
+
 static int prepare_to_commit(const char *index_file, const char *prefix)
 {
 	struct stat statbuf;
@@ -448,6 +471,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
 	const char *hook_arg2 = NULL;
 	const char *author_ident;
 	const char *committer_ident;
+	int showed_ident = 0;
 
 	if (!no_verify && run_hook(index_file, "pre-commit", NULL))
 		return 0;
@@ -528,6 +552,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
 	strbuf_release(&sb);
 
 	determine_author_info();
+	git_committer_info(0);
 
 	if (use_editor) {
 		if (in_merge)
@@ -558,11 +583,20 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
 					 getenv("GIT_COMMITTER_EMAIL")));
 		if (strcmp(author_ident, committer_ident))
 			fprintf(fp,
-				"#\n"
-				"# Author:    %s\n"
-				"#\n",
+				"%s"
+				"# Author:    %s\n",
+				showed_ident++ ? "" : "#\n",
 				fmt_name(author_name, author_email));
 
+		if (!user_explicit)
+			fprintf(fp,
+				"%s# Committer: %s\n",
+				showed_ident++ ? "" : "#\n",
+				committer_ident);
+
+		if (showed_ident)
+			fprintf(fp, "#\n");
+
 		saved_color_setting = wt_status_use_color;
 		wt_status_use_color = 0;
 		commitable = run_status(fp, index_file, prefix, 1);
diff --git a/cache.h b/cache.h
index 5a28ddd..e8b26cf 100644
--- a/cache.h
+++ b/cache.h
@@ -718,6 +718,7 @@ extern int config_error_nonbool(const char *);
 #define MAX_GITNAME (1000)
 extern char git_default_email[MAX_GITNAME];
 extern char git_default_name[MAX_GITNAME];
+extern int user_explicit;
 
 extern const char *git_commit_encoding;
 extern const char *git_log_output_encoding;
diff --git a/config.c b/config.c
index b0ada51..e49804a 100644
--- a/config.c
+++ b/config.c
@@ -443,6 +443,8 @@ int git_default_config(const char *var, const char *value)
 		if (!value)
 			return config_error_nonbool(var);
 		strlcpy(git_default_name, value, sizeof(git_default_name));
+		if (git_default_email[0])
+			user_explicit = 1;
 		return 0;
 	}
 
@@ -450,6 +452,8 @@ int git_default_config(const char *var, const char *value)
 		if (!value)
 			return config_error_nonbool(var);
 		strlcpy(git_default_email, value, sizeof(git_default_email));
+		if (git_default_name[0])
+			user_explicit = 1;
 		return 0;
 	}
 
diff --git a/environment.c b/environment.c
index 6739a3f..b941971 100644
--- a/environment.c
+++ b/environment.c
@@ -11,6 +11,7 @@
 
 char git_default_email[MAX_GITNAME];
 char git_default_name[MAX_GITNAME];
+int user_explicit = 0;
 int trust_executable_bit = 1;
 int quote_path_fully = 1;
 int has_symlinks = 1;
diff --git a/ident.c b/ident.c
index ed44a53..67ccbf3 100644
--- a/ident.c
+++ b/ident.c
@@ -250,6 +250,9 @@ const char *git_author_info(int flag)
 
 const char *git_committer_info(int flag)
 {
+	if (getenv("GIT_COMMITTER_NAME") &&
+	    getenv("GIT_COMMITTER_EMAIL"))
+		user_explicit = 1;
 	return fmt_ident(getenv("GIT_COMMITTER_NAME"),
 			 getenv("GIT_COMMITTER_EMAIL"),
 			 getenv("GIT_COMMITTER_DATE"),
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 11de910..8f65c39 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -165,6 +165,19 @@ test_expect_success 'author different from committer' '
 	test_cmp expect actual
 '
 
+echo "# Committer:" >> expect
+unset GIT_COMMITTER_EMAIL
+unset GIT_COMMITTER_NAME
+
+test_expect_success 'committer is automatic' '
+
+	echo >>negative &&
+	git commit -e -m "sample"
+	head -n 7 .git/COMMIT_EDITMSG |	\
+	sed "s/^# Committer: .*/# Committer:/" >actual &&
+	test_cmp expect actual
+'
+
 pwd=`pwd`
 cat >> .git/FAKE_EDITOR << EOF
 #! /bin/sh
-- 
1.5.5.1.223.g2532

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] user.warnautomatic: add config to control if the committer ident is shown
  2008-05-02 18:22 [PATCH 0/2] Show committer ident in some cases Santi Béjar
  2008-05-02 18:22 ` [PATCH 1/2] commit: Show committer if automatic Santi Béjar
@ 2008-05-02 18:22 ` Santi Béjar
  2008-05-02 21:44 ` [PATCH 0/2] Show committer ident in some cases Junio C Hamano
  2008-05-05  3:30 ` Jeff King
  3 siblings, 0 replies; 11+ messages in thread
From: Santi Béjar @ 2008-05-02 18:22 UTC (permalink / raw)
  To: git; +Cc: Santi Béjar


Signed-off-by: Santi Béjar <sbejar@gmail.com>
---
 Documentation/config.txt |    4 ++++
 builtin-commit.c         |    2 +-
 cache.h                  |    1 +
 config.c                 |    5 +++++
 environment.c            |    1 +
 t/t7502-commit.sh        |   22 ++++++++++++++++++----
 6 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 824e416..9c770a6 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -994,6 +994,10 @@ user.signingkey::
 	unchanged to gpg's --local-user parameter, so you may specify a key
 	using any method that gpg supports.
 
+user.warnautomatic::
+	A boolean to show the committer ident while committing in the editor
+	if it is set automatically. Defaults to true.
+
 whatchanged.difftree::
 	The default linkgit:git-diff-tree[1] arguments to be used
 	for linkgit:git-whatchanged[1].
diff --git a/builtin-commit.c b/builtin-commit.c
index b7cc382..7ab8b40 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -588,7 +588,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
 				showed_ident++ ? "" : "#\n",
 				fmt_name(author_name, author_email));
 
-		if (!user_explicit)
+		if (!user_explicit && user_warnautomatic)
 			fprintf(fp,
 				"%s# Committer: %s\n",
 				showed_ident++ ? "" : "#\n",
diff --git a/cache.h b/cache.h
index e8b26cf..5d0dd23 100644
--- a/cache.h
+++ b/cache.h
@@ -719,6 +719,7 @@ extern int config_error_nonbool(const char *);
 extern char git_default_email[MAX_GITNAME];
 extern char git_default_name[MAX_GITNAME];
 extern int user_explicit;
+extern int user_warnautomatic;
 
 extern const char *git_commit_encoding;
 extern const char *git_log_output_encoding;
diff --git a/config.c b/config.c
index e49804a..1588053 100644
--- a/config.c
+++ b/config.c
@@ -457,6 +457,11 @@ int git_default_config(const char *var, const char *value)
 		return 0;
 	}
 
+	if (!strcmp(var, "user.warnautomatic")) {
+		user_warnautomatic = git_config_bool(var, value);
+		return 0;
+	}
+
 	if (!strcmp(var, "i18n.commitencoding"))
 		return git_config_string(&git_commit_encoding, var, value);
 
diff --git a/environment.c b/environment.c
index b941971..6b6ede6 100644
--- a/environment.c
+++ b/environment.c
@@ -12,6 +12,7 @@
 char git_default_email[MAX_GITNAME];
 char git_default_name[MAX_GITNAME];
 int user_explicit = 0;
+int user_warnautomatic = 1;
 int trust_executable_bit = 1;
 int quote_path_fully = 1;
 int has_symlinks = 1;
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index 8f65c39..a63f9c4 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -155,25 +155,39 @@ test_expect_success 'cleanup commit messages (strip,-F,-e)' '
 '
 
 echo "#
-# Author:    $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>" >> expect
+# Author:    $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
+#" >> expect
 
 test_expect_success 'author different from committer' '
 
 	echo >>negative &&
 	git commit -e -m "sample"
-	head -n 6 .git/COMMIT_EDITMSG >actual &&
+	head -n 7 .git/COMMIT_EDITMSG >actual &&
 	test_cmp expect actual
 '
 
-echo "# Committer:" >> expect
 unset GIT_COMMITTER_EMAIL
 unset GIT_COMMITTER_NAME
 
+test_expect_success 'committer is automatic but user.warnautomatic=no' '
+
+	git config user.warnautomatic no
+	echo >>negative &&
+	git commit -e -m "sample"
+	head -n 7 .git/COMMIT_EDITMSG >actual &&
+	test_cmp expect actual
+'
+
+sed -i '$d' expect
+echo "# Committer:
+#" >> expect
+
 test_expect_success 'committer is automatic' '
 
+	git config --unset user.warnautomatic
 	echo >>negative &&
 	git commit -e -m "sample"
-	head -n 7 .git/COMMIT_EDITMSG |	\
+	head -n 8 .git/COMMIT_EDITMSG |	\
 	sed "s/^# Committer: .*/# Committer:/" >actual &&
 	test_cmp expect actual
 '
-- 
1.5.5.1.223.g2532

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] Show committer ident in some cases
  2008-05-02 18:22 [PATCH 0/2] Show committer ident in some cases Santi Béjar
  2008-05-02 18:22 ` [PATCH 1/2] commit: Show committer if automatic Santi Béjar
  2008-05-02 18:22 ` [PATCH 2/2] user.warnautomatic: add config to control if the committer ident is shown Santi Béjar
@ 2008-05-02 21:44 ` Junio C Hamano
  2008-05-02 22:07   ` Santi Béjar
  2008-05-05  3:30 ` Jeff King
  3 siblings, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2008-05-02 21:44 UTC (permalink / raw)
  To: Santi Béjar; +Cc: git

Santi Béjar <sbejar@gmail.com> writes:

> The definition of "wrong committer" could be:
>
> 1) user.{name,email} or GIT_COMMITTER_{NAME,EMAIL} is not a wrong committer.
> 2) automatic without a domain name (user@hostname.(none)) is a wrong committer.
>    (not handled with this patch series)
> 3) automatic or partially set ident:
>    a) wrong committer for some users
>    b) right committer for others

Define "partially set".

> Santi Béjar (2):

???

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] Show committer ident in some cases
  2008-05-02 21:44 ` [PATCH 0/2] Show committer ident in some cases Junio C Hamano
@ 2008-05-02 22:07   ` Santi Béjar
  2008-05-02 22:32     ` Junio C Hamano
  0 siblings, 1 reply; 11+ messages in thread
From: Santi Béjar @ 2008-05-02 22:07 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Fri, May 2, 2008 at 11:44 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Santi Béjar <sbejar@gmail.com> writes:
>
>  > The definition of "wrong committer" could be:
>  >
>  > 1) user.{name,email} or GIT_COMMITTER_{NAME,EMAIL} is not a wrong committer.
>  > 2) automatic without a domain name (user@hostname.(none)) is a wrong committer.
>  >    (not handled with this patch series)
>  > 3) automatic or partially set ident:
>  >    a) wrong committer for some users
>  >    b) right committer for others
>
>  Define "partially set".

one of user.{name,email} is not set.

>
>  > Santi BÃ(c)jar (2):
>
>  ???

the MIME stuff was not written for the cover letter.

Santi

>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] Show committer ident in some cases
  2008-05-02 22:07   ` Santi Béjar
@ 2008-05-02 22:32     ` Junio C Hamano
  2008-05-03 10:18       ` Santi Béjar
  0 siblings, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2008-05-02 22:32 UTC (permalink / raw)
  To: Santi Béjar; +Cc: git

"Santi Béjar" <sbejar@gmail.com> writes:

> On Fri, May 2, 2008 at 11:44 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Santi Béjar <sbejar@gmail.com> writes:
>>
>>  > The definition of "wrong committer" could be:
>>  >
>>  > 1) user.{name,email} or GIT_COMMITTER_{NAME,EMAIL} is not a wrong committer.
>>  > 2) automatic without a domain name (user@hostname.(none)) is a wrong committer.
>>  >    (not handled with this patch series)
>>  > 3) automatic or partially set ident:
>>  >    a) wrong committer for some users
>>  >    b) right committer for others
>>
>>  Define "partially set".
>
> one of user.{name,email} is not set.

Hmmm.  Then perhaps the list can be simplified as follows?

 * Both name and email are explicitly given (i.e. user.* or
   GIT_COMMITTER_* specifies them) --- no complaints.

 * For email, ending with ".(none)" and "@" followed by something without
   a dot is wrong but everything else are Ok.

 * Everything else falls into (3)

There is no "partially" then.

By the way, wasn't it you who wanted to refuse use of user.name _and_
user.email that come from ~/.gitconfig, so that you can be sure you use
different pseudonym for each project?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] Show committer ident in some cases
  2008-05-02 22:32     ` Junio C Hamano
@ 2008-05-03 10:18       ` Santi Béjar
  0 siblings, 0 replies; 11+ messages in thread
From: Santi Béjar @ 2008-05-03 10:18 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

>
>  By the way, wasn't it you who wanted to refuse use of user.name _and_
>  user.email that come from ~/.gitconfig, so that you can be sure you use
>  different pseudonym for each project?
>

Yes, that's me. But what I wanted was to refuse the use of the
automatic setting.

Santi

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] commit: Show committer if automatic
  2008-05-02 18:22 ` [PATCH 1/2] commit: Show committer if automatic Santi Béjar
@ 2008-05-03 18:33   ` Junio C Hamano
  2008-05-03 20:28     ` Santi Béjar
  0 siblings, 1 reply; 11+ messages in thread
From: Junio C Hamano @ 2008-05-03 18:33 UTC (permalink / raw)
  To: Santi Béjar; +Cc: git

Santi Béjar <sbejar@gmail.com> writes:

> To remind the committer ident in case it is not what you want
> (taken from the gecos field, want to use different ident in
> different repositories).

That's not the only thing this patch does.

> Signed-off-by: Santi Béjar <sbejar@gmail.com>
> ---
>  builtin-commit.c  |   40 +++++++++++++++++++++++++++++++++++++---
>  cache.h           |    1 +
>  config.c          |    4 ++++
>  environment.c     |    1 +
>  ident.c           |    3 +++
>  t/t7502-commit.sh |   13 +++++++++++++
>  6 files changed, 59 insertions(+), 3 deletions(-)
>
> diff --git a/builtin-commit.c b/builtin-commit.c
> index 057749b..b7cc382 100644
> --- a/builtin-commit.c
> +++ b/builtin-commit.c
> @@ -437,6 +437,29 @@ static void determine_author_info()
>  	author_date = date;
>  }
>  
> +const char *get_parent_ident()
> +{
> +	unsigned char sha1[20];
> +	struct commit *commit;
> +	const char *a, *lb, *rb, *eol;
> +
> +
> +	get_sha1("HEAD", sha1);
> +	commit = lookup_commit_reference(sha1);
> +	if (!commit)
> +		return NULL;
> +
> +	a = strstr(commit->buffer, "\ncommitter ");
> +
> +	lb = strstr(a + 11, " <");
> +	rb = strstr(a + 11, "> ");
> +	eol = strchr(a + 11, '\n');
> +	if (!lb || !rb || !eol)
> +		return NULL;
> +
> +	return xstrndup(a + 11, rb + 1 - (a + 11));
> +}
> +

Drop this hunk; nobody uses it after applying this patch, and "the same
committer as the HEAD commit" is not a good heuristic.

>  static int prepare_to_commit(const char *index_file, const char *prefix)
>  {
>  	struct stat statbuf;
> @@ -448,6 +471,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
>  	const char *hook_arg2 = NULL;
>  	const char *author_ident;
>  	const char *committer_ident;
> +	int showed_ident = 0;
>  
>  	if (!no_verify && run_hook(index_file, "pre-commit", NULL))
>  		return 0;
> @@ -528,6 +552,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
>  	strbuf_release(&sb);
>  
>  	determine_author_info();
> +	git_committer_info(0);

This call needs a comment to justify it, as it feels wrong to call a
function that usually is used for its return string and discard the return
value.

> @@ -558,11 +583,20 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
>  					 getenv("GIT_COMMITTER_EMAIL")));
>  		if (strcmp(author_ident, committer_ident))
>  			fprintf(fp,
> -				"#\n"
> -				"# Author:    %s\n"
> -				"#\n",
> +				"%s"
> +				"# Author:    %s\n",
> +				showed_ident++ ? "" : "#\n",
>  				fmt_name(author_name, author_email));

This part should have been [0/2] as it has been agreed it is a good idea.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] commit: Show committer if automatic
  2008-05-03 18:33   ` Junio C Hamano
@ 2008-05-03 20:28     ` Santi Béjar
  0 siblings, 0 replies; 11+ messages in thread
From: Santi Béjar @ 2008-05-03 20:28 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Sat, May 3, 2008 at 8:33 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Santi Béjar <sbejar@gmail.com> writes:

[...]

>
>  >  static int prepare_to_commit(const char *index_file, const char *prefix)
>  >  {
>  >       struct stat statbuf;
>  > @@ -448,6 +471,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
>  >       const char *hook_arg2 = NULL;
>  >       const char *author_ident;
>  >       const char *committer_ident;
>  > +     int showed_ident = 0;
>  >
>  >       if (!no_verify && run_hook(index_file, "pre-commit", NULL))
>  >               return 0;
>  > @@ -528,6 +552,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
>  >       strbuf_release(&sb);
>  >
>  >       determine_author_info();
>  > +     git_committer_info(0);
>
>  This call needs a comment to justify it, as it feels wrong to call a
>  function that usually is used for its return string and discard the return
>  value.

In the code or in the commit message.

/* To know if the committer ident is automatic */

I did it this way to have the knowledge about the automatic setting in
git_committer_info.

>
>
>  > @@ -558,11 +583,20 @@ static int prepare_to_commit(const char *index_file, const char *prefix)
>  >                                        getenv("GIT_COMMITTER_EMAIL")));
>  >               if (strcmp(author_ident, committer_ident))
>  >                       fprintf(fp,
>  > -                             "#\n"
>  > -                             "# Author:    %s\n"
>  > -                             "#\n",
>  > +                             "%s"
>  > +                             "# Author:    %s\n",
>  > +                             showed_ident++ ? "" : "#\n",
>  >                               fmt_name(author_name, author_email));
>
>  This part should have been [0/2] as it has been agreed it is a good idea.

Sorry, I should have said to this series was on top of:

[PATCHv2 2/3] commit: Show author if different from committer

I'll send a series with this include and the corrections.

Santi

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] Show committer ident in some cases
  2008-05-02 18:22 [PATCH 0/2] Show committer ident in some cases Santi Béjar
                   ` (2 preceding siblings ...)
  2008-05-02 21:44 ` [PATCH 0/2] Show committer ident in some cases Junio C Hamano
@ 2008-05-05  3:30 ` Jeff King
  2008-05-05  5:23   ` Junio C Hamano
  3 siblings, 1 reply; 11+ messages in thread
From: Jeff King @ 2008-05-05  3:30 UTC (permalink / raw)
  To: Santi Béjar; +Cc: git

On Fri, May 02, 2008 at 08:22:19PM +0200, Santi Béjar wrote:

> The different strategies are.. Show the committer:
> 
> 1) always
> 2) when user.warn = yes (defaulting to yes)
> 3) when it is automatic
>    a) always
>    b) and different from parent
>    c) and different from a list of valid committer idents
>    d) and when user.WarnAutomatic = yes (defaulting to yes)
> 
> The first patch implements 3a
> The second patch implements 3d
> 
> I prefer 3a.

I haven't kept up to date very well with this patch, but let me add a
(possibly belated) addendum to my earlier comments: I like 3a, and I
think it addresses the issues I brought up in earlier revisions.

-Peff

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] Show committer ident in some cases
  2008-05-05  3:30 ` Jeff King
@ 2008-05-05  5:23   ` Junio C Hamano
  0 siblings, 0 replies; 11+ messages in thread
From: Junio C Hamano @ 2008-05-05  5:23 UTC (permalink / raw)
  To: Jeff King; +Cc: Santi Béjar, git

Jeff King <peff@peff.net> writes:

> On Fri, May 02, 2008 at 08:22:19PM +0200, Santi Béjar wrote:
>
>> The different strategies are.. Show the committer:
>> 
>> 1) always
>> 2) when user.warn = yes (defaulting to yes)
>> 3) when it is automatic
>>    a) always
>>    b) and different from parent
>>    c) and different from a list of valid committer idents
>>    d) and when user.WarnAutomatic = yes (defaulting to yes)
>> 
>> The first patch implements 3a
>> The second patch implements 3d
>> 
>> I prefer 3a.
>
> I haven't kept up to date very well with this patch, but let me add a
> (possibly belated) addendum to my earlier comments: I like 3a, and I
> think it addresses the issues I brought up in earlier revisions.

I tend to agree.

I usually _really_ hate any patch that adds noise that punishes people
whose system is configured and maintained well.

The 3a approach punishes people on a well maintained system where you
would get a good value out of GECOS and gethostname(2) by forcing them to
duplicate the information in their .git/config (or $HOME/.gitconfig).  So
I should be hating the idea, but I think alternatives are much worse than
that, and it is the least problematic.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-05-05  5:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-02 18:22 [PATCH 0/2] Show committer ident in some cases Santi Béjar
2008-05-02 18:22 ` [PATCH 1/2] commit: Show committer if automatic Santi Béjar
2008-05-03 18:33   ` Junio C Hamano
2008-05-03 20:28     ` Santi Béjar
2008-05-02 18:22 ` [PATCH 2/2] user.warnautomatic: add config to control if the committer ident is shown Santi Béjar
2008-05-02 21:44 ` [PATCH 0/2] Show committer ident in some cases Junio C Hamano
2008-05-02 22:07   ` Santi Béjar
2008-05-02 22:32     ` Junio C Hamano
2008-05-03 10:18       ` Santi Béjar
2008-05-05  3:30 ` Jeff King
2008-05-05  5:23   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).