update packages
This commit is contained in:
@@ -169,6 +169,7 @@ All Contributors
|
||||
- Hannu Koivisto
|
||||
- Hans-Peter Deifel
|
||||
- hokomo
|
||||
- Huon Wilson
|
||||
- Hussein Ait-Lahcen
|
||||
- Ian Eure
|
||||
- Ian Milligan
|
||||
|
||||
@@ -216,36 +216,6 @@ Also note that `git-commit-mode' (which see) is not a major-mode.")
|
||||
git-commit-propertize-diff
|
||||
bug-reference-mode))
|
||||
|
||||
(defcustom git-commit-post-finish-hook nil
|
||||
"Hook run after the user finished writing a commit message.
|
||||
|
||||
\\<with-editor-mode-map>\
|
||||
This hook is only run after pressing \\[with-editor-finish] in a buffer used
|
||||
to edit a commit message. If a commit is created without the
|
||||
user typing a message into a buffer, then this hook is not run.
|
||||
|
||||
This hook is not run until the new commit has been created. If
|
||||
that takes Git longer than `git-commit-post-finish-hook-timeout'
|
||||
seconds, then this hook isn't run at all. For certain commands
|
||||
such as `magit-rebase-continue' this hook is never run because
|
||||
doing so would lead to a race condition.
|
||||
|
||||
Also see `magit-post-commit-hook'."
|
||||
:group 'git-commit
|
||||
:type 'hook
|
||||
:get #'magit-hook-custom-get)
|
||||
|
||||
(defcustom git-commit-post-finish-hook-timeout 2
|
||||
"Time in seconds to wait for git to create a commit.
|
||||
|
||||
The hook `git-commit-post-finish-hook' (which see) is run only
|
||||
after git is done creating a commit. If it takes longer than
|
||||
`git-commit-post-finish-hook-timeout' seconds to create the
|
||||
commit, then the hook is not run at all."
|
||||
:group 'git-commit
|
||||
:safe 'numberp
|
||||
:type 'number)
|
||||
|
||||
(defcustom git-commit-finish-query-functions
|
||||
(list #'git-commit-check-style-conventions)
|
||||
"List of functions called to query before performing commit.
|
||||
@@ -586,17 +556,7 @@ Used as the local value of `header-line-format', in buffer using
|
||||
(when (fboundp 'magit-commit--reset-command)
|
||||
(add-hook 'with-editor-post-finish-hook #'magit-commit--reset-command)
|
||||
(add-hook 'with-editor-post-cancel-hook #'magit-commit--reset-command))
|
||||
(unless (memq last-command
|
||||
'(magit-sequencer-continue
|
||||
magit-sequencer-skip
|
||||
magit-am-continue
|
||||
magit-am-skip
|
||||
magit-rebase-continue
|
||||
magit-rebase-skip))
|
||||
(add-hook 'with-editor-post-finish-hook
|
||||
(apply-partially #'git-commit-run-post-finish-hook
|
||||
(magit-rev-parse "HEAD"))
|
||||
nil t))
|
||||
(git-commit-add-post-finish-hook)
|
||||
(setq with-editor-cancel-message
|
||||
#'git-commit-cancel-message)
|
||||
(git-commit-setup-font-lock)
|
||||
@@ -615,17 +575,6 @@ Used as the local value of `header-line-format', in buffer using
|
||||
(setq with-editor-usage-message git-commit-usage-message))
|
||||
(with-editor-usage-message))
|
||||
|
||||
(defun git-commit-run-post-finish-hook (previous)
|
||||
(when git-commit-post-finish-hook
|
||||
(if (with-timeout (git-commit-post-finish-hook-timeout)
|
||||
(while (equal (magit-rev-parse "HEAD") previous)
|
||||
(sit-for 0.01))
|
||||
t)
|
||||
(run-hooks 'git-commit-post-finish-hook)
|
||||
(message "No commit created after %s second. Not running %s."
|
||||
git-commit-post-finish-hook-timeout
|
||||
'git-commit-post-finish-hook))))
|
||||
|
||||
(define-minor-mode git-commit-mode
|
||||
"Auxiliary minor mode used when editing Git commit messages.
|
||||
This mode is only responsible for setting up some key bindings.
|
||||
@@ -1201,6 +1150,62 @@ Elisp doc-strings, including this one. Unlike in doc-strings,
|
||||
(1 font-lock-constant-face prepend))
|
||||
("\"[^\"]*\"" (0 font-lock-string-face prepend))))
|
||||
|
||||
;;; Post Hook
|
||||
|
||||
(defcustom git-commit-post-finish-hook nil
|
||||
"Hook run after the user finished writing a commit message.
|
||||
|
||||
\\<with-editor-mode-map>\
|
||||
This hook is only run after pressing \\[with-editor-finish] in a buffer used
|
||||
to edit a commit message. If a commit is created without the
|
||||
user typing a message into a buffer, then this hook is not run.
|
||||
|
||||
This hook is not run until the new commit has been created. If
|
||||
that takes Git longer than `git-commit-post-finish-hook-timeout'
|
||||
seconds, then this hook isn't run at all. For certain commands
|
||||
such as `magit-rebase-continue' this hook is never run because
|
||||
doing so would lead to a race condition.
|
||||
|
||||
Also see `magit-post-commit-hook'."
|
||||
:group 'git-commit
|
||||
:type 'hook
|
||||
:get #'magit-hook-custom-get)
|
||||
|
||||
(defcustom git-commit-post-finish-hook-timeout 2
|
||||
"Time in seconds to wait for git to create a commit.
|
||||
|
||||
The hook `git-commit-post-finish-hook' (which see) is run only
|
||||
after git is done creating a commit. If it takes longer than
|
||||
`git-commit-post-finish-hook-timeout' seconds to create the
|
||||
commit, then the hook is not run at all."
|
||||
:group 'git-commit
|
||||
:safe 'numberp
|
||||
:type 'number)
|
||||
|
||||
(defun git-commit-add-post-finish-hook ()
|
||||
(unless (memq last-command
|
||||
'(magit-sequencer-continue
|
||||
magit-sequencer-skip
|
||||
magit-am-continue
|
||||
magit-am-skip
|
||||
magit-rebase-continue
|
||||
magit-rebase-skip))
|
||||
(add-hook 'with-editor-post-finish-hook
|
||||
(apply-partially #'git-commit-run-post-finish-hook
|
||||
(magit-rev-parse "HEAD"))
|
||||
nil t)))
|
||||
|
||||
(defun git-commit-run-post-finish-hook (previous)
|
||||
(when git-commit-post-finish-hook
|
||||
(if (with-timeout (git-commit-post-finish-hook-timeout)
|
||||
(while (equal (magit-rev-parse "HEAD") previous)
|
||||
(sit-for 0.01))
|
||||
t)
|
||||
(run-hooks 'git-commit-post-finish-hook)
|
||||
(message "No commit created after %s second. Not running %s."
|
||||
git-commit-post-finish-hook-timeout
|
||||
'git-commit-post-finish-hook))))
|
||||
|
||||
;;; _
|
||||
|
||||
(define-obsolete-function-alias
|
||||
|
||||
8
lisp/magit/git-hooks/applypatch-msg
Executable file
8
lisp/magit/git-hooks/applypatch-msg
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/commit-msg
Executable file
8
lisp/magit/git-hooks/commit-msg
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/fallthrough
Executable file
8
lisp/magit/git-hooks/fallthrough
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/fsmonitor-watchman
Executable file
8
lisp/magit/git-hooks/fsmonitor-watchman
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/p4-changelist
Executable file
8
lisp/magit/git-hooks/p4-changelist
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/p4-post-changelist
Executable file
8
lisp/magit/git-hooks/p4-post-changelist
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/p4-pre-submit
Executable file
8
lisp/magit/git-hooks/p4-pre-submit
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/p4-prepare-changelist
Executable file
8
lisp/magit/git-hooks/p4-prepare-changelist
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/post-applypatch
Executable file
8
lisp/magit/git-hooks/post-applypatch
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/post-checkout
Executable file
8
lisp/magit/git-hooks/post-checkout
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
13
lisp/magit/git-hooks/post-commit
Executable file
13
lisp/magit/git-hooks/post-commit
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$INSIDE_EMACS" == *magit ]]
|
||||
then
|
||||
for arg in "$@"; do args+="\"$arg\""; done
|
||||
$GIT_EDITOR --eval \
|
||||
"(magit-run-git-hook '(common-post-commit post-commit) ${args[@]})"
|
||||
fi
|
||||
|
||||
if [[ -x "$SHADOWED_GITHOOK_DIRECTORY" ]]
|
||||
then
|
||||
"$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/post-index-change
Executable file
8
lisp/magit/git-hooks/post-index-change
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
13
lisp/magit/git-hooks/post-merge
Executable file
13
lisp/magit/git-hooks/post-merge
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$INSIDE_EMACS" == *magit ]]
|
||||
then
|
||||
for arg in "$@"; do args+="\"$arg\""; done
|
||||
$GIT_EDITOR --eval \
|
||||
"(magit-run-git-hook '(common-post-commit post-merge) ${args[@]})"
|
||||
fi
|
||||
|
||||
if [[ -x "$SHADOWED_GITHOOK_DIRECTORY" ]]
|
||||
then
|
||||
"$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/post-receive
Executable file
8
lisp/magit/git-hooks/post-receive
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
13
lisp/magit/git-hooks/post-rewrite
Executable file
13
lisp/magit/git-hooks/post-rewrite
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ "$INSIDE_EMACS" == *magit ]]
|
||||
then
|
||||
for arg in "$@"; do args+="\"$arg\""; done
|
||||
$GIT_EDITOR --eval \
|
||||
"(magit-run-git-hook '(common-post-commit post-rewrite) ${args[@]})"
|
||||
fi
|
||||
|
||||
if [[ -x "$SHADOWED_GITHOOK_DIRECTORY" ]]
|
||||
then
|
||||
"$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/post-update
Executable file
8
lisp/magit/git-hooks/post-update
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/pre-applypatch
Executable file
8
lisp/magit/git-hooks/pre-applypatch
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/pre-auto-gc
Executable file
8
lisp/magit/git-hooks/pre-auto-gc
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/pre-commit
Executable file
8
lisp/magit/git-hooks/pre-commit
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/pre-merge-commit
Executable file
8
lisp/magit/git-hooks/pre-merge-commit
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/pre-push
Executable file
8
lisp/magit/git-hooks/pre-push
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/pre-rebase
Executable file
8
lisp/magit/git-hooks/pre-rebase
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/pre-receive
Executable file
8
lisp/magit/git-hooks/pre-receive
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/prepare-commit-msg
Executable file
8
lisp/magit/git-hooks/prepare-commit-msg
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/proc-receive
Executable file
8
lisp/magit/git-hooks/proc-receive
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/push-to-checkout
Executable file
8
lisp/magit/git-hooks/push-to-checkout
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/reference-transaction
Executable file
8
lisp/magit/git-hooks/reference-transaction
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/sendemail-validate
Executable file
8
lisp/magit/git-hooks/sendemail-validate
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
8
lisp/magit/git-hooks/update
Executable file
8
lisp/magit/git-hooks/update
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
hook="$SHADOWED_GITHOOK_DIRECTORY/$(basename $0)"
|
||||
|
||||
if [[ -x "$hook" ]]
|
||||
then
|
||||
"$hook" "$@"
|
||||
fi
|
||||
@@ -29,10 +29,12 @@
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'magit-process)
|
||||
|
||||
(require 'autorevert)
|
||||
|
||||
(declare-function magit-file-tracked-p "magit-git" (file))
|
||||
(declare-function magit-toplevel "magit-git" (&optional directory))
|
||||
(declare-function magit-git-executable "magit-git" ())
|
||||
|
||||
;;; Options
|
||||
|
||||
(defgroup magit-auto-revert nil
|
||||
@@ -105,43 +107,50 @@ seconds of user inactivity. That is not desirable."
|
||||
;;; Mode
|
||||
|
||||
;;;###autoload
|
||||
(progn ; magit-custom-initialize-after-init
|
||||
(defun magit-custom-initialize-after-init (symbol value)
|
||||
;; Use `apply-partially' instead of the wonders of lexical bindings,
|
||||
;; because of bugs in the autoload handling of package managers, which
|
||||
;; cause these variables to be treated as dynamic. See #5476 and #5485.
|
||||
(progn ; magit-auto-revert-mode--initialize
|
||||
(defun magit-auto-revert-mode--initialize (symbol value)
|
||||
(internal--define-uninitialized-variable symbol)
|
||||
(cond ((not after-init-time)
|
||||
(letrec ((f (apply-partially
|
||||
(lambda (symbol value)
|
||||
(ignore-errors
|
||||
(remove-hook 'after-init-hook f))
|
||||
(custom-initialize-set symbol value))
|
||||
symbol value)))
|
||||
(add-hook 'after-init-hook f)))
|
||||
((not load-file-name)
|
||||
(custom-initialize-set symbol value))
|
||||
((letrec ((f (apply-partially
|
||||
(lambda (thisfile symbol value file)
|
||||
(when (equal file thisfile)
|
||||
(ignore-errors
|
||||
(remove-hook 'after-load-functions f))
|
||||
(custom-initialize-set symbol value)))
|
||||
load-file-name symbol value)))
|
||||
(add-hook 'after-load-functions f))))))
|
||||
(if (not load-file-name)
|
||||
(custom-initialize-set symbol value)
|
||||
;; Bugs in package managers prevent the use of lexical
|
||||
;; bindings in autoloaded code. See #5476 and #5485.
|
||||
(defalias 'magit-auto-revert-mode--after-load
|
||||
(apply-partially
|
||||
(lambda (symbol value mode-file file)
|
||||
(when (equal file mode-file)
|
||||
(remove-hook 'after-load-functions
|
||||
'magit-auto-revert-mode--after-load)
|
||||
(fmakunbound 'magit-auto-revert-mode--after-load)
|
||||
(if after-init-time
|
||||
(custom-initialize-set symbol value)
|
||||
;; Delay activation in case the user disables the mode
|
||||
;; after loading this library but still during startup.
|
||||
(defalias 'magit-auto-revert-mode--after-init
|
||||
(apply-partially
|
||||
(lambda (symbol value)
|
||||
(remove-hook 'after-init-hook
|
||||
'magit-auto-revert-mode--after-init)
|
||||
(fmakunbound 'magit-auto-revert-mode--after-init)
|
||||
(custom-initialize-set symbol value))
|
||||
symbol value))
|
||||
(add-hook 'after-init-hook 'magit-auto-revert-mode--after-init))))
|
||||
symbol value load-file-name))
|
||||
(add-hook 'after-load-functions 'magit-auto-revert-mode--after-load))))
|
||||
|
||||
(defun magit-turn-on-auto-revert-mode-if-desired (&optional file)
|
||||
(cond (file
|
||||
(when-let ((buffer (find-buffer-visiting file)))
|
||||
(with-current-buffer buffer
|
||||
(magit-turn-on-auto-revert-mode-if-desired))))
|
||||
(let ((buffer (find-buffer-visiting file)))
|
||||
(when buffer
|
||||
(with-current-buffer buffer
|
||||
(magit-turn-on-auto-revert-mode-if-desired)))))
|
||||
((and (not auto-revert-mode) ; see #3014
|
||||
(not global-auto-revert-mode) ; see #3460
|
||||
buffer-file-name
|
||||
(or auto-revert-remote-files ; see #5422
|
||||
(not (file-remote-p buffer-file-name)))
|
||||
(file-readable-p buffer-file-name)
|
||||
(compat-call executable-find (magit-git-executable) t)
|
||||
(require 'magit-process)
|
||||
(executable-find (magit-git-executable) t)
|
||||
(magit-toplevel)
|
||||
(or (not magit-auto-revert-tracked-only)
|
||||
(magit-file-tracked-p buffer-file-name)))
|
||||
@@ -155,7 +164,7 @@ seconds of user inactivity. That is not desirable."
|
||||
:group 'magit-auto-revert
|
||||
:group 'magit-essentials
|
||||
:init-value (not (or global-auto-revert-mode noninteractive))
|
||||
:initialize #'magit-custom-initialize-after-init)
|
||||
:initialize #'magit-auto-revert-mode--initialize)
|
||||
|
||||
(defun magit-auto-revert-mode--disable ()
|
||||
"When enabling `global-auto-revert-mode', disable `magit-auto-revert-mode'."
|
||||
@@ -236,6 +245,7 @@ defaults to nil) for any BUFFER."
|
||||
(unless (and magit-auto-revert-toplevel
|
||||
(= (cdr magit-auto-revert-toplevel)
|
||||
magit-auto-revert-counter))
|
||||
(require 'magit-process)
|
||||
(setq magit-auto-revert-toplevel
|
||||
(cons (or (magit-toplevel) 'no-repo)
|
||||
magit-auto-revert-counter)))
|
||||
@@ -263,15 +273,5 @@ defaults to nil) for any BUFFER."
|
||||
|
||||
;;; _
|
||||
(provide 'magit-autorevert)
|
||||
;; Local Variables:
|
||||
;; read-symbol-shorthands: (
|
||||
;; ("and$" . "cond-let--and$")
|
||||
;; ("and>" . "cond-let--and>")
|
||||
;; ("and-let" . "cond-let--and-let")
|
||||
;; ("if-let" . "cond-let--if-let")
|
||||
;; ("when-let" . "cond-let--when-let")
|
||||
;; ("while-let" . "cond-let--while-let")
|
||||
;; ("match-string" . "match-string")
|
||||
;; ("match-str" . "match-string-no-properties"))
|
||||
;; End:
|
||||
;; `cond-let' intentionally not used.
|
||||
;;; magit-autorevert.el ends here
|
||||
|
||||
@@ -71,20 +71,6 @@ an error while using those is harder to recover from."
|
||||
:group 'magit-commands
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom magit-post-commit-hook nil
|
||||
"Hook run after creating a commit without the user editing a message.
|
||||
|
||||
This hook is run by `magit-refresh' if `this-command' is a member
|
||||
of `magit-post-commit-hook-commands'. This only includes commands
|
||||
named `magit-commit-*' that do *not* require that the user edits
|
||||
the commit message in a buffer and then finishes by pressing
|
||||
\\<with-editor-mode-map>\\[with-editor-finish].
|
||||
|
||||
Also see `git-commit-post-finish-hook'."
|
||||
:package-version '(magit . "2.90.0")
|
||||
:group 'magit-commands
|
||||
:type 'hook)
|
||||
|
||||
(defcustom magit-commit-diff-inhibit-same-window nil
|
||||
"Whether to inhibit use of same window when showing diff while committing.
|
||||
|
||||
@@ -113,6 +99,44 @@ Also see https://github.com/magit/magit/issues/4132."
|
||||
:group 'magit-commands
|
||||
:type 'boolean)
|
||||
|
||||
(defvar magit-common-git-post-commit-functions nil
|
||||
"Hook run by Git hooks `post-commit', `post-merge' and `post-rewrite'.
|
||||
|
||||
This hook is run if `magit-overriding-githook-directory' is non-nil.
|
||||
The functions are called with the same arguments as the Git hook.
|
||||
|
||||
This hook is still experimental.")
|
||||
|
||||
(defvar magit-git-post-commit-functions nil
|
||||
"Hook run by Git hook `post-commit'.
|
||||
|
||||
This hook is run if `magit-overriding-githook-directory' is non-nil.
|
||||
The functions are called with the same arguments as the Git hook.
|
||||
|
||||
See also `magit-common-git-post-commit-functions'.
|
||||
|
||||
This hook is still experimental.")
|
||||
|
||||
(defvar magit-git-post-merge-functions nil
|
||||
"Hook run by Git hook `post-merge'.
|
||||
|
||||
This hook is run if `magit-overriding-githook-directory' is non-nil.
|
||||
The functions are called with the same arguments as the Git hook.
|
||||
|
||||
See also `magit-common-git-post-commit-functions'.
|
||||
|
||||
This hook is still experimental.")
|
||||
|
||||
(defvar magit-git-post-rewrite-functions nil
|
||||
"Hook run by Git hook `post-rewrite'.
|
||||
|
||||
This hook is run if `magit-overriding-githook-directory' is non-nil.
|
||||
The functions are called with the same arguments as the Git hook.
|
||||
|
||||
See also `magit-common-git-post-commit-functions'.
|
||||
|
||||
This hook is still experimental.")
|
||||
|
||||
;;; Popup
|
||||
|
||||
;;;###autoload(autoload 'magit-commit "magit-commit" nil t)
|
||||
@@ -637,21 +661,6 @@ an alternative implementation."
|
||||
:argument "--strict="
|
||||
:reader #'transient-read-number-N0)
|
||||
|
||||
;;;; Hooks
|
||||
|
||||
(defvar magit-post-commit-hook-commands
|
||||
(list #'magit-commit-extend
|
||||
#'magit-commit-fixup
|
||||
#'magit-commit-augment
|
||||
#'magit-commit-instant-fixup
|
||||
#'magit-commit-instant-squash))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-run-post-commit-hook ()
|
||||
(when (and (not this-command)
|
||||
(memq last-command magit-post-commit-hook-commands))
|
||||
(run-hooks 'magit-post-commit-hook)))
|
||||
|
||||
;;; Pending Diff
|
||||
|
||||
(defun magit-commit-diff ()
|
||||
@@ -812,6 +821,35 @@ actually insert the entry."
|
||||
(insert (format "(%s): \n" defun))
|
||||
(backward-char)))))))
|
||||
|
||||
;;; Post Hook
|
||||
|
||||
(defcustom magit-post-commit-hook nil
|
||||
"Hook run after creating a commit without the user editing a message.
|
||||
|
||||
This hook is run by `magit-refresh' if `this-command' is a member
|
||||
of `magit-post-commit-hook-commands'. This only includes commands
|
||||
named `magit-commit-*' that do *not* require that the user edits
|
||||
the commit message in a buffer and then finishes by pressing
|
||||
\\<with-editor-mode-map>\\[with-editor-finish].
|
||||
|
||||
Also see `git-commit-post-finish-hook'."
|
||||
:package-version '(magit . "2.90.0")
|
||||
:group 'magit-commands
|
||||
:type 'hook)
|
||||
|
||||
(defvar magit-post-commit-hook-commands
|
||||
(list #'magit-commit-extend
|
||||
#'magit-commit-fixup
|
||||
#'magit-commit-augment
|
||||
#'magit-commit-instant-fixup
|
||||
#'magit-commit-instant-squash))
|
||||
|
||||
;;;###autoload
|
||||
(defun magit-run-post-commit-hook ()
|
||||
(when (and (not this-command)
|
||||
(memq last-command magit-post-commit-hook-commands))
|
||||
(run-hooks 'magit-post-commit-hook)))
|
||||
|
||||
;;; _
|
||||
(provide 'magit-commit)
|
||||
;; Local Variables:
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
(declare-function magit-smerge-keep-base "magit-apply" ())
|
||||
(declare-function magit-smerge-keep-lower "magit-apply" ())
|
||||
|
||||
(eval-and-compile
|
||||
(eval-and-compile ;declare slot names
|
||||
(cl-pushnew 'orig-rev eieio--known-slot-names)
|
||||
(cl-pushnew 'action-type eieio--known-slot-names)
|
||||
(cl-pushnew 'target eieio--known-slot-names))
|
||||
@@ -1794,19 +1794,19 @@ the Magit-Status buffer for DIRECTORY."
|
||||
(list new-rev new-file))))
|
||||
|
||||
(defun magit-diff-visit--position (buffer rev file goto-from goto-file)
|
||||
(and-let ((hunk (magit-diff--hunk-section)))
|
||||
(let ((line (magit-diff-hunk-line hunk goto-from))
|
||||
(column (magit-diff-hunk-column hunk goto-from)))
|
||||
(with-current-buffer buffer
|
||||
(when (and goto-file (not (equal rev "{worktree}")))
|
||||
(setq line (magit-diff-visit--offset
|
||||
file (if (equal rev "{index}") nil rev) line)))
|
||||
(save-restriction
|
||||
(widen)
|
||||
(goto-char (point-min))
|
||||
(forward-line (1- line))
|
||||
(move-to-column column)
|
||||
(point))))))
|
||||
(and-let* ((hunk (magit-diff--hunk-section))
|
||||
(line (magit-diff-hunk-line hunk goto-from))
|
||||
(column (magit-diff-hunk-column hunk goto-from)))
|
||||
(with-current-buffer buffer
|
||||
(when (and goto-file (not (equal rev "{worktree}")))
|
||||
(setq line (magit-diff-visit--offset
|
||||
file (if (equal rev "{index}") nil rev) line)))
|
||||
(save-restriction
|
||||
(widen)
|
||||
(goto-char (point-min))
|
||||
(forward-line (1- line))
|
||||
(move-to-column column)
|
||||
(point)))))
|
||||
|
||||
(defun magit-diff-hunk-line (section goto-from)
|
||||
(save-excursion
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
(require 'magit-base)
|
||||
|
||||
(require 'format-spec)
|
||||
(require 'server)
|
||||
|
||||
;; From `magit-branch'.
|
||||
(defvar magit-branch-prefer-remote-upstream)
|
||||
@@ -67,7 +68,7 @@
|
||||
;; From `magit-status'.
|
||||
(defvar magit-status-show-untracked-files)
|
||||
|
||||
(eval-and-compile
|
||||
(eval-and-compile ;declare slot names
|
||||
(cl-pushnew 'orig-rev eieio--known-slot-names)
|
||||
(cl-pushnew 'number eieio--known-slot-names))
|
||||
|
||||
@@ -94,6 +95,13 @@ this."
|
||||
:type '(choice (coding-system :tag "Coding system to decode Git output")
|
||||
(const :tag "Use system default" nil)))
|
||||
|
||||
(defun magit--early-process-lines (program &rest args)
|
||||
"Only used to initialize custom options."
|
||||
(let ((process-environment
|
||||
(append magit-git-environment process-environment)))
|
||||
(ignore-error file-missing
|
||||
(apply #'process-lines-ignore-status program args))))
|
||||
|
||||
(defvar magit-git-w32-path-hack nil
|
||||
"Alist of (EXE . (PATHENTRY)).
|
||||
This specifies what additional PATH setting needs to be added to
|
||||
@@ -105,31 +113,29 @@ successfully.")
|
||||
;; Avoid the wrappers "cmd/git.exe" and "cmd/git.cmd",
|
||||
;; which are much slower than using "bin/git.exe" directly.
|
||||
(and-let ((exec (executable-find "git")))
|
||||
(ignore-errors
|
||||
;; Git for Windows 2.x provides cygpath so we can
|
||||
;; ask it for native paths.
|
||||
(let* ((core-exe
|
||||
(car
|
||||
(process-lines
|
||||
exec "-c"
|
||||
"alias.X=!x() { which \"$1\" | cygpath -mf -; }; x"
|
||||
"X" "git")))
|
||||
(hack-entry (assoc core-exe magit-git-w32-path-hack))
|
||||
;; Running the libexec/git-core executable
|
||||
;; requires some extra PATH entries.
|
||||
(path-hack
|
||||
(list (concat "PATH="
|
||||
(car (process-lines
|
||||
exec "-c"
|
||||
"alias.P=!cygpath -wp \"$PATH\""
|
||||
"P"))))))
|
||||
;; The defcustom STANDARD expression can be
|
||||
;; evaluated many times, so make sure it is
|
||||
;; idempotent.
|
||||
(if hack-entry
|
||||
(setcdr hack-entry path-hack)
|
||||
(push (cons core-exe path-hack) magit-git-w32-path-hack))
|
||||
core-exe))))
|
||||
;; Git for Windows 2.x provides cygpath so we can
|
||||
;; ask it for native paths.
|
||||
(let* ((core-exe
|
||||
(car (magit--early-process-lines
|
||||
exec "-c"
|
||||
"alias.X=!x() { which \"$1\" | cygpath -mf -; }; x"
|
||||
"X" "git")))
|
||||
(hack-entry (assoc core-exe magit-git-w32-path-hack))
|
||||
;; Running the libexec/git-core executable
|
||||
;; requires some extra PATH entries.
|
||||
(path-hack
|
||||
(list (concat "PATH="
|
||||
(car (magit--early-process-lines
|
||||
exec "-c"
|
||||
"alias.P=!cygpath -wp \"$PATH\""
|
||||
"P"))))))
|
||||
;; The defcustom STANDARD expression can be
|
||||
;; evaluated many times, so make sure it is
|
||||
;; idempotent.
|
||||
(if hack-entry
|
||||
(setcdr hack-entry path-hack)
|
||||
(push (cons core-exe path-hack) magit-git-w32-path-hack))
|
||||
core-exe)))
|
||||
(and (eq system-type 'darwin)
|
||||
(executable-find "git"))
|
||||
"git")
|
||||
@@ -148,9 +154,52 @@ option."
|
||||
:group 'magit-process
|
||||
:type 'string)
|
||||
|
||||
(defvar magit--overriding-githook-directory nil)
|
||||
|
||||
(defcustom magit-overriding-githook-directory nil
|
||||
"Directory containing the Git hook scripts used by Magit.
|
||||
|
||||
No Magit-specific Git hook scripts are used if this is nil, which it
|
||||
is the default. This feature is still experimental.
|
||||
|
||||
Git does not allow overriding just an individual hook. It is only
|
||||
possible to point Git at an alternative directory containing hook
|
||||
scripts, using the Git variable `core.hooksPath'. When doing that,
|
||||
the hooks located in `$GIT_DIR/hooks' are ignored.
|
||||
|
||||
If `magit', use the directory containing Git hook scripts distributed
|
||||
with Magit. To counteract Git's limited granularity, Magit provides a
|
||||
script for every Git hook, most of which only run the respective script
|
||||
located in `$GIT_DIR/hooks', provided it exists and is executable.
|
||||
|
||||
A few Git hooks additionally run Lisp hooks:
|
||||
|
||||
- `post-commit' runs `magit-git-post-commit-functions'
|
||||
- `post-merge' runs `magit-git-post-merge-functions'
|
||||
- `post-rewrite' runs `magit-git-post-rewrite-functions'
|
||||
|
||||
All of these hooks also run `magit-common-git-post-rewrite-functions'.
|
||||
For many uses this hook variable is more useful than the three above.
|
||||
|
||||
If you want to teach additional Git hooks to run Lisp hooks, you have to
|
||||
copy Magit's hook script directory elsewhere, modify the hook scripts in
|
||||
question, and point this variable at the used directory.
|
||||
|
||||
Magit only sets `core.hooksPath' when calling Git asynchronously. Doing
|
||||
the same when calling Git synchronously would cause Git and Magit to wait
|
||||
on one another."
|
||||
:package-version '(magit . "4.5.0")
|
||||
:group 'magit-process
|
||||
:set (lambda (symbol value)
|
||||
(set-default-toplevel-value symbol value)
|
||||
(setq magit--overriding-githook-directory nil))
|
||||
:type '(choice (const :tag "Do not shadow Git's hook directory" nil)
|
||||
(const :tag "Use Magit's hook directory" magit)
|
||||
(directory :tag "Custom directory")))
|
||||
|
||||
(defcustom magit-git-global-arguments
|
||||
`("--no-pager" "--literal-pathspecs"
|
||||
"-c" "core.preloadindex=true"
|
||||
"-c" "core.preloadIndex=true"
|
||||
"-c" "log.showSignature=false"
|
||||
"-c" "color.ui=false"
|
||||
"-c" "color.diff=false"
|
||||
@@ -331,7 +380,11 @@ is remote."
|
||||
magit-remote-git-executable
|
||||
magit-git-executable))
|
||||
|
||||
(defun magit-process-git-arguments (args)
|
||||
(defun magit-process-git-arguments--length ()
|
||||
(+ (length magit-git-global-arguments)
|
||||
(if magit--overriding-githook-directory 2 0)))
|
||||
|
||||
(defun magit-process-git-arguments (args &optional async)
|
||||
"Prepare ARGS for a function that invokes Git.
|
||||
|
||||
Magit has many specialized functions for running Git; they all
|
||||
@@ -339,9 +392,27 @@ pass arguments through this function before handing them to Git,
|
||||
to do the following.
|
||||
|
||||
* Prepend `magit-git-global-arguments' to ARGS.
|
||||
* If ASYNC is non-nil and `magit-overriding-githook-directory' is non-nil
|
||||
and valid, set `core.hooksPath' by adding additional aguments to ARGS.
|
||||
* Flatten ARGS, removing nil arguments.
|
||||
* If `system-type' is `windows-nt', encode ARGS to `w32-ansi-code-page'."
|
||||
(setq args (append magit-git-global-arguments (flatten-tree args)))
|
||||
(cond ((not async))
|
||||
(magit--overriding-githook-directory)
|
||||
((eq magit-overriding-githook-directory 'magit)
|
||||
(setq magit--overriding-githook-directory
|
||||
(expand-file-name "git-hooks"
|
||||
(locate-dominating-file
|
||||
(locate-library "magit.el") "git-hooks"))))
|
||||
((and magit-overriding-githook-directory
|
||||
(file-directory-p magit-overriding-githook-directory))
|
||||
(setq magit--overriding-githook-directory
|
||||
magit-overriding-githook-directory)))
|
||||
(setq args
|
||||
(append magit-git-global-arguments
|
||||
(and magit--overriding-githook-directory
|
||||
(list "-c" (format "core.hooksPath=%s"
|
||||
magit--overriding-githook-directory)))
|
||||
(flatten-tree args)))
|
||||
(if (and (eq system-type 'windows-nt) (boundp 'w32-ansi-code-page))
|
||||
;; On w32, the process arguments *must* be encoded in the
|
||||
;; current code-page (see #3250).
|
||||
@@ -606,7 +677,7 @@ executable."
|
||||
(error "`git --exec-path' failed"))))
|
||||
exec-suffixes
|
||||
#'file-executable-p)
|
||||
(compat-call executable-find command t)))
|
||||
(executable-find command t)))
|
||||
|
||||
;;; Git Version
|
||||
|
||||
@@ -953,7 +1024,7 @@ returning the truename."
|
||||
"(see https://magit.vc/goto/e6a78ed2)"))
|
||||
|
||||
(defun magit--assert-usable-git ()
|
||||
(if (not (compat-call executable-find (magit-git-executable) t))
|
||||
(if (not (executable-find (magit-git-executable) t))
|
||||
(signal 'magit-git-executable-not-found (magit-git-executable))
|
||||
(let ((magit-git-debug
|
||||
(lambda (err)
|
||||
@@ -1208,14 +1279,11 @@ or if no rename is detected."
|
||||
"Failed to parse Cygwin mount: %S" mount)))
|
||||
;; If --exec-path is not a native Windows path,
|
||||
;; then we probably have a cygwin git.
|
||||
(let ((process-environment
|
||||
(append magit-git-environment
|
||||
process-environment)))
|
||||
(and (not (string-match-p
|
||||
"\\`[a-zA-Z]:"
|
||||
(car (process-lines
|
||||
magit-git-executable "--exec-path"))))
|
||||
(ignore-errors (process-lines "mount")))))
|
||||
(and (not (string-match-p
|
||||
"\\`[a-zA-Z]:"
|
||||
(car (magit--early-process-lines
|
||||
magit-git-executable "--exec-path"))))
|
||||
(magit--early-process-lines "mount")))
|
||||
#'> :key (pcase-lambda (`(,cyg . ,_win)) (length cyg))))
|
||||
"Alist of (CYGWIN . WIN32) directory names.
|
||||
Sorted from longest to shortest CYGWIN name."
|
||||
@@ -2896,6 +2964,34 @@ out. Only existing branches can be selected."
|
||||
(magit-confirm t nil (format "%s %%d modules" verb) nil modules)
|
||||
(list (magit-read-module-path (format "%s module" verb) predicate)))))
|
||||
|
||||
;;; Git Hooks
|
||||
|
||||
(defun magit-run-git-hook (githook &rest args)
|
||||
(dolist (githook (ensure-list githook))
|
||||
(let* ((githook (symbol-name githook))
|
||||
(hook (save-match-data
|
||||
(if (string-match "\\`common-" githook)
|
||||
(intern (format "magit-common-git-%s-functions"
|
||||
(substring githook (match-end 0))))
|
||||
(intern (format "magit-git-%s-functions" githook))))))
|
||||
(when (and (boundp hook)
|
||||
(symbol-value hook))
|
||||
(magit--client-message "Running %s..." hook)
|
||||
(apply #'run-hook-with-args hook args)
|
||||
(magit--client-message "Running %s...done" hook))))
|
||||
;; Emacsclient prints the returned value to stdout. We cannot prevent
|
||||
;; that, but we can use something that looks like we actually *wanted*
|
||||
;; to print (which we don't).
|
||||
'---)
|
||||
|
||||
(defun magit--client-message (format-string &rest args)
|
||||
;; See `server-process-filter'.
|
||||
(let ((msg (format "-print %s\n"
|
||||
(server-quote-arg
|
||||
(apply #'format-message format-string args)))))
|
||||
(dolist (client server-clients)
|
||||
(server-send-string client msg))))
|
||||
|
||||
;;; _
|
||||
(provide 'magit-git)
|
||||
;; Local Variables:
|
||||
|
||||
@@ -535,7 +535,7 @@ commits before and half after."
|
||||
("r" "current" magit-reflog-current)
|
||||
("O" "other" magit-reflog-other)
|
||||
("H" "HEAD" magit-reflog-head)]
|
||||
[:if-mode magit-wip-mode
|
||||
[:if-non-nil magit-wip-mode
|
||||
:description "Wiplog"
|
||||
("i" "index" magit-wip-log-index)
|
||||
("w" "worktree" magit-wip-log-worktree)]
|
||||
|
||||
@@ -1509,10 +1509,10 @@ repositories."
|
||||
(cond-let
|
||||
((eq repository 'all)
|
||||
(dolist (cache magit-repository-local-cache)
|
||||
(setf cache (compat-call assoc-delete-all key cache))))
|
||||
(setf cache (assoc-delete-all key cache))))
|
||||
([cache (assoc (or repository (magit-repository-local-repository))
|
||||
magit-repository-local-cache)]
|
||||
(setf cache (compat-call assoc-delete-all key cache)))))
|
||||
(setf cache (assoc-delete-all key cache)))))
|
||||
|
||||
(defmacro magit--with-repository-local-cache (key &rest body)
|
||||
(declare (indent 1) (debug (form body)))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
;; -*- no-byte-compile: t; lexical-binding: nil -*-
|
||||
(define-package "magit" "20251125.101"
|
||||
(define-package "magit" "20251217.1836"
|
||||
"A Git porcelain inside Emacs."
|
||||
'((emacs "28.1")
|
||||
(compat "30.1")
|
||||
@@ -10,8 +10,8 @@
|
||||
(transient "0.10")
|
||||
(with-editor "3.4"))
|
||||
:url "https://github.com/magit/magit"
|
||||
:commit "ced3d5afc33d06305f04dd1557bf2fe849914511"
|
||||
:revdesc "ced3d5afc33d"
|
||||
:commit "655bc502a3bdd7f07928524515a736e4b8101eaf"
|
||||
:revdesc "655bc502a3bd"
|
||||
:keywords '("git" "tools" "vc")
|
||||
:authors '(("Marius Vollmer" . "marius.vollmer@gmail.com")
|
||||
("Jonas Bernoulli" . "emacs.magit@jonas.bernoulli.dev"))
|
||||
|
||||
@@ -119,13 +119,8 @@ displays the text of `magit-process-error-summary' instead."
|
||||
"\\`\\(?:\\(?:/.*/\\)?git-credential-\\)?cache\\'" prog)
|
||||
(or (cadr (member "--socket" args))
|
||||
(expand-file-name "~/.git-credential-cache/socket")))))
|
||||
;; Note: `magit-process-file' is not yet defined when
|
||||
;; evaluating this form, so we use `process-lines'.
|
||||
(ignore-errors
|
||||
(let ((process-environment
|
||||
(append magit-git-environment process-environment)))
|
||||
(process-lines magit-git-executable
|
||||
"config" "--get-all" "credential.helper"))))
|
||||
(magit--early-process-lines
|
||||
magit-git-executable "config" "--get-all" "credential.helper"))
|
||||
"If non-nil, start a credential cache daemon using this socket.
|
||||
|
||||
When using Git's cache credential helper in the normal way, Emacs
|
||||
@@ -529,12 +524,26 @@ eol conversion."
|
||||
(default-process-coding-system (magit--process-coding-system)))
|
||||
(apply #'process-file process infile buffer display args)))
|
||||
|
||||
(defvar magit--shadowed-githook-directory nil)
|
||||
|
||||
(defun magit--shadowed-githook-directory ()
|
||||
(or magit--shadowed-githook-directory
|
||||
(setq magit--shadowed-githook-directory
|
||||
(let ((magit-git-global-arguments nil))
|
||||
(cl-letf (((symbol-function 'magit-process-environment)
|
||||
(lambda () process-environment)))
|
||||
(or (magit-get "core.hooksPath")
|
||||
(expand-file-name "hooks" (magit-gitdir))))))))
|
||||
|
||||
(defun magit-process-environment ()
|
||||
;; The various w32 hacks are only applicable when running on the local
|
||||
;; machine. A local binding of process-environment different from the
|
||||
;; top-level value affects the environment used by Tramp.
|
||||
(let ((local (not (file-remote-p default-directory))))
|
||||
(append magit-git-environment
|
||||
(and magit-overriding-githook-directory
|
||||
(list (concat "SHADOWED_GITHOOK_DIRECTORY="
|
||||
(magit--shadowed-githook-directory))))
|
||||
(and local
|
||||
(cdr (assoc magit-git-executable magit-git-w32-path-hack)))
|
||||
(and local magit-need-cygwin-noglob
|
||||
@@ -574,7 +583,7 @@ flattened before use."
|
||||
(run-hooks 'magit-pre-call-git-hook)
|
||||
(pcase-let* ((process-environment (magit-process-environment))
|
||||
(default-process-coding-system (magit--process-coding-system))
|
||||
(flat-args (magit-process-git-arguments args))
|
||||
(flat-args (magit-process-git-arguments args t))
|
||||
(`(,process-buf . ,section)
|
||||
(magit-process-setup (magit-git-executable) flat-args))
|
||||
(inhibit-read-only t))
|
||||
@@ -657,7 +666,7 @@ See `magit-start-process' for more information."
|
||||
(run-hooks 'magit-pre-start-git-hook)
|
||||
(let ((default-process-coding-system (magit--process-coding-system)))
|
||||
(apply #'magit-start-process (magit-git-executable) input
|
||||
(magit-process-git-arguments args))))
|
||||
(magit-process-git-arguments args t))))
|
||||
|
||||
(defun magit-start-process (program &optional input &rest args)
|
||||
"Start PROGRAM, prepare for refresh, and return the process object.
|
||||
@@ -730,7 +739,7 @@ Magit status buffer."
|
||||
process))
|
||||
|
||||
(defun magit-parse-git-async (&rest args)
|
||||
(setq args (magit-process-git-arguments args))
|
||||
(setq args (magit-process-git-arguments args t))
|
||||
(let ((command-buf (current-buffer))
|
||||
(stdout-buf (generate-new-buffer " *git-stdout*"))
|
||||
(stderr-buf (generate-new-buffer " *git-stderr*"))
|
||||
@@ -797,7 +806,7 @@ Magit status buffer."
|
||||
(defun magit-process--format-arguments (program args)
|
||||
(cond
|
||||
((and args (equal program (magit-git-executable)))
|
||||
(let ((global (length magit-git-global-arguments)))
|
||||
(let ((global (magit-process-git-arguments--length)))
|
||||
(concat
|
||||
(propertize (file-name-nondirectory program)
|
||||
'font-lock-face 'magit-section-heading)
|
||||
@@ -869,7 +878,7 @@ Magit status buffer."
|
||||
`((commit . ,(magit-rev-parse "HEAD"))
|
||||
(,(pcase (car (seq-drop
|
||||
(process-command process)
|
||||
(1+ (length magit-git-global-arguments))))
|
||||
(1+ (magit-process-git-arguments--length))))
|
||||
((or "rebase" "am") 'rebase-sequence)
|
||||
((or "cherry-pick" "revert") 'sequence)))
|
||||
(status)))))
|
||||
@@ -1106,7 +1115,7 @@ as argument."
|
||||
(defun magit-process-set-mode-line (program args)
|
||||
"Display the git command (sans arguments) in the mode line."
|
||||
(when (equal program (magit-git-executable))
|
||||
(setq args (nthcdr (length magit-git-global-arguments) args)))
|
||||
(setq args (nthcdr (magit-process-git-arguments--length) args)))
|
||||
(let ((str (concat " " (propertize
|
||||
(concat (file-name-nondirectory program)
|
||||
(and args (concat " " (car args))))
|
||||
|
||||
@@ -32,11 +32,14 @@
|
||||
|
||||
;; For `magit-rebase--todo'.
|
||||
(declare-function git-rebase-current-line "git-rebase" (&optional batch))
|
||||
(eval-and-compile
|
||||
(cl-pushnew 'action-type eieio--known-slot-names)
|
||||
|
||||
(eval-and-compile ;declare slot names
|
||||
(cl-pushnew 'abbrev eieio--known-slot-names)
|
||||
(cl-pushnew 'action eieio--known-slot-names)
|
||||
(cl-pushnew 'action-options eieio--known-slot-names)
|
||||
(cl-pushnew 'target eieio--known-slot-names))
|
||||
(cl-pushnew 'action-type eieio--known-slot-names)
|
||||
(cl-pushnew 'target eieio--known-slot-names)
|
||||
(cl-pushnew 'trailer eieio--known-slot-names))
|
||||
|
||||
;;; Options
|
||||
;;;; Faces
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
|
||||
(require 'magit)
|
||||
|
||||
(declare-function magit-dired-jump "magit-dired" (&optional other-window))
|
||||
|
||||
;;; Options
|
||||
|
||||
(defgroup magit-status nil
|
||||
|
||||
@@ -61,12 +61,19 @@ collected. This is currently the default.
|
||||
|
||||
If `immediately', then use `git-commit-post-finish-hook' to
|
||||
create the merge commit. This is discouraged because it can
|
||||
lead to a race condition, e.g., during rebases."
|
||||
lead to a race condition, e.g., during rebases.
|
||||
|
||||
If `githook', then use `magit-common-git-post-commit-hook' to
|
||||
create the merge commit. This uses the experimental support for
|
||||
calling Lisp hooks from Git hooks, which is disabled by default,
|
||||
Customize `magit-overriding-githook-directory' to enable use of
|
||||
Git hooks."
|
||||
:package-version '(magit . "2.90.0")
|
||||
:group 'magit-wip
|
||||
:type '(choice
|
||||
(const :tag "Yes (safely, just in time)" t)
|
||||
(const :tag "Yes (immediately, with race condition)" immediately)
|
||||
(const :tag "Yes (using experimental Git hook support)" githook)
|
||||
(const :tag "No" nil)))
|
||||
|
||||
(defcustom magit-wip-namespace "refs/wip/"
|
||||
@@ -79,6 +86,14 @@ is used as `branch-ref'."
|
||||
:group 'magit-wip
|
||||
:type 'string)
|
||||
|
||||
(defcustom magit-wip-debug nil
|
||||
"Whether to record commands used to update wip refs.
|
||||
If non-nil, log the used commands and their output in the process
|
||||
buffer."
|
||||
:package-version '(magit . "4.5.0")
|
||||
:group 'magit-wip
|
||||
:type 'boolean)
|
||||
|
||||
;;; Mode
|
||||
|
||||
(defvar magit--wip-inhibit-autosave nil)
|
||||
@@ -95,12 +110,14 @@ is used as `branch-ref'."
|
||||
(add-hook 'magit-after-apply-functions #'magit-wip-commit)
|
||||
(add-hook 'magit-before-change-functions #'magit-wip-commit)
|
||||
(add-hook 'before-save-hook #'magit-wip-commit-initial-backup)
|
||||
(add-hook 'magit-common-git-post-commit-functions #'magit-wip-post-commit)
|
||||
(add-hook 'git-commit-post-finish-hook #'magit-wip-commit-post-editmsg))
|
||||
(t
|
||||
(remove-hook 'after-save-hook #'magit-wip-commit-buffer-file)
|
||||
(remove-hook 'magit-after-apply-functions #'magit-wip-commit)
|
||||
(remove-hook 'magit-before-change-functions #'magit-wip-commit)
|
||||
(remove-hook 'before-save-hook #'magit-wip-commit-initial-backup)
|
||||
(remove-hook 'magit-common-git-post-commit-functions #'magit-wip-post-commit)
|
||||
(remove-hook 'git-commit-post-finish-hook #'magit-wip-commit-post-editmsg))))
|
||||
|
||||
(defun magit-wip-commit-buffer-file (&optional msg)
|
||||
@@ -138,6 +155,10 @@ is used as `branch-ref'."
|
||||
(magit-wip-commit-buffer-file "autosave %s before save"))
|
||||
(setq magit-wip-buffer-backed-up t)))
|
||||
|
||||
(defun magit-wip-post-commit (&rest _)
|
||||
(when (eq magit-wip-merge-branch 'githook)
|
||||
(magit-wip-commit)))
|
||||
|
||||
(defun magit-wip-commit-post-editmsg ()
|
||||
(when (eq magit-wip-merge-branch 'immediately)
|
||||
(magit-wip-commit)))
|
||||
@@ -179,24 +200,34 @@ commit message."
|
||||
;; Note: `update-index' is used instead of `add'
|
||||
;; because `add' will fail if a file is already
|
||||
;; deleted in the temporary index.
|
||||
(magit-call-git "update-index" "--add" "--remove"
|
||||
(magit-wip--git "update-index" "--add" "--remove"
|
||||
"--ignore-skip-worktree-entries"
|
||||
"--" files)
|
||||
(magit-with-toplevel
|
||||
(magit-call-git "add" "-u" ".")))
|
||||
(magit-wip--git "add" "-u" ".")))
|
||||
(magit-git-string "write-tree"))))
|
||||
(magit-wip-update-wipref ref wipref tree parent files msg "worktree"))))
|
||||
|
||||
(defun magit-wip--git (&rest args)
|
||||
(if magit-wip-debug
|
||||
(let ((default-process-coding-system (magit--process-coding-system)))
|
||||
(apply #'magit-call-process
|
||||
(magit-git-executable)
|
||||
(magit-process-git-arguments args)))
|
||||
(apply #'magit-process-file
|
||||
(magit-git-executable) nil nil nil
|
||||
(magit-process-git-arguments args))))
|
||||
|
||||
(defun magit-wip-update-wipref (ref wipref tree parent files msg start-msg)
|
||||
(cond
|
||||
((and (not (equal parent wipref))
|
||||
(or (not magit-wip-merge-branch)
|
||||
(not (magit-rev-verify wipref))))
|
||||
(setq start-msg (concat "start autosaving " start-msg))
|
||||
(magit-update-ref wipref start-msg
|
||||
(magit-git-string "commit-tree" "--no-gpg-sign"
|
||||
"-p" parent "-m" start-msg
|
||||
(concat parent "^{tree}")))
|
||||
(magit-wip--update-ref wipref start-msg
|
||||
(magit-git-string "commit-tree" "--no-gpg-sign"
|
||||
"-p" parent "-m" start-msg
|
||||
(concat parent "^{tree}")))
|
||||
(setq parent wipref))
|
||||
((and magit-wip-merge-branch
|
||||
(or (not (magit-rev-ancestor-p ref wipref))
|
||||
@@ -206,11 +237,11 @@ commit message."
|
||||
"^2")
|
||||
ref))))
|
||||
(setq start-msg (format "merge %s into %s" ref start-msg))
|
||||
(magit-update-ref wipref start-msg
|
||||
(magit-git-string "commit-tree" "--no-gpg-sign"
|
||||
"-p" wipref "-p" ref
|
||||
"-m" start-msg
|
||||
(concat ref "^{tree}")))
|
||||
(magit-wip--update-ref wipref start-msg
|
||||
(magit-git-string "commit-tree" "--no-gpg-sign"
|
||||
"-p" wipref "-p" ref
|
||||
"-m" start-msg
|
||||
(concat ref "^{tree}")))
|
||||
(setq parent wipref)))
|
||||
(when (magit-git-failure "diff-tree" "--quiet" parent tree "--" files)
|
||||
(unless (and msg (not (= (aref msg 0) ?\s)))
|
||||
@@ -222,9 +253,15 @@ commit message."
|
||||
(file-relative-name (car files)
|
||||
(magit-toplevel)))))
|
||||
msg))))
|
||||
(magit-update-ref wipref msg
|
||||
(magit-git-string "commit-tree" "--no-gpg-sign"
|
||||
"-p" parent "-m" msg tree))))
|
||||
(magit-wip--update-ref wipref msg
|
||||
(magit-git-string "commit-tree" "--no-gpg-sign"
|
||||
"-p" parent "-m" msg tree))))
|
||||
|
||||
(defun magit-wip--update-ref (ref message rev)
|
||||
(let ((magit--refresh-cache nil))
|
||||
(unless (zerop (magit-wip--git "update-ref" "--create-reflog"
|
||||
"-m" message ref rev))
|
||||
(error "Cannot update %s with %s" ref rev))))
|
||||
|
||||
(defun magit-wip-get-ref ()
|
||||
(let ((ref (or (magit-git-string "symbolic-ref" "HEAD") "HEAD")))
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
;; Homepage: https://github.com/magit/magit
|
||||
;; Keywords: git tools vc
|
||||
|
||||
;; Package-Version: 20251125.101
|
||||
;; Package-Revision: ced3d5afc33d
|
||||
;; Package-Version: 20251217.1836
|
||||
;; Package-Revision: 655bc502a3bd
|
||||
;; Package-Requires: (
|
||||
;; (emacs "28.1")
|
||||
;; (compat "30.1")
|
||||
@@ -773,11 +773,12 @@ For X11 something like ~/.xinitrc should work.\n"
|
||||
(require 'magit-stash)
|
||||
(require 'magit-blame)
|
||||
(require 'magit-submodule)
|
||||
;; The `provide' form may be missing so we have to
|
||||
;; try harder to ensure this is loaded exactly once.
|
||||
(unless (or (featurep 'magit-autoloads)
|
||||
(unless (or noninteractive
|
||||
;; The `provide' form may be missing, so we have to
|
||||
;; try harder to ensure this is loaded exactly once.
|
||||
(featurep 'magit-autoloads)
|
||||
(autoloadp (symbol-function 'magit-patch))
|
||||
(load "magit-autoloads" t))
|
||||
(load "magit-autoloads" t t))
|
||||
(require 'magit-patch)
|
||||
(require 'magit-subtree)
|
||||
(require 'magit-ediff)
|
||||
|
||||
@@ -7401,6 +7401,11 @@ Also see *note (gitman)git-worktree::.
|
||||
If the worktree at point is the one whose status is already being
|
||||
displayed in the current buffer, then show it in Dired instead.
|
||||
|
||||
If you want the status buffer to list worktrees, add the function
|
||||
‘magit-insert-worktrees’ to ‘magit-status-sections-hook’ as described in
|
||||
*note Status Sections::. If there is only one worktree, this function
|
||||
inserts nothing.
|
||||
|
||||
|
||||
File: magit.info, Node: Sparse checkouts, Next: Bundle, Prev: Worktree, Up: Miscellaneous
|
||||
|
||||
@@ -10973,63 +10978,63 @@ Ref: Listing Submodules314190
|
||||
Ref: Submodule Transient316251
|
||||
Node: Subtree318604
|
||||
Node: Worktree320535
|
||||
Node: Sparse checkouts321611
|
||||
Node: Bundle324383
|
||||
Node: Common Commands324758
|
||||
Node: Wip Modes327384
|
||||
Ref: Wip Graph331958
|
||||
Node: Commands for Buffers Visiting Files334397
|
||||
Node: Minor Mode for Buffers Visiting Blobs342736
|
||||
Node: Customizing343899
|
||||
Node: Per-Repository Configuration345491
|
||||
Node: Essential Settings347745
|
||||
Ref: Safety348034
|
||||
Ref: Performance349709
|
||||
Ref: Log Performance352500
|
||||
Ref: Diff Performance353799
|
||||
Ref: Refs Buffer Performance355140
|
||||
Ref: Committing Performance355713
|
||||
Ref: Microsoft Windows Performance356693
|
||||
Ref: MacOS Performance357780
|
||||
Ref: Global Bindings358663
|
||||
Ref: Essential Settings-Footnote-1360836
|
||||
Node: Plumbing360918
|
||||
Node: Calling Git361743
|
||||
Ref: Getting a Value from Git363202
|
||||
Ref: Calling Git for Effect366820
|
||||
Node: Section Plumbing372759
|
||||
Ref: Creating Sections372911
|
||||
Ref: Section Selection376721
|
||||
Ref: Matching Sections378418
|
||||
Node: Refreshing Buffers384320
|
||||
Node: Conventions387460
|
||||
Ref: Theming Faces387624
|
||||
Node: FAQ395657
|
||||
Node: FAQ - How to ...?396093
|
||||
Ref: How to pronounce Magit?396226
|
||||
Ref: How to show git's output?396918
|
||||
Ref: How to install the gitman info manual?397535
|
||||
Ref: How to show diffs for gpg-encrypted files?398340
|
||||
Ref: How does branching and pushing work?398749
|
||||
Ref: Should I disable VC?398913
|
||||
Node: FAQ - Issues and Errors399396
|
||||
Ref: Magit is slow399541
|
||||
Ref: I changed several thousand files at once and now Magit is unusable399687
|
||||
Ref: I am having problems committing400226
|
||||
Ref: I am using MS Windows and cannot push with Magit400491
|
||||
Ref: I am using macOS and SOMETHING works in shell but not in Magit400889
|
||||
Ref: Expanding a file to show the diff causes it to disappear401476
|
||||
Ref: Point is wrong in the COMMIT_EDITMSG buffer401826
|
||||
Ref: The mode-line information isn't always up-to-date402650
|
||||
Ref: A branch and tag sharing the same name breaks SOMETHING403481
|
||||
Ref: My Git hooks work on the command-line but not inside Magit404129
|
||||
Ref: git-commit-mode isn't used when committing from the command-line404721
|
||||
Ref: Point ends up inside invisible text when jumping to a file-visiting buffer406709
|
||||
Ref: I am no longer able to save popup defaults407301
|
||||
Node: Debugging Tools408094
|
||||
Node: Keystroke Index412029
|
||||
Node: Function and Command Index450125
|
||||
Node: Variable Index501697
|
||||
Node: Sparse checkouts321850
|
||||
Node: Bundle324622
|
||||
Node: Common Commands324997
|
||||
Node: Wip Modes327623
|
||||
Ref: Wip Graph332197
|
||||
Node: Commands for Buffers Visiting Files334636
|
||||
Node: Minor Mode for Buffers Visiting Blobs342975
|
||||
Node: Customizing344138
|
||||
Node: Per-Repository Configuration345730
|
||||
Node: Essential Settings347984
|
||||
Ref: Safety348273
|
||||
Ref: Performance349948
|
||||
Ref: Log Performance352739
|
||||
Ref: Diff Performance354038
|
||||
Ref: Refs Buffer Performance355379
|
||||
Ref: Committing Performance355952
|
||||
Ref: Microsoft Windows Performance356932
|
||||
Ref: MacOS Performance358019
|
||||
Ref: Global Bindings358902
|
||||
Ref: Essential Settings-Footnote-1361075
|
||||
Node: Plumbing361157
|
||||
Node: Calling Git361982
|
||||
Ref: Getting a Value from Git363441
|
||||
Ref: Calling Git for Effect367059
|
||||
Node: Section Plumbing372998
|
||||
Ref: Creating Sections373150
|
||||
Ref: Section Selection376960
|
||||
Ref: Matching Sections378657
|
||||
Node: Refreshing Buffers384559
|
||||
Node: Conventions387699
|
||||
Ref: Theming Faces387863
|
||||
Node: FAQ395896
|
||||
Node: FAQ - How to ...?396332
|
||||
Ref: How to pronounce Magit?396465
|
||||
Ref: How to show git's output?397157
|
||||
Ref: How to install the gitman info manual?397774
|
||||
Ref: How to show diffs for gpg-encrypted files?398579
|
||||
Ref: How does branching and pushing work?398988
|
||||
Ref: Should I disable VC?399152
|
||||
Node: FAQ - Issues and Errors399635
|
||||
Ref: Magit is slow399780
|
||||
Ref: I changed several thousand files at once and now Magit is unusable399926
|
||||
Ref: I am having problems committing400465
|
||||
Ref: I am using MS Windows and cannot push with Magit400730
|
||||
Ref: I am using macOS and SOMETHING works in shell but not in Magit401128
|
||||
Ref: Expanding a file to show the diff causes it to disappear401715
|
||||
Ref: Point is wrong in the COMMIT_EDITMSG buffer402065
|
||||
Ref: The mode-line information isn't always up-to-date402889
|
||||
Ref: A branch and tag sharing the same name breaks SOMETHING403720
|
||||
Ref: My Git hooks work on the command-line but not inside Magit404368
|
||||
Ref: git-commit-mode isn't used when committing from the command-line404960
|
||||
Ref: Point ends up inside invisible text when jumping to a file-visiting buffer406948
|
||||
Ref: I am no longer able to save popup defaults407540
|
||||
Node: Debugging Tools408333
|
||||
Node: Keystroke Index412268
|
||||
Node: Function and Command Index450364
|
||||
Node: Variable Index501936
|
||||
|
||||
End Tag Table
|
||||
|
||||
|
||||
Reference in New Issue
Block a user