summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3f01ad6)
raw | patch | inline | side by side (parent: 3f01ad6)
author | Nanako Shiraishi <nanako3@lavabit.com> | |
Sat, 24 Jan 2009 01:18:02 +0000 (10:18 +0900) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 26 Jan 2009 02:56:13 +0000 (18:56 -0800) |
This new option tells 'git-am' to ignore the date header field
recorded in the format-patch output. The commits will have the
timestamp when they are created instead.
You can work a lot in one day to accumulate many changes, but
apply and push to the public repository only some of them at
the end of the first day. Then next day you can spend all your
working hours reading comics or chatting with your coworkers,
and apply your remaining patches from the previous day using
this option to pretend that you have been working at the end
of the day.
Signed-off-by: しらいしななこ <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
recorded in the format-patch output. The commits will have the
timestamp when they are created instead.
You can work a lot in one day to accumulate many changes, but
apply and push to the public repository only some of them at
the end of the first day. Then next day you can spend all your
working hours reading comics or chatting with your coworkers,
and apply your remaining patches from the previous day using
this option to pretend that you have been working at the end
of the day.
Signed-off-by: しらいしななこ <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-am.txt | patch | blob | history | |
git-am.sh | patch | blob | history | |
t/t4150-am.sh | patch | blob | history |
index efd311b1ceec1653281441b232da04decd122bc3..ff307eb27098fd89f718055f2211164da3e0be30 100644 (file)
--- a/Documentation/git-am.txt
+++ b/Documentation/git-am.txt
--------
[verse]
'git am' [--signoff] [--keep] [--utf8 | --no-utf8]
- [--3way] [--interactive]
+ [--3way] [--interactive] [--committer-date-is-author-date]
+ [--ignore-date]
[--whitespace=<option>] [-C<n>] [-p<n>] [--directory=<dir>]
[--reject]
[<mbox> | <Maildir>...]
--interactive::
Run interactively.
+--committer-date-is-author-date::
+ By default the command records the date from the e-mail
+ message as the commit author date, and uses the time of
+ commit creation as the committer date. This allows the
+ user to lie about the committer date by using the same
+ timestamp as the author date.
+
+--ignore-date::
+ By default the command records the date from the e-mail
+ message as the commit author date, and uses the time of
+ commit creation as the committer date. This allows the
+ user to lie about author timestamp by using the same
+ timestamp as the committer date.
+
--skip::
Skip the current patch. This is only meaningful when
restarting an aborted patch.
diff --git a/git-am.sh b/git-am.sh
index e726f171414cfe27e14b068a2eab1de5303209bc..1e40ce92e62cc0972cc60ed7f06dff07ec37a9a3 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
skip skip the current patch
abort restore the original branch and abort the patching operation.
committer-date-is-author-date lie about committer date
+ignore-date use current timestamp for author date
rebasing (internal use for git-rebase)"
. git-sh-setup
resolvemsg= resume=
git_apply_opt=
committer_date_is_author_date=
+ignore_date=
while test $# != 0
do
git_apply_opt="$git_apply_opt $1" ;;
--committer-date-is-author-date)
committer_date_is_author_date=t ;;
+ --ignore-date)
+ ignore_date=t ;;
--)
shift; break ;;
*)
tree=$(git write-tree) &&
parent=$(git rev-parse --verify HEAD) &&
commit=$(
+ if test -n "$ignore_date"
+ then
+ GIT_AUTHOR_DATE=
+ fi
if test -n "$committer_date_is_author_date"
then
GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 8d3fb00cd9d34cc42c50d70aef9fad56558b7972..5e65afa0c10d02e50c79b550a3c142d8ff1f0674 100755 (executable)
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
test "$at" != "$ct"
'
+# This checks for +0000 because TZ is set to UTC and that should
+# show up when the current time is used. The date in message is set
+# by test_tick that uses -0700 timezone; if this feature does not
+# work, we will see that instead of +0000.
+test_expect_success 'am --ignore-date' '
+ git checkout first &&
+ test_tick &&
+ git am --ignore-date patch1 &&
+ git cat-file commit HEAD | sed -e "/^$/q" >head1 &&
+ at=$(sed -ne "/^author /s/.*> //p" head1) &&
+ echo "$at" | grep "+0000"
+'
+
test_done