aboutsummaryrefslogtreecommitdiff
path: root/lisp/magit-git.el
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2025-07-11 21:03:36 +0200
committerJonas Bernoulli <jonas@bernoul.li>2025-07-11 21:03:36 +0200
commitc9d9ce1b9ad1352bcaf57514c35bbfc946ebff62 (patch)
treef9d8f4bcd30291d9d0807fadf517516e1b1fbd70 /lisp/magit-git.el
parenta89158b40a8c5f7a7e399631e95c13f460a33020 (diff)
Increase name consistency for "commit" arguments
- Never use REVISION. - For arguments of commands use COMMIT. - For arguments of other functions use REV.
Diffstat (limited to 'lisp/magit-git.el')
-rw-r--r--lisp/magit-git.el38
1 files changed, 19 insertions, 19 deletions
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index 9ff3fbe..aa0282a 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -1999,32 +1999,32 @@ SORTBY is a key or list of keys to pass to the `--sort' flag of
(defun magit-list-remote-branches (&optional remote)
(magit-list-refs (concat "refs/remotes/" remote)))
-(defun magit-list-related-branches (relation &optional commit &rest args)
+(defun magit-list-related-branches (relation &optional rev &rest args)
(seq-remove (##string-match-p "\\(\\`(HEAD\\|HEAD -> \\)" %)
(mapcar (##substring % 2)
- (magit-git-lines "branch" args relation commit))))
+ (magit-git-lines "branch" args relation rev))))
-(defun magit-list-containing-branches (&optional commit &rest args)
- (magit-list-related-branches "--contains" commit args))
+(defun magit-list-containing-branches (&optional rev &rest args)
+ (magit-list-related-branches "--contains" rev args))
-(defun magit-list-publishing-branches (&optional commit)
- (seq-filter (##magit-rev-ancestor-p (or commit "HEAD") %)
+(defun magit-list-publishing-branches (&optional rev)
+ (seq-filter (##magit-rev-ancestor-p (or rev "HEAD") %)
magit-published-branches))
-(defun magit-list-merged-branches (&optional commit &rest args)
- (magit-list-related-branches "--merged" commit args))
+(defun magit-list-merged-branches (&optional rev &rest args)
+ (magit-list-related-branches "--merged" rev args))
-(defun magit-list-unmerged-branches (&optional commit &rest args)
- (magit-list-related-branches "--no-merged" commit args))
+(defun magit-list-unmerged-branches (&optional rev &rest args)
+ (magit-list-related-branches "--no-merged" rev args))
(defun magit-list-unmerged-to-upstream-branches ()
(seq-filter (##and-let* ((upstream (magit-get-upstream-branch %)))
(member % (magit-list-unmerged-branches upstream)))
(magit-list-local-branch-names)))
-(defun magit-list-branches-pointing-at (commit)
+(defun magit-list-branches-pointing-at (rev)
(let ((re (format "\\`%s refs/\\(heads\\|remotes\\)/\\(.*\\)\\'"
- (magit-rev-verify commit))))
+ (magit-rev-verify rev))))
(seq-keep (##and (string-match re %)
(let ((name (match-string 2 %)))
(and (not (string-suffix-p "HEAD" name))
@@ -2285,16 +2285,16 @@ If `first-parent' is set, traverse only first parents."
(defun magit-rev-abbrev (rev)
(magit-rev-parse (magit-abbrev-arg "short") rev))
-(defun magit-commit-children (commit &optional args)
+(defun magit-commit-children (rev &optional args)
(seq-keep (lambda (line)
(pcase-let ((`(,child . ,parents) (split-string line " ")))
- (and (member commit parents) child)))
+ (and (member rev parents) child)))
(magit-git-lines "log" "--format=%H %P"
(or args (list "--branches" "--tags" "--remotes"))
- "--not" commit)))
+ "--not" rev)))
-(defun magit-commit-parents (commit)
- (and-let* ((str (magit-git-string "rev-list" "-1" "--parents" commit)))
+(defun magit-commit-parents (rev)
+ (and-let* ((str (magit-git-string "rev-list" "-1" "--parents" rev)))
(cdr (split-string str))))
(defun magit-patch-id (rev)
@@ -2444,14 +2444,14 @@ and this option only controls what face is used.")
(defun magit-object-type (object)
(magit-git-string "cat-file" "-t" object))
-(defmacro magit-with-blob (commit file &rest body)
+(defmacro magit-with-blob (rev file &rest body)
(declare (indent 2)
(debug (form form body)))
`(magit--with-temp-process-buffer
(let ((buffer-file-name ,file))
(save-excursion
(magit-git-insert "cat-file" "-p"
- (concat ,commit ":" buffer-file-name)))
+ (concat ,rev ":" buffer-file-name)))
(decode-coding-inserted-region
(point-min) (point-max) buffer-file-name t nil nil t)
,@body)))