Mercurial Queues Emulation for Git
修訂 | f7dc1b98cfc8a369f4651860fa4e03f806ac79ba (tree) |
---|---|
時間 | 2022-02-12 03:11:54 |
作者 | Keith Marshall <keith@user...> |
Commiter | Keith Marshall |
Update commit timestamp on "git qrefresh" or "git qfold".
* git-mq-write-patch.sh [git qfold, git qrefresh]
[mq_commit_date unassigned] (mq_commit_date): Assign as "now", in the
form produced by running the "date +'%s %z'" command.
@@ -10,7 +10,7 @@ | ||
10 | 10 | # $Id$ |
11 | 11 | # |
12 | 12 | # Written by Keith Marshall <keith@users.osdn.me> |
13 | -# Copyright (C) 2019, Keith Marshall | |
13 | +# Copyright (C) 2019, 2022, Keith Marshall | |
14 | 14 | # |
15 | 15 | # |
16 | 16 | # This file is part of the Git-MQ program suite. |
@@ -50,6 +50,16 @@ | ||
50 | 50 | eval ${mq_commit_date+'mq_collect mq_commit_opts "$mq_commit_date"'} |
51 | 51 | eval ${mq_commit_user+'mq_collect mq_commit_opts "$mq_commit_user"'} |
52 | 52 | |
53 | +# Conversely, when performing a "git qfold", or a "git qrefresh", if | |
54 | +# the "mq_commit_date" has not be pre-assigned, we must set the date | |
55 | +# for the amended commit, to reflect the current date and time. | |
56 | +# | |
57 | + case "$mq_facility" in "git qfold" | "git qrefresh") | |
58 | + test -n "$mq_commit_date" || | |
59 | + mq_collect mq_commit_opts "--date='`date +'%s %z'`'" | |
60 | + ;; | |
61 | + esac | |
62 | + | |
53 | 63 | # We are now ready to create, or amend, the commit, whence the patch |
54 | 64 | # file itself will be generated; note that the handling of file name |
55 | 65 | # arguments differs between "git qnew", in which case "mq_args" will |