summaryrefslogtreecommitdiff
path: root/git-am.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-02-04 13:07:02 -0800
committerJunio C Hamano <gitster@pobox.com>2009-02-04 13:07:02 -0800
commita4f004bffcea5b2cd8671738305962afe7b1d08f (patch)
tree2116e03bd949b3bb4c6e50f5088b1192706e19eb /git-am.sh
parentb63bc0bc3152ca42ba1c9fa9bed73da061beeca2 (diff)
parenta79ec62d064e32b5c3979a16d215fdb70fe965c0 (diff)
downloadgit-a4f004bffcea5b2cd8671738305962afe7b1d08f.tar.gz
Merge branch 'ns/am-slacker'
* ns/am-slacker: git-am: Add --ignore-date option am: Add --committer-date-is-author-date option Conflicts: git-am.sh
Diffstat (limited to 'git-am.sh')
-rwxr-xr-xgit-am.sh21
1 files changed, 20 insertions, 1 deletions
diff --git a/git-am.sh b/git-am.sh
index b598b4332a..8bcb206022 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -23,6 +23,8 @@ resolvemsg= override error message when patch failure occurs
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
@@ -133,6 +135,8 @@ dotest="$GIT_DIR/rebase-apply"
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
@@ -170,6 +174,10 @@ do
git_apply_opt="$git_apply_opt $(sq "$1$2")"; shift ;;
--reject)
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 ;;
*)
@@ -520,7 +528,18 @@ do
tree=$(git write-tree) &&
parent=$(git rev-parse --verify HEAD) &&
- commit=$(git commit-tree $tree -p $parent <"$dotest/final-commit") &&
+ 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"
+ export GIT_COMMITTER_DATE
+ fi &&
+ git commit-tree $tree -p $parent <"$dotest/final-commit"
+ ) &&
git update-ref -m "$GIT_REFLOG_ACTION: $FIRSTLINE" HEAD $commit $parent ||
stop_here $this