Pending commit properties.
This commit is contained in:
parent
95185b0ada
commit
ff65089041
1 changed files with 21 additions and 7 deletions
28
magit.el
28
magit.el
|
@ -1302,14 +1302,28 @@ Please see the manual for a complete description of Magit.
|
||||||
(insert (propertize "Pending commits:\n"
|
(insert (propertize "Pending commits:\n"
|
||||||
'face 'magit-section-title))
|
'face 'magit-section-title))
|
||||||
(dolist (p pending)
|
(dolist (p pending)
|
||||||
(magit-with-section p 'commit
|
(let* ((commit (car p))
|
||||||
(magit-set-section-info p)
|
(properties (cdr p))
|
||||||
(insert (magit-shell
|
(used (plist-get properties 'used)))
|
||||||
"git log --max-count=1 --pretty=format:%s %s --"
|
(magit-with-section commit 'commit
|
||||||
(magit-escape-for-shell "* %s") p)
|
(magit-set-section-info commit)
|
||||||
"\n"))))
|
(insert (propertize
|
||||||
|
(magit-shell
|
||||||
|
"git log --max-count=1 --pretty=format:%s %s --"
|
||||||
|
(magit-escape-for-shell (if used ". %s" "* %s"))
|
||||||
|
commit)
|
||||||
|
'face (if used '(:forground "gray50") nil))
|
||||||
|
"\n")))))
|
||||||
(insert "\n"))))
|
(insert "\n"))))
|
||||||
|
|
||||||
|
(defun magit-rewrite-set-commit-property (commit prop value)
|
||||||
|
(let* ((info (magit-read-rewrite-info))
|
||||||
|
(pending (cdr (assq 'pending info)))
|
||||||
|
(p (assoc commit pending)))
|
||||||
|
(when p
|
||||||
|
(setf (cdr p) (plist-put (cdr p) prop value))
|
||||||
|
(magit-write-rewrite-info info))))
|
||||||
|
|
||||||
(defun magit-insert-pending-changes ()
|
(defun magit-insert-pending-changes ()
|
||||||
(let* ((info (magit-read-rewrite-info))
|
(let* ((info (magit-read-rewrite-info))
|
||||||
(orig (cadr (assq 'orig info))))
|
(orig (cadr (assq 'orig info))))
|
||||||
|
@ -1330,7 +1344,7 @@ Please see the manual for a complete description of Magit.
|
||||||
(base (magit-shell "git rev-parse %s^" from))
|
(base (magit-shell "git rev-parse %s^" from))
|
||||||
(pending (magit-shell-lines "git rev-list %s.." base)))
|
(pending (magit-shell-lines "git rev-list %s.." base)))
|
||||||
(magit-write-rewrite-info `((orig ,orig)
|
(magit-write-rewrite-info `((orig ,orig)
|
||||||
(pending ,@pending)))
|
(pending ,@(mapcar #'list pending))))
|
||||||
(magit-run "git" "reset" "--hard" base)))
|
(magit-run "git" "reset" "--hard" base)))
|
||||||
|
|
||||||
(defun magit-rewrite-stop ()
|
(defun magit-rewrite-stop ()
|
||||||
|
|
Loading…
Add table
Reference in a new issue