From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH 10/10] commit: show "Author:" hint when the ident is not given explicitly
Date: Wed, 14 Jan 2015 15:40:55 -0800 [thread overview]
Message-ID: <1421278855-8126-11-git-send-email-gitster@pobox.com> (raw)
In-Reply-To: <1421278855-8126-1-git-send-email-gitster@pobox.com>
This is a knee-jerk response to two facts:
- the author_ident_sufficiently_given() function is public but
nobody uses it;
- a corresponding function committer_ident_sufficiently_given() is
used to determine when to add "Committer: " reminder in the log
message editor.
The existing logic decides to show "Author:" reminder when the
author is different from the committer, so there won't be practical
difference other than we would end up showing both reminders when a
committer with iffy name derived from the heuristic is committing
her own patch.
Which means this patch probably should be dropped.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin/commit.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/builtin/commit.c b/builtin/commit.c
index 7d90c35..b512504 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -847,7 +847,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
assert_split_ident(&ai, author_ident);
assert_split_ident(&ci, &committer_ident);
- if (ident_cmp(&ai, &ci))
+ if (ident_cmp(&ai, &ci) ||
+ !author_ident_sufficiently_given())
status_printf_ln(s, GIT_COLOR_NORMAL,
_("%s"
"Author: %.*s <%.*s>"),
@@ -1440,7 +1441,8 @@ static void print_summary(const char *prefix, const unsigned char *sha1,
format_commit_message(commit, "%an <%ae>", &author_ident, &pctx);
format_commit_message(commit, "%cn <%ce>", &committer_ident, &pctx);
- if (strbuf_cmp(&author_ident, &committer_ident)) {
+ if (strbuf_cmp(&author_ident, &committer_ident) ||
+ !author_ident_sufficiently_given()) {
strbuf_addstr(&format, "\n Author: ");
strbuf_addbuf_percentquote(&format, &author_ident);
}
--
2.3.0-rc0-134-g109a908
next prev parent reply other threads:[~2015-01-14 23:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-14 23:40 [PATCH 00/10] mark private symbols static Junio C Hamano
2015-01-14 23:40 ` [PATCH 01/10] http.c: make finish_active_slot() and handle_curl_result() static Junio C Hamano
2015-01-15 6:41 ` Jeff King
2015-01-14 23:40 ` [PATCH 02/10] line-log.c: make line_log_data_init() static Junio C Hamano
2015-01-14 23:40 ` [PATCH 03/10] prompt.c: remove git_getpass() nobody uses Junio C Hamano
2015-01-15 6:47 ` Jeff King
2015-01-14 23:40 ` [PATCH 04/10] revision.c: make save_parents() and free_saved_parents() static Junio C Hamano
2015-01-14 23:40 ` [PATCH 05/10] urlmatch.c: make match_urls() static Junio C Hamano
2015-01-15 6:49 ` Jeff King
2015-01-14 23:40 ` [PATCH 06/10] remote.c: make clear_cas_option() static Junio C Hamano
2015-01-14 23:40 ` [PATCH 07/10] shallow.c: make check_shallow_file_for_update() static Junio C Hamano
2015-01-14 23:40 ` [PATCH 08/10] pack-bitmap.c: make pack_bitmap_filename() static Junio C Hamano
2015-01-15 6:51 ` Jeff King
2015-01-14 23:40 ` [PATCH 09/10] read-cache.c: make fill/match_stat_data() static Junio C Hamano
2015-01-14 23:40 ` Junio C Hamano [this message]
2015-01-15 7:17 ` [PATCH 10/10] commit: show "Author:" hint when the ident is not given explicitly Jeff King
2015-01-15 0:07 ` [PATCH 00/10] mark private symbols static Stefan Beller
2015-01-15 7:18 ` Jeff King
2015-01-15 17:52 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1421278855-8126-11-git-send-email-gitster@pobox.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).