Thread (45 messages) flat view 45 messages, 3 authors, 2016-06-15
STALE3732d

Revision v3 of 5 in this series.

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

[PATCH/WIP v3 29/31] am: implement --ignore-date

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

Since a79ec62 (git-am: Add --ignore-date option, 2009-01-24), git-am.sh
supported the --ignore-date option, and would use the current timestamp
instead of the one provided in the patch if the option was set.

Re-implement this option in builtin/am.c.

Signed-off-by: Paul Tan <redacted>
---
 builtin/am.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/builtin/am.c b/builtin/am.c
index 3556765..6623b49 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -130,6 +130,8 @@ struct am_state {
 	/* override error message when patch failure occurs */
 	const char *resolvemsg;
 
+	int ignore_date;
+
 	int rebasing;
 };
 
@@ -1131,7 +1133,8 @@ static void do_commit(const struct am_state *state)
 	}
 
 	author = fmt_ident(state->author_name.buf, state->author_email.buf,
-			state->author_date.buf, IDENT_STRICT);
+			state->ignore_date ? NULL : state->author_date.buf,
+			IDENT_STRICT);
 
 	if (commit_tree(state->msg.buf, state->msg.len, tree, parents, commit,
 				author, NULL))
@@ -1521,6 +1524,8 @@ static struct option am_options[] = {
 	OPT_CMDMODE(0, "abort", &opt_resume,
 		N_("restore the original branch and abort the patching operation."),
 		RESUME_ABORT),
+	OPT_BOOL(0, "ignore-date", &state.ignore_date,
+		N_("use current timestamp for author date")),
 	OPT_HIDDEN_BOOL(0, "rebasing", &state.rebasing,
 		N_("(internal use for git-rebase)")),
 	OPT_END()
-- 
2.1.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help