gnu: emacs-magit: Update to commit d05545e.
* gnu/packages/emacs-xyz.scm (emacs-magit): Update to commit 68b5a13fa1b6b122d4a2547b8c415aadff83d8ca. [origin]: Remove obsoleted patches and snippets. [build-system]: Switch to the emacs-build-system. [arguments]: Remove the #:modules and #:imported-modules arguments. Enable tests. Remove the #:make-flags and #:test-target argument. Specify the \#:test-command argument. [phases]{patch}: Remove phase. {build-info-manual, set-magit-version, configure-git} {disable-tramp-test}: New phases. {configure}: Do not delete phase. {patch-exec-paths}: Adapt file names. * gnu/packages/patches/emacs-magit-log-format-author-margin.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Unregister it.
This commit is contained in:
parent
9ea9e97b9c
commit
a10349d2bb
@ -887,7 +887,6 @@ dist_patch_DATA = \
|
|||||||
%D%/packages/patches/emacs-json-reformat-fix-tests.patch \
|
%D%/packages/patches/emacs-json-reformat-fix-tests.patch \
|
||||||
%D%/packages/patches/emacs-highlight-stages-add-gexp.patch \
|
%D%/packages/patches/emacs-highlight-stages-add-gexp.patch \
|
||||||
%D%/packages/patches/emacs-libgit-use-system-libgit2.patch \
|
%D%/packages/patches/emacs-libgit-use-system-libgit2.patch \
|
||||||
%D%/packages/patches/emacs-magit-log-format-author-margin.patch \
|
|
||||||
%D%/packages/patches/emacs-scheme-complete-scheme-r5rs-info.patch \
|
%D%/packages/patches/emacs-scheme-complete-scheme-r5rs-info.patch \
|
||||||
%D%/packages/patches/emacs-source-date-epoch.patch \
|
%D%/packages/patches/emacs-source-date-epoch.patch \
|
||||||
%D%/packages/patches/emacs-telega-test-env.patch \
|
%D%/packages/patches/emacs-telega-test-env.patch \
|
||||||
|
@ -395,12 +395,11 @@ libgit2 bindings for Emacs, intended to boost the performance of Magit.")
|
|||||||
(license license:gpl3+))))
|
(license license:gpl3+))))
|
||||||
|
|
||||||
(define-public emacs-magit
|
(define-public emacs-magit
|
||||||
;; `magit-setup-buffer' macro introduced in c761d28d and required in
|
;; There hasn't been an official release since 2018-11-16.
|
||||||
;; `emacs-forge'.
|
(let ((commit "d05545ec2fd7edf915eaf1b9c15c785bb08975cc"))
|
||||||
(let ((commit "c761d28d49e5238037512b898db0ec9b40d85770"))
|
|
||||||
(package
|
(package
|
||||||
(name "emacs-magit")
|
(name "emacs-magit")
|
||||||
(version (git-version "2.90.1" "3" commit))
|
(version (git-version "2.90.1" "4" commit))
|
||||||
(source (origin
|
(source (origin
|
||||||
(method git-fetch)
|
(method git-fetch)
|
||||||
(uri (git-reference
|
(uri (git-reference
|
||||||
@ -409,93 +408,76 @@ libgit2 bindings for Emacs, intended to boost the performance of Magit.")
|
|||||||
(file-name (git-file-name name version))
|
(file-name (git-file-name name version))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"16qx0404l05q1m6w7y5j8ck1z5nfmpinm00w0p2yh1hn5zzwy6dd"))
|
"11aqyy4r9hrdi9nlypd70hn8384b6q89c7xavgv8c5q7f2g5z9qg"))))
|
||||||
;; FIXME: emacs-forge uses a function defined in this patch,
|
(build-system emacs-build-system)
|
||||||
;; which is newer than the current commit.
|
(arguments
|
||||||
(patches
|
`(#:emacs ,emacs-no-x ;module support is required
|
||||||
(search-patches
|
#:tests? #t
|
||||||
"emacs-magit-log-format-author-margin.patch"))
|
#:test-command '("make" "test")
|
||||||
(modules '((guix build utils)))
|
#:phases
|
||||||
(snippet
|
(modify-phases %standard-phases
|
||||||
'(begin
|
(add-after 'unpack 'build-info-manual
|
||||||
;; Fix syntax error
|
(lambda _
|
||||||
(substitute* "lisp/magit-extras.el"
|
(invoke "make" "info")
|
||||||
(("rev\\)\\)\\)\\)\\)\\)") "rev)))))"))
|
;; Copy info files to the lisp directory, which acts as
|
||||||
#t))))
|
;; the root of the project for the emacs-build-system.
|
||||||
(build-system gnu-build-system)
|
(for-each (lambda (f)
|
||||||
(native-inputs `(("texinfo" ,texinfo)
|
(install-file f "lisp"))
|
||||||
("emacs" ,emacs-minimal)))
|
(find-files "Documentation" "\\.info$"))
|
||||||
|
(chdir "lisp")
|
||||||
|
#t))
|
||||||
|
(add-after 'build-info-manual 'set-magit-version
|
||||||
|
(lambda _
|
||||||
|
(make-file-writable "magit.el")
|
||||||
|
(emacs-substitute-variables "magit.el"
|
||||||
|
("magit-version" ,version))
|
||||||
|
#t))
|
||||||
|
(add-after 'set-magit-version 'patch-exec-paths
|
||||||
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
|
(let ((perl (assoc-ref inputs "perl")))
|
||||||
|
(make-file-writable "magit-sequence.el")
|
||||||
|
(emacs-substitute-variables "magit-sequence.el"
|
||||||
|
("magit-perl-executable" (string-append perl "/bin/perl")))
|
||||||
|
#t)))
|
||||||
|
(add-before 'check 'configure-git
|
||||||
|
(lambda _
|
||||||
|
;; Otherwise some tests fail with error "unable to auto-detect
|
||||||
|
;; email address".
|
||||||
|
(setenv "HOME" (getcwd))
|
||||||
|
(invoke "git" "config" "--global" "user.name" "toto")
|
||||||
|
(invoke "git" "config" "--global" "user.email"
|
||||||
|
"toto@toto.com")))
|
||||||
|
(add-after 'configure-git 'disable-tramp-test
|
||||||
|
(lambda _
|
||||||
|
;; There is an issue causing TRAMP to fail in the build
|
||||||
|
;; environment. Setting the tramp-remote-shell parameter of
|
||||||
|
;; the sudo-method to the file name of the shell didn't help.
|
||||||
|
(chdir "..")
|
||||||
|
(substitute* "t/magit-tests.el"
|
||||||
|
(("^\\(ert-deftest magit-toplevel:tramp.*" all)
|
||||||
|
(string-append all " (skip-unless nil)")))
|
||||||
|
#t))
|
||||||
|
(add-before 'install 'enter-lisp-directory
|
||||||
|
(lambda _
|
||||||
|
(chdir "lisp")
|
||||||
|
#t)))))
|
||||||
|
(native-inputs
|
||||||
|
`(("texinfo" ,texinfo)))
|
||||||
(inputs
|
(inputs
|
||||||
`(("git" ,git)
|
`(("git" ,git)
|
||||||
("perl" ,perl)))
|
("perl" ,perl)))
|
||||||
(propagated-inputs
|
(propagated-inputs
|
||||||
`(("dash" ,emacs-dash)
|
`(("emacs-dash" ,emacs-dash)
|
||||||
("with-editor" ,emacs-with-editor)
|
("emacs-libgit" ,emacs-libgit)
|
||||||
("transient" ,emacs-transient)))
|
("emacs-transient" ,emacs-transient)
|
||||||
(arguments
|
("emacs-with-editor" ,emacs-with-editor)))
|
||||||
`(#:modules ((guix build gnu-build-system)
|
|
||||||
(guix build utils)
|
|
||||||
(guix build emacs-utils))
|
|
||||||
#:imported-modules (,@%gnu-build-system-modules
|
|
||||||
(guix build emacs-utils))
|
|
||||||
#:test-target "test"
|
|
||||||
#:tests? #f ; tests are not included in the release
|
|
||||||
#:make-flags
|
|
||||||
(list (string-append "PREFIX=" %output)
|
|
||||||
;; Don't put .el files in a sub-directory.
|
|
||||||
(string-append "lispdir=" %output "/share/emacs/site-lisp"))
|
|
||||||
#:phases
|
|
||||||
(modify-phases %standard-phases
|
|
||||||
(add-after 'unpack 'patch
|
|
||||||
(lambda _
|
|
||||||
(chmod "lisp/magit-extras.el" #o644)
|
|
||||||
(emacs-batch-edit-file "lisp/magit-extras.el"
|
|
||||||
`(progn (progn
|
|
||||||
(goto-char (point-min))
|
|
||||||
(re-search-forward "(defun magit-copy-buffer-revision ()")
|
|
||||||
(forward-sexp 2)
|
|
||||||
(kill-sexp)
|
|
||||||
(insert ,(format #f "~S"
|
|
||||||
'(if (use-region-p)
|
|
||||||
(copy-region-as-kill nil nil 'region)
|
|
||||||
(when-let ((rev (cl-case major-mode
|
|
||||||
((magit-cherry-mode
|
|
||||||
magit-log-select-mode
|
|
||||||
magit-reflog-mode
|
|
||||||
magit-refs-mode
|
|
||||||
magit-revision-mode
|
|
||||||
magit-stash-mode
|
|
||||||
magit-stashes-mode)
|
|
||||||
(car magit-refresh-args))
|
|
||||||
((magit-diff-mode magit-log-mode)
|
|
||||||
(let ((r (caar magit-refresh-args)))
|
|
||||||
(if (string-match "\\.\\.\\.?\\(.+\\)" r)
|
|
||||||
(match-string 1 r)
|
|
||||||
r)))
|
|
||||||
(magit-status-mode "HEAD"))))
|
|
||||||
(when (magit-commit-p rev)
|
|
||||||
(setq rev (magit-rev-parse rev))
|
|
||||||
(push (list rev default-directory) magit-revision-stack)
|
|
||||||
(kill-new (message "%s" rev))))))))
|
|
||||||
(basic-save-buffer)))
|
|
||||||
#t))
|
|
||||||
(delete 'configure)
|
|
||||||
(add-before
|
|
||||||
'build 'patch-exec-paths
|
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
|
||||||
(let ((perl (assoc-ref inputs "perl")))
|
|
||||||
(make-file-writable "lisp/magit-sequence.el")
|
|
||||||
(emacs-substitute-variables "lisp/magit-sequence.el"
|
|
||||||
("magit-perl-executable" (string-append perl "/bin/perl")))
|
|
||||||
#t))))))
|
|
||||||
(home-page "https://magit.vc/")
|
(home-page "https://magit.vc/")
|
||||||
(synopsis "Emacs interface for the Git version control system")
|
(synopsis "Emacs interface for the Git version control system")
|
||||||
(description
|
(description "With Magit, you can inspect and modify your Git
|
||||||
"With Magit, you can inspect and modify your Git repositories with Emacs.
|
repositories with Emacs. You can review and commit the changes you have made
|
||||||
You can review and commit the changes you have made to the tracked files, for
|
to the tracked files, for example, and you can browse the history of past
|
||||||
example, and you can browse the history of past changes. There is support for
|
changes. There is support for cherry picking, reverting, merging, rebasing,
|
||||||
cherry picking, reverting, merging, rebasing, and other common Git
|
and other common Git operations.")
|
||||||
operations.")
|
|
||||||
(license license:gpl3+))))
|
(license license:gpl3+))))
|
||||||
|
|
||||||
(define-public emacs-magit-svn
|
(define-public emacs-magit-svn
|
||||||
|
@ -1,72 +0,0 @@
|
|||||||
From 94914ca4690c0cff12d600a0c8ba6bfb3fb38dc5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jonas Bernoulli <jonas@bernoul.li>
|
|
||||||
Date: Tue, 25 Jun 2019 21:44:32 +0200
|
|
||||||
Subject: [PATCH] magit-log-format-author-margin: New function
|
|
||||||
|
|
||||||
Split it from `magit-log-format-margin'.
|
|
||||||
---
|
|
||||||
lisp/magit-log.el | 48 +++++++++++++++++++++++++----------------------
|
|
||||||
1 file changed, 26 insertions(+), 22 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/lisp/magit-log.el b/lisp/magit-log.el
|
|
||||||
index c8e6ef63..c0a79b19 100644
|
|
||||||
--- a/lisp/magit-log.el
|
|
||||||
+++ b/lisp/magit-log.el
|
|
||||||
@@ -1374,28 +1374,32 @@ The shortstat style is experimental and rather slow."
|
|
||||||
(when-let ((option (magit-margin-option)))
|
|
||||||
(if magit-log-margin-show-shortstat
|
|
||||||
(magit-log-format-shortstat-margin rev)
|
|
||||||
- (pcase-let ((`(,_ ,style ,width ,details ,details-width)
|
|
||||||
- (or magit-buffer-margin
|
|
||||||
- (symbol-value option))))
|
|
||||||
- (magit-make-margin-overlay
|
|
||||||
- (concat (and details
|
|
||||||
- (concat (propertize (truncate-string-to-width
|
|
||||||
- (or author "")
|
|
||||||
- details-width
|
|
||||||
- nil ?\s (make-string 1 magit-ellipsis))
|
|
||||||
- 'face 'magit-log-author)
|
|
||||||
- " "))
|
|
||||||
- (propertize
|
|
||||||
- (if (stringp style)
|
|
||||||
- (format-time-string
|
|
||||||
- style
|
|
||||||
- (seconds-to-time (string-to-number date)))
|
|
||||||
- (pcase-let* ((abbr (eq style 'age-abbreviated))
|
|
||||||
- (`(,cnt ,unit) (magit--age date abbr)))
|
|
||||||
- (format (format (if abbr "%%2i%%-%ic" "%%2i %%-%is")
|
|
||||||
- (- width (if details (1+ details-width) 0)))
|
|
||||||
- cnt unit)))
|
|
||||||
- 'face 'magit-log-date)))))))
|
|
||||||
+ (magit-log-format-author-margin author date))))
|
|
||||||
+
|
|
||||||
+(defun magit-log-format-author-margin (author date &optional previous-line)
|
|
||||||
+ (pcase-let ((`(,_ ,style ,width ,details ,details-width)
|
|
||||||
+ (or magit-buffer-margin
|
|
||||||
+ (symbol-value option))))
|
|
||||||
+ (magit-make-margin-overlay
|
|
||||||
+ (concat (and details
|
|
||||||
+ (concat (propertize (truncate-string-to-width
|
|
||||||
+ (or author "")
|
|
||||||
+ details-width
|
|
||||||
+ nil ?\s (make-string 1 magit-ellipsis))
|
|
||||||
+ 'face 'magit-log-author)
|
|
||||||
+ " "))
|
|
||||||
+ (propertize
|
|
||||||
+ (if (stringp style)
|
|
||||||
+ (format-time-string
|
|
||||||
+ style
|
|
||||||
+ (seconds-to-time (string-to-number date)))
|
|
||||||
+ (pcase-let* ((abbr (eq style 'age-abbreviated))
|
|
||||||
+ (`(,cnt ,unit) (magit--age date abbr)))
|
|
||||||
+ (format (format (if abbr "%%2i%%-%ic" "%%2i %%-%is")
|
|
||||||
+ (- width (if details (1+ details-width) 0)))
|
|
||||||
+ cnt unit)))
|
|
||||||
+ 'face 'magit-log-date))
|
|
||||||
+ previous-line)))
|
|
||||||
|
|
||||||
(defun magit-log-format-shortstat-margin (rev)
|
|
||||||
(magit-make-margin-overlay
|
|
||||||
--
|
|
||||||
2.23.0
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user