aboutsummaryrefslogtreecommitdiff
path: root/git-am.sh
diff options
context:
space:
mode:
authorNanako Shiraishi <nanako3@lavabit.com>2009-01-24 10:18:02 +0900
committerJunio C Hamano <gitster@pobox.com>2009-01-25 18:56:13 -0800
commita79ec62d064e32b5c3979a16d215fdb70fe965c0 (patch)
treee08668c5bef03d045bb4d32ccbef4ad766951be7 /git-am.sh
parent3f01ad665493e09aa816d84a872d9874f33a8c16 (diff)
downloadgit-a79ec62d064e32b5c3979a16d215fdb70fe965c0.tar.gz
git-a79ec62d064e32b5c3979a16d215fdb70fe965c0.tar.xz
git-am: Add --ignore-date option
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>
Diffstat (limited to 'git-am.sh')
-rwxr-xr-xgit-am.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/git-am.sh b/git-am.sh
index e726f1714..1e40ce92e 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -25,6 +25,7 @@ r,resolved to be used after a patch failure
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
@@ -136,6 +137,7 @@ sign= utf8=t keep= skip= interactive= resolved= rebasing= abort=
resolvemsg= resume=
git_apply_opt=
committer_date_is_author_date=
+ignore_date=
while test $# != 0
do
@@ -175,6 +177,8 @@ 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 ;;
*)
@@ -529,6 +533,10 @@ do
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"