fix config update info
This commit is contained in:
@@ -426,7 +426,7 @@ Usage:
|
|||||||
(when (= (length remotes) 1)
|
(when (= (length remotes) 1)
|
||||||
(let* ((remote-branch-name (concat (car remotes) "/" branch)) ;; @{u} may not configured, TODO: (if (magit-rev-parse "@{u}") ...)
|
(let* ((remote-branch-name (concat (car remotes) "/" branch)) ;; @{u} may not configured, TODO: (if (magit-rev-parse "@{u}") ...)
|
||||||
(diff-count (magit-rev-diff-count "@" remote-branch-name))) ;; i.e. git rev-list @...origin/master --count --left-right
|
(diff-count (magit-rev-diff-count "@" remote-branch-name))) ;; i.e. git rev-list @...origin/master --count --left-right
|
||||||
(when with-update (magit-git-fetch (concat (car remotes) " " branch)))
|
(when with-update (magit-git-string "fetch" (car remotes) branch))
|
||||||
(setq diff (- (cadr diff-count) (car diff-count)))))
|
(setq diff (- (cadr diff-count) (car diff-count)))))
|
||||||
(if as-text
|
(if as-text
|
||||||
(if (= diff 0) "Up-to-date"
|
(if (= diff 0) "Up-to-date"
|
||||||
@@ -435,11 +435,11 @@ Usage:
|
|||||||
diff))))
|
diff))))
|
||||||
(defun my-dashboard-config-update ()
|
(defun my-dashboard-config-update ()
|
||||||
(if (featurep 'magit)
|
(if (featurep 'magit)
|
||||||
(let ((diff (my-magit-repo-status "~/.config/emacs" "master")))
|
(let ((diff (my-magit-repo-status "~/.config/emacs" "master" t)))
|
||||||
(if (= diff 0) "Up-to-date"
|
(if (= diff 0) "Up-to-date"
|
||||||
(if (= diff 1) "1 update"
|
(if (= diff 1) "1 update"
|
||||||
(if (> diff 0) (format "%s updates" diff)
|
(if (= diff -1) "1 commit unpushed"
|
||||||
(if (= diff -1) "1 commit unpushed"
|
(if (> diff 0) (format "%s updates" diff)
|
||||||
(format "%s commits unpushed" (- diff)))))))
|
(format "%s commits unpushed" (- diff)))))))
|
||||||
(require 'magit nil t)
|
(require 'magit nil t)
|
||||||
"Check"))
|
"Check"))
|
||||||
|
|||||||
Reference in New Issue
Block a user