aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJonas Bernoulli <jonas@bernoul.li>2022-02-21 18:20:00 +0100
committerJonas Bernoulli <jonas@bernoul.li>2022-02-22 11:36:45 +0100
commitf321409f4d67dff38220ed479b88d9e6b88b2dee (patch)
tree22f27b305c6b31ca6dade5a7ecc84cf170a9f4da /lisp
parent9b94654921d511ff80d48122481cde02828492db (diff)
Rename magit-utils.el to magit-base.el
It hasn't been true for quite some time that this library only (or even just mostly) defined things that have "very little to do with Git or Magit", and it is time to account for that. "magit-base.el" serves a role similar to that of "magit-core.el", except that it comes even earlier in the dependency tree. For that reason other libraries that depend on one or more of the libraries that `magit-base' depends on should just require that feature.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/Makefile20
-rw-r--r--lisp/git-commit.el8
-rw-r--r--lisp/magit-base.el (renamed from lisp/magit-utils.el)19
-rw-r--r--lisp/magit-core.el3
-rw-r--r--lisp/magit-git.el3
-rw-r--r--lisp/magit-margin.el2
-rw-r--r--lisp/magit-mode.el2
-rw-r--r--lisp/magit-process.el3
8 files changed, 25 insertions, 35 deletions
diff --git a/lisp/Makefile b/lisp/Makefile
index d56731c..065297c 100644
--- a/lisp/Makefile
+++ b/lisp/Makefile
@@ -10,24 +10,22 @@ all: lisp
## Build order #######################################################
git-commit.elc:
-magit-utils.elc:
magit-section.elc:
+magit-base.elc: magit-section.elc
ifeq "$(BUILD_MAGIT_LIBGIT)" "true"
magit-libgit.elc:
-magit-git.elc: magit-utils.elc magit-section.elc magit-libgit.elc
+magit-git.elc: magit-base.elc magit-libgit.elc
else
-magit-git.elc: magit-utils.elc magit-section.elc
+magit-git.elc: magit-base.elc
endif
-magit-mode.elc: magit-section.elc magit-git.elc
-magit-margin.elc: magit-section.elc magit-mode.elc
-magit-process.elc: magit-utils.elc magit-section.elc \
- magit-git.elc magit-mode.elc
+magit-mode.elc: magit-base.elc magit-git.elc
+magit-margin.elc: magit-base.elc magit-mode.elc
+magit-process.elc: magit-base.elc magit-git.elc magit-mode.elc
magit-transient.elc: magit-git.elc magit-mode.elc magit-process.elc
magit-autorevert.elc: magit-git.elc magit-process.elc
-magit-core.elc: magit-margin.elc magit-utils.elc \
- magit-section.elc magit-git.elc \
- magit-transient.elc magit-mode.elc \
- magit-process.elc magit-autorevert.elc
+magit-core.elc: magit-base.elc magit-git.elc magit-mode.elc \
+ magit-margin.elc magit-process.elc \
+ magit-transient.elc magit-autorevert.elc
magit-diff.elc: git-commit.elc magit-core.elc
magit-log.elc: magit-core.elc magit-diff.elc
magit-wip.elc: magit-core.elc magit-log.elc
diff --git a/lisp/git-commit.el b/lisp/git-commit.el
index 17594bc..fa5782d 100644
--- a/lisp/git-commit.el
+++ b/lisp/git-commit.el
@@ -115,9 +115,9 @@
(require 'seq)
(require 'subr-x)
+(require 'magit-base nil t)
(require 'magit-git nil t)
(require 'magit-mode nil t)
-(require 'magit-utils nil t)
(require 'log-edit)
(require 'ring)
@@ -135,7 +135,7 @@
(defvar font-lock-beg)
(defvar font-lock-end)
-(declare-function magit-completing-read "magit-utils"
+(declare-function magit-completing-read "magit-base"
(prompt collection &optional predicate require-match
initial-input hist def fallback))
(declare-function magit-expand-git-file-name "magit-git" (filename))
@@ -210,7 +210,7 @@ The major mode configured here is turned on by the minor mode
"Hook run at the end of `git-commit-setup'."
:group 'git-commit
:type 'hook
- :get (and (featurep 'magit-utils) 'magit-hook-custom-get)
+ :get (and (featurep 'magit-base) 'magit-hook-custom-get)
:options '(git-commit-save-message
git-commit-setup-changelog-support
magit-generate-changelog
@@ -240,7 +240,7 @@ This hook is only run if `magit' is available.
Also see `magit-post-commit-hook'."
:group 'git-commit
:type 'hook
- :get (and (featurep 'magit-utils) 'magit-hook-custom-get))
+ :get (and (featurep 'magit-base) 'magit-hook-custom-get))
(defcustom git-commit-finish-query-functions
'(git-commit-check-style-conventions)
diff --git a/lisp/magit-utils.el b/lisp/magit-base.el
index f44926e..ecb0442 100644
--- a/lisp/magit-utils.el
+++ b/lisp/magit-base.el
@@ -1,4 +1,4 @@
-;;; magit-utils.el --- various utilities -*- lexical-binding: t; coding: utf-8 -*-
+;;; magit-base.el --- early birds -*- lexical-binding: t; coding: utf-8 -*-
;; Copyright (C) 2010-2022 The Magit Project Contributors
;;
@@ -28,15 +28,10 @@
;;; Commentary:
-;; This library defines several utility functions used by several
-;; other libraries which cannot depend on one another (because
-;; circular dependencies are not good). Luckily most (all) of these
-;; functions have very little (nothing) to do with Git, so we not only
-;; have to do this, it even makes sense.
-
-;; Unfortunately there are also some options which are used by several
-;; libraries which cannot depend on one another, they are defined here
-;; too.
+;; This library defines utility functions, options and other things that
+;; have to be available early on because they are used by several other
+;; libraries, which cannot depend on one another, because that would lead
+;; to circular dependencies.
;;; Code:
@@ -1230,5 +1225,5 @@ Like `message', except that `message-log-max' is bound to nil."
,@body))))
;;; _
-(provide 'magit-utils)
-;;; magit-utils.el ends here
+(provide 'magit-base)
+;;; magit-base.el ends here
diff --git a/lisp/magit-core.el b/lisp/magit-core.el
index c0873a9..1eda58e 100644
--- a/lisp/magit-core.el
+++ b/lisp/magit-core.el
@@ -32,8 +32,7 @@
;;; Code:
-(require 'magit-utils)
-(require 'magit-section)
+(require 'magit-base)
(require 'magit-git)
(require 'magit-mode)
(require 'magit-margin)
diff --git a/lisp/magit-git.el b/lisp/magit-git.el
index ea0cb17..fcabd0f 100644
--- a/lisp/magit-git.el
+++ b/lisp/magit-git.el
@@ -29,8 +29,7 @@
;;; Code:
-(require 'magit-utils)
-(require 'magit-section)
+(require 'magit-base)
;; From `magit-branch'.
(defvar magit-branch-prefer-remote-upstream)
diff --git a/lisp/magit-margin.el b/lisp/magit-margin.el
index 5f6375a..ae8d8ad 100644
--- a/lisp/magit-margin.el
+++ b/lisp/magit-margin.el
@@ -32,7 +32,7 @@
;;; Code:
-(require 'magit-section)
+(require 'magit-base)
(require 'magit-transient)
(require 'magit-mode)
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 4ec9c27..7dc1282 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -31,7 +31,7 @@
;;; Code:
-(require 'magit-section)
+(require 'magit-base)
(require 'magit-git)
(require 'format-spec)
diff --git a/lisp/magit-process.el b/lisp/magit-process.el
index 165bd16..f069c99 100644
--- a/lisp/magit-process.el
+++ b/lisp/magit-process.el
@@ -33,8 +33,7 @@
;;; Code:
-(require 'magit-utils)
-(require 'magit-section)
+(require 'magit-base)
(require 'magit-git)
(require 'magit-mode)