[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/magit 033a0c0cdc 1/2: Depend on Git >= v2.25.0
From: |
Jonas Bernoulli |
Subject: |
[nongnu] elpa/magit 033a0c0cdc 1/2: Depend on Git >= v2.25.0 |
Date: |
Mon, 16 Dec 2024 12:37:59 -0500 (EST) |
branch: elpa/magit
commit 033a0c0cdc036118745d425b835840d8fd0f160b
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Depend on Git >= v2.25.0
That was released five years ago.
---
CHANGELOG | 4 +++
lisp/magit-base.el | 2 +-
lisp/magit-bisect.el | 9 +++----
lisp/magit-branch.el | 3 +--
lisp/magit-clone.el | 11 ++------
lisp/magit-diff.el | 8 +++---
lisp/magit-fetch.el | 5 ----
lisp/magit-git.el | 59 ++++++++++---------------------------------
lisp/magit-sequence.el | 3 +--
lisp/magit-sparse-checkout.el | 12 ---------
lisp/magit-stash.el | 2 +-
lisp/magit-submodule.el | 5 +---
lisp/magit-wip.el | 8 +++---
13 files changed, 33 insertions(+), 98 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index e345fc7d0f..2d0e6138d6 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,4 +1,8 @@
# -*- mode: org -*-
+* v4.2.0 UNRELEASED
+
+- At least Git 2.25.0 is required now.
+
* v4.1.3 2024-12-06
- For most important sections, if an error occurs while inserting the
diff --git a/lisp/magit-base.el b/lisp/magit-base.el
index 69e1b2a3f9..9762d54361 100644
--- a/lisp/magit-base.el
+++ b/lisp/magit-base.el
@@ -32,7 +32,7 @@
;;; Code:
-(defconst magit--minimal-git "2.2.0")
+(defconst magit--minimal-git "2.25.0")
(defconst magit--minimal-emacs "26.1")
(require 'cl-lib)
diff --git a/lisp/magit-bisect.el b/lisp/magit-bisect.el
index 55dec38956..3381224c28 100644
--- a/lisp/magit-bisect.el
+++ b/lisp/magit-bisect.el
@@ -63,10 +63,8 @@
("-n" "Don't checkout commits" "--no-checkout")
("-p" "Follow only first parent of a merge" "--first-parent"
:if (lambda () (magit-git-version>= "2.29")))
- (6 magit-bisect:--term-old
- :if (lambda () (magit-git-version>= "2.7")))
- (6 magit-bisect:--term-new
- :if (lambda () (magit-git-version>= "2.7")))]
+ (magit-bisect:--term-old :level 6)
+ (magit-bisect:--term-new :level 6)]
["Actions"
("B" "Start" magit-bisect-start)
("s" "Start script" magit-bisect-run)]]
@@ -74,8 +72,7 @@
:if magit-bisect-in-progress-p
("B" "Bad" magit-bisect-bad)
("g" "Good" magit-bisect-good)
- (6 "m" "Mark" magit-bisect-mark
- :if (lambda () (magit-git-version>= "2.7")))
+ ("m" "Mark" magit-bisect-mark :level 6)
("k" "Skip" magit-bisect-skip)
("r" "Reset" magit-bisect-reset)
("s" "Run script" magit-bisect-run)])
diff --git a/lisp/magit-branch.el b/lisp/magit-branch.el
index 3ebda3fb94..41e011dcee 100644
--- a/lisp/magit-branch.el
+++ b/lisp/magit-branch.el
@@ -225,8 +225,7 @@ has to be used to view and change branch related variables."
:inapt-if-not magit-get-some-remote)]
["Arguments"
(7 "-r" "Recurse submodules when checking out an existing branch"
- "--recurse-submodules"
- :if (lambda () (magit-git-version>= "2.13")))]
+ "--recurse-submodules")]
[["Checkout"
("b" "branch/revision" magit-checkout)
("l" "local branch" magit-branch-checkout)
diff --git a/lisp/magit-clone.el b/lisp/magit-clone.el
index ed44b08562..e754a6ee1b 100644
--- a/lisp/magit-clone.el
+++ b/lisp/magit-clone.el
@@ -135,9 +135,7 @@ directory where the repository has been cloned."
["Setup arguments"
("-o" "Set name of remote" ("-o" "--origin="))
("-b" "Set HEAD branch" ("-b" "--branch="))
- (magit-clone:--filter
- :if (lambda () (magit-git-version>= "2.17.0"))
- :level 7)
+ (magit-clone:--filter :level 7)
("-g" "Separate git directory" "--separate-git-dir="
transient-read-directory :level 7)
("-t" "Use template directory" "--template="
@@ -150,9 +148,7 @@ directory where the repository has been cloned."
("s" "shallow" magit-clone-shallow)
("d" "shallow since date" magit-clone-shallow-since :level 7)
("e" "shallow excluding" magit-clone-shallow-exclude :level 7)
- (">" "sparse checkout" magit-clone-sparse
- :if (lambda () (magit-git-version>= "2.25.0"))
- :level 6)
+ (">" "sparse checkout" magit-clone-sparse :level 6)
("b" "bare" magit-clone-bare)
("m" "mirror" magit-clone-mirror)]
(interactive (list (or magit-clone-always-transient current-prefix-arg)))
@@ -278,9 +274,6 @@ Then show the status buffer for the new repository."
(unless magit-clone-set-remote-head
(magit-remote-unset-head remote))))
(when (and sparse checkout)
- (when (magit-git-version< "2.25.0")
- (user-error
- "`git sparse-checkout' not available until Git v2.25"))
(let ((default-directory directory))
(magit-call-git "sparse-checkout" "init" "--cone")
(magit-call-git "checkout" (magit-get-current-branch))))
diff --git a/lisp/magit-diff.el b/lisp/magit-diff.el
index 635ed2c5a5..09beed4708 100644
--- a/lisp/magit-diff.el
+++ b/lisp/magit-diff.el
@@ -2143,11 +2143,9 @@ keymap is the parent of their keymaps."
(flatten-tree args))
(magit-git-global-arguments
(remove "--literal-pathspecs" magit-git-global-arguments)))
- ;; As of Git 2.19.0, we need to generate diffs with
- ;; --ita-visible-in-index so that `magit-stage' can work with
- ;; intent-to-add files (see #4026).
- (when (and (not (equal cmd "merge-tree"))
- (magit-git-version>= "2.19.0"))
+ ;; We need to generate diffs with --ita-visible-in-index so that
+ ;; `magit-stage' can work with intent-to-add files (see #4026).
+ (unless (equal cmd "merge-tree")
(push "--ita-visible-in-index" args))
(setq args (magit-diff--maybe-add-stat-arguments args))
(when (cl-member-if (lambda (arg) (string-prefix-p "--color-moved" arg))
args)
diff --git a/lisp/magit-fetch.el b/lisp/magit-fetch.el
index 9ee04e95b0..1b64a6d999 100644
--- a/lisp/magit-fetch.el
+++ b/lisp/magit-fetch.el
@@ -178,11 +178,6 @@ with a prefix argument."
(list nil (transient-args 'magit-fetch-modules))))
(if transient
(transient-setup 'magit-fetch-modules)
- (when-let (((magit-git-version< "2.8.0"))
- (value (transient-arg-value "--jobs=" args)))
- (message "Dropping --jobs; not supported by Git v%s"
- (magit-git-version))
- (setq args (remove (format "--jobs=%s" value) args)))
(magit-with-toplevel
(magit-run-git-async "fetch" "--recurse-submodules" args))))
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 88402ab94b..4ce9063cbb 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1406,27 +1406,13 @@ ref that should have been excluded, then that is
discarded and
this function returns nil instead. This is unfortunate because
there might be other refs that do match. To fix that, update
Git."
- (if (magit-git-version< "2.13")
- (and-let*
- ((ref (magit-git-string "name-rev" "--name-only" "--no-undefined"
- (and pattern (concat "--refs=" pattern))
- rev)))
- (if (and pattern
- (string-match-p "\\`refs/[^/]+/\\*\\'" pattern))
- (let ((namespace (substring pattern 0 -1)))
- (and (not (or (string-suffix-p "HEAD" ref)
- (and (string-match-p namespace ref)
- (not (magit-rev-verify
- (concat namespace ref))))))
- ref))
- ref))
- (magit-git-string "name-rev" "--name-only" "--no-undefined"
- (and pattern (concat "--refs=" pattern))
- (and pattern
- (not not-anchored)
- (list "--exclude=*/HEAD"
- (concat "--exclude=*/" pattern)))
- rev)))
+ (magit-git-string "name-rev" "--name-only" "--no-undefined"
+ (and pattern (concat "--refs=" pattern))
+ (and pattern
+ (not not-anchored)
+ (list "--exclude=*/HEAD"
+ (concat "--exclude=*/" pattern)))
+ rev))
(defun magit-rev-branch (rev)
(and-let* ((name (magit-rev-name rev "refs/heads/*")))
@@ -2122,13 +2108,9 @@ would claim a worktree is bare, even though the working
tree is
specified using `core.worktree'."
(let ((remote (file-remote-p default-directory))
worktrees worktree)
- (dolist (line (let ((magit-git-global-arguments
- ;; KLUDGE At least in Git v2.8.3 this argument
- ;; would trigger a segfault.
- (remove "--no-pager" magit-git-global-arguments)))
- (if (magit-git-version>= "2.36")
- (magit-git-items "worktree" "list" "--porcelain" "-z")
- (magit-git-lines "worktree" "list" "--porcelain"))))
+ (dolist (line (if (magit-git-version>= "2.36")
+ (magit-git-items "worktree" "list" "--porcelain" "-z")
+ (magit-git-lines "worktree" "list" "--porcelain")))
(cond ((string-prefix-p "worktree" line)
(let ((path (substring line 9)))
(when remote
@@ -2475,27 +2457,12 @@ and this option only controls what face is used.")
(defun magit-update-files (files)
(magit-git-success "update-index" "--add" "--remove" "--" files))
-(defun magit-update-ref (ref message rev &optional stashish)
+(defun magit-update-ref (ref message rev)
(let ((magit--refresh-cache nil))
- (or (if (magit-git-version>= "2.6.0")
- (zerop (magit-call-git "update-ref" "--create-reflog"
+ (unless (zerop (magit-call-git "update-ref" "--create-reflog"
"-m" message ref rev
(or (magit-rev-verify ref) "")))
- ;; `--create-reflog' didn't exist before v2.6.0
- (let ((oldrev (magit-rev-verify ref))
- (logfile (expand-file-name (concat "logs/" ref)
- (magit-gitdir))))
- (unless (file-exists-p logfile)
- (when oldrev
- (magit-git-success "update-ref" "-d" ref oldrev))
- (make-directory (file-name-directory logfile) t)
- (with-temp-file logfile)
- (when (and oldrev (not stashish))
- (magit-git-success "update-ref" "-m" "enable reflog"
- ref oldrev ""))))
- (magit-git-success "update-ref" "-m" message ref rev
- (or (magit-rev-verify ref) "")))
- (error "Cannot update %s with %s" ref rev))))
+ (error "Cannot update %s with %s" ref rev))))
(defconst magit-range-re
(concat "\\`\\([^ \t]*[^.]\\)?" ; revA
diff --git a/lisp/magit-sequence.el b/lisp/magit-sequence.el
index b4e9f51ff7..1cfa7f981f 100644
--- a/lisp/magit-sequence.el
+++ b/lisp/magit-sequence.el
@@ -530,8 +530,7 @@ This discards all changes made since the sequence started."
("-p" "Preserve merges" ("-p" "--preserve-merges")
:if (lambda () (magit-git-version< "2.33.0")))
("-r" "Rebase merges" ("-r" "--rebase-merges=")
- magit-rebase-merges-select-mode
- :if (lambda () (magit-git-version>= "2.18.0")))
+ magit-rebase-merges-select-mode)
("-u" "Update branches" "--update-refs"
:if (lambda () (magit-git-version>= "2.38.0")))
(7 magit-merge:--strategy)
diff --git a/lisp/magit-sparse-checkout.el b/lisp/magit-sparse-checkout.el
index a57d230167..2805f3e31c 100644
--- a/lisp/magit-sparse-checkout.el
+++ b/lisp/magit-sparse-checkout.el
@@ -43,13 +43,6 @@
"Return non-nil if working tree is a sparse checkout."
(magit-get-boolean "core.sparsecheckout"))
-(defun magit-sparse-checkout--assert-version ()
- ;; Older versions of Git have the ability to define sparse checkout
- ;; patterns in .git/info/sparse-checkout, but the sparse-checkout
- ;; command isn't available until 2.25.0.
- (when (magit-git-version< "2.25.0")
- (user-error "`git sparse-checkout' not available until Git v2.25")))
-
(defun magit-sparse-checkout--auto-enable ()
(if (magit-sparse-checkout-enabled-p)
(unless (magit-get-boolean "core.sparsecheckoutcone")
@@ -89,7 +82,6 @@ See the `git sparse-checkout' manpage for details about
(defun magit-sparse-checkout-enable (&optional args)
"Convert the working tree to a sparse checkout."
(interactive (list (transient-args 'magit-sparse-checkout)))
- (magit-sparse-checkout--assert-version)
(magit-run-git-async "sparse-checkout" "init" "--cone" args))
;;;###autoload
@@ -104,7 +96,6 @@ directories, call `magit-sparse-checkout-add' instead."
;; dealing with very large trees, listing all subdirectories
;; may need to be reconsidered.
(magit-revision-directories "HEAD"))))
- (magit-sparse-checkout--assert-version)
(magit-sparse-checkout--auto-enable)
(magit-run-git-async "sparse-checkout" "set" directories))
@@ -124,7 +115,6 @@ directories, call `magit-sparse-checkout-set' instead."
(regexp-opt (magit-sparse-checkout-directories)))))
(lambda (d) (string-match-p re d)))
(magit-revision-directories "HEAD")))))
- (magit-sparse-checkout--assert-version)
(magit-sparse-checkout--auto-enable)
(magit-run-git-async "sparse-checkout" "add" directories))
@@ -135,7 +125,6 @@ Some operations such as merging or rebasing may need to
check out
files that aren't included in the sparse checkout. Call this
command to reset to the sparse checkout state."
(interactive)
- (magit-sparse-checkout--assert-version)
(magit-run-git-async "sparse-checkout" "reapply"))
;;;###autoload
@@ -145,7 +134,6 @@ Note that disabling the sparse checkout does not clear the
configured directories. Call `magit-sparse-checkout-enable' to
restore the previous sparse checkout."
(interactive)
- (magit-sparse-checkout--assert-version)
(magit-run-git-async "sparse-checkout" "disable"))
;;; Miscellaneous
diff --git a/lisp/magit-stash.el b/lisp/magit-stash.el
index 7f42865fb1..269a243426 100644
--- a/lisp/magit-stash.el
+++ b/lisp/magit-stash.el
@@ -446,7 +446,7 @@ Then apply STASH, dropping it if it applies cleanly."
(t "local"))))))
(defun magit-stash-store (message ref commit)
- (magit-update-ref ref message commit t))
+ (magit-update-ref ref message commit))
(defun magit-stash-create (message index worktree untracked)
(unless (magit-rev-parse "--verify" "HEAD")
diff --git a/lisp/magit-submodule.el b/lisp/magit-submodule.el
index a42d1bc698..ae22fd517b 100644
--- a/lisp/magit-submodule.el
+++ b/lisp/magit-submodule.el
@@ -248,8 +248,7 @@ it is nil, then PATH also becomes the name."
(magit-process-sentinel process event)
(process-put process 'inhibit-refresh t)
(magit-process-sentinel process event)
- (when (magit-git-version>= "2.12.0")
- (magit-call-git "submodule" "absorbgitdirs" path))
+ (magit-call-git "submodule" "absorbgitdirs" path)
(magit-refresh)))))))
;;;###autoload
@@ -385,8 +384,6 @@ to recover from making a mistake here, but don't count on
it."
(list (magit-read-module-path "Remove module")))
(magit-submodule-arguments "--force")
current-prefix-arg))
- (when (magit-git-version< "2.12.0")
- (error "This command requires Git v2.12.0"))
(when magit-submodule-remove-trash-gitdirs
(setq trash-gitdirs t))
(magit-with-toplevel
diff --git a/lisp/magit-wip.el b/lisp/magit-wip.el
index 1621d62a1c..cee20dea72 100644
--- a/lisp/magit-wip.el
+++ b/lisp/magit-wip.el
@@ -317,11 +317,9 @@ 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"
- (and (magit-git-version>= "2.25.0")
- "--ignore-skip-worktree-entries")
- "--" files)
+ (magit-call-git "update-index" "--add" "--remove"
+ "--ignore-skip-worktree-entries"
+ "--" files)
(magit-with-toplevel
(magit-call-git "add" "-u" ".")))
(magit-git-string "write-tree"))))