Function: magit-commit-reshelve
magit-commit-reshelve is an autoloaded, interactive and byte-compiled
function defined in magit-commit.el.
Signature
(magit-commit-reshelve DATE UPDATE-AUTHOR &optional ARGS)
Documentation
Change committer (and possibly author) date of the last commit.
The current time is used as the initial minibuffer input and the original author or committer date is available as the previous history element.
Both the author and the committer dates are changed, unless one
of the following is true, in which case only the committer date
is updated:
- You are not the author of the commit that is being reshelved.
- The command was invoked with a prefix argument.
- Non-interactively if UPDATE-AUTHOR is nil.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-commit.el
;;;###autoload
(defun magit-commit-reshelve (date update-author &optional args)
"Change committer (and possibly author) date of the last commit.
The current time is used as the initial minibuffer input and the
original author or committer date is available as the previous
history element.
Both the author and the committer dates are changed, unless one
of the following is true, in which case only the committer date
is updated:
- You are not the author of the commit that is being reshelved.
- The command was invoked with a prefix argument.
- Non-interactively if UPDATE-AUTHOR is nil."
(interactive
(let ((update-author (and (magit-rev-author-p "HEAD")
(not current-prefix-arg))))
(push (magit-rev-format (if update-author "%ad" "%cd") "HEAD"
(concat "--date=format:%F %T %z"))
magit--reshelve-history)
(list (read-string (if update-author
"Change author and committer dates to: "
"Change committer date to: ")
(cons (format-time-string "%F %T %z") 17)
'magit--reshelve-history)
update-author
(magit-commit-arguments))))
(with-environment-variables (("GIT_COMMITTER_DATE" date))
(magit-run-git "commit" "--amend" "--no-edit"
(and update-author (concat "--date=" date))
args)))