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>
This commit is contained in:
Nanako Shiraishi
2009-01-24 10:18:02 +09:00
committed by Junio C Hamano
parent 3f01ad6654
commit a79ec62d06
3 changed files with 37 additions and 1 deletions

View File

@ -277,4 +277,17 @@ test_expect_success 'am without --committer-date-is-author-date' '
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