Function: magit-commit-extend

magit-commit-extend is an autoloaded, interactive and byte-compiled function defined in magit-commit.el.

Signature

(magit-commit-extend &optional ARGS OVERRIDE-DATE)

Documentation

Amend staged changes to the last commit, without editing its message.

With a prefix argument do not update the committer date; without an argument update it. The option magit-commit-extend-override-date can be used to inverse the meaning of the prefix argument. Called non-interactively, the optional OVERRIDE-DATE argument controls this behavior, and the option is of no relevance.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-commit.el
;;;; Edit HEAD

;;;###autoload
(defun magit-commit-extend (&optional args override-date)
  "Amend staged changes to the last commit, without editing its message.

With a prefix argument do not update the committer date; without an
argument update it.  The option `magit-commit-extend-override-date'
can be used to inverse the meaning of the prefix argument.  Called
non-interactively, the optional OVERRIDE-DATE argument controls this
behavior, and the option is of no relevance."
  (interactive (list (magit-commit-arguments)
                     (if current-prefix-arg
                         (not magit-commit-extend-override-date)
                       magit-commit-extend-override-date)))
  (when (setq args (magit-commit-assert args))
    (magit-commit-amend-assert)
    (if override-date
        (magit-run-git-with-editor "commit" "--amend" "--no-edit" args)
      (with-environment-variables
          (("GIT_COMMITTER_DATE" (magit-rev-format "%cD")))
        (magit-run-git-with-editor "commit" "--amend" "--no-edit" args)))))