- (let ((inserted-index (not stgit-show-worktree))
- index-node
- worktree-node
- all-patchsyms)
- (with-temp-buffer
- (let* ((standard-output (current-buffer))
- (exit-status (stgit-run-silent "series"
- "--description" "--empty")))
- (goto-char (point-min))
- (if (not (zerop exit-status))
- (cond ((looking-at "stg series: \\(.*\\)")
- (setq inserted-index t)
- (ewoc-set-hf ewoc (car (ewoc-get-hf ewoc))
- (substitute-command-keys
- "-- not initialized; run \\[stgit-init]")))
- ((looking-at ".*")
- (error "Error running stg: %s"
- (match-string 0))))
- (while (not (eobp))
- (unless (looking-at
- "\\([0 ]\\)\\([>+-]\\)\\( \\)\\([^ ]+\\) *[|#] \\(.*\\)")
- (error "Syntax error in output from stg series"))
- (let* ((state-str (match-string 2))
- (state (cond ((string= state-str ">") 'top)
- ((string= state-str "+") 'applied)
- ((string= state-str "-") 'unapplied)))
- (name (intern (match-string 4)))
- (desc (match-string 5))
- (empty (string= (match-string 1) "0")))
- (unless inserted-index
- (when (or (eq stgit-show-worktree-mode 'top)
- (and (eq stgit-show-worktree-mode 'center)
- (eq state 'unapplied)))
- (setq inserted-index t)
- (stgit-run-series-insert-index ewoc)))
- (setq all-patchsyms (cons name all-patchsyms))
- (ewoc-enter-last ewoc
- (make-stgit-patch
- :status state
- :name name
- :desc desc
- :empty empty)))
- (forward-line 1))))
+ (let (all-patchsyms)
+ (when stgit-show-committed
+ (let* ((show-svn stgit-show-svn)
+ (svn-hash stgit-svn-find-rev-hash)
+ (nentries (format "-%s" stgit-committed-count))
+ (base (stgit-id "{base}")))
+ (with-temp-buffer
+ (let* ((standard-output (current-buffer))
+ (fmt (stgit-line-format))
+ (commit-abbrev (when (string-match "%-\\([0-9]+\\)n" fmt)
+ (string-to-number (match-string 1 fmt))))
+ (exit-status (stgit-run-git-silent "--no-pager" "log"
+ "--reverse"
+ "--pretty=oneline"
+ nentries
+ base)))
+ (goto-char (point-min))
+ (if (not (zerop exit-status))
+ (message "Failed to run git log")
+ (while (not (eobp))
+ (unless (looking-at
+ "\\([0-9a-f]+\\)\\(\\.\\.\\.\\)? \\(.*\\)")
+ (error "Syntax error in output from git log"))
+ (let* ((state 'committed)
+ (name (match-string 1))
+ (desc (match-string 3))
+ (empty nil))
+
+ (when show-svn
+ (let ((svn-rev (stgit-svn-find-rev name svn-hash)))
+ (when svn-rev
+ (setq desc (format "(r%s) %s" svn-rev desc)))))
+
+ (and commit-abbrev
+ (< commit-abbrev (length name))
+ (setq name (substring name 0 commit-abbrev)))
+
+ (setq name (intern name))
+
+ (setq all-patchsyms (cons name all-patchsyms))
+ (ewoc-enter-last ewoc
+ (make-stgit-patch
+ :status state
+ :name name
+ :desc desc
+ :empty empty)))
+ (forward-line 1)))))))
+ (let ((inserted-index (not stgit-show-worktree))
+ index-node
+ worktree-node)
+ (with-temp-buffer
+ (let* ((standard-output (current-buffer))
+ (exit-status (stgit-run-silent "series"
+ "--description" "--empty")))
+ (goto-char (point-min))
+ (if (not (zerop exit-status))
+ (cond ((looking-at "stg series: \\(.*\\)")
+ (setq inserted-index t)
+ (ewoc-set-hf ewoc (car (ewoc-get-hf ewoc))
+ (substitute-command-keys
+ "-- not initialized; run \\[stgit-init]")))
+ ((looking-at ".*")
+ (error "Error running stg: %s"
+ (match-string 0))))
+ (while (not (eobp))
+ (unless (looking-at
+ "\\([0 ]\\)\\([>+-]\\)\\( \\)\\([^ ]+\\) *[|#] \\(.*\\)")
+ (error "Syntax error in output from stg series"))
+ (let* ((state-str (match-string 2))
+ (state (cond ((string= state-str ">") 'top)
+ ((string= state-str "+") 'applied)
+ ((string= state-str "-") 'unapplied)))
+ (name (intern (match-string 4)))
+ (desc (match-string 5))
+ (empty (string= (match-string 1) "0")))
+ (unless inserted-index
+ (when (or (eq stgit-show-worktree-mode 'top)
+ (and (eq stgit-show-worktree-mode 'center)
+ (eq state 'unapplied)))
+ (setq inserted-index t)
+ (stgit-run-series-insert-index ewoc)))
+ (setq all-patchsyms (cons name all-patchsyms))
+ (ewoc-enter-last ewoc
+ (make-stgit-patch
+ :status state
+ :name name
+ :desc desc
+ :empty empty)))
+ (forward-line 1)))))