Thread (47 messages) flat view 47 messages, 2 authors, 2016-06-15
STALE3729d

Revision v6 of 4 in this series.

Revisions (4)
  1. v4 [diff vs current]
  2. v5 [diff vs current]
  3. v6 current
  4. v7 [diff vs current]

[PATCH v6 44/45] builtin-am: check for valid committer ident

From: Paul Tan <hidden>
Date: 2016-06-15 23:05:49
Subsystem: the rest · Maintainer: Linus Torvalds

When commit_tree() is called, if the user does not have an explicit
committer ident configured, it will attempt to construct a default
committer ident based on the user's and system's info (e.g. gecos field,
hostname etc.) However, if a default committer ident is unable to be
constructed, commit_tree() will die(), but at this point of git-am's
execution, there will already be changes made to the index and work
tree.

This can be confusing to new users, and as such since d64e6b0 (Keep
Porcelainish from failing by broken ident after making changes.,
2006-02-18) git-am.sh will check to see if the committer ident has been
configured, or a default one can be constructed, before even starting to
apply patches.

Re-implement this in builtin/am.c.

Signed-off-by: Paul Tan <redacted>
---
 builtin/am.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/builtin/am.c b/builtin/am.c
index 6a2b887..1fe2c65 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -2247,6 +2247,9 @@ int cmd_am(int argc, const char **argv, const char *prefix)
 		fprintf_ln(stderr, _("The -b/--binary option has been a no-op for long time, and\n"
 				"it will be removed. Please do not use it anymore."));
 
+	/* Ensure a valid committer ident can be constructed */
+	git_committer_info(IDENT_STRICT);
+
 	if (read_index_preload(&the_index, NULL) < 0)
 		die(_("failed to read the index"));
 
-- 
2.5.0.rc2.110.gb39b692
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help