Skip to contentSkip to conversation

Add support for initializing a branch for stgit from Emacs.

PATCH In review David Kågedal 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add support for initializing a branch for stgit from Emacs.

---
 contrib/stgit.el |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

This diff was taken against kha/experimental, but I don't think the file has changed there.

contrib/stgit.el +11 -1
index 5aaf311..aafefaf 100644
@@ -130,7 +130,10 @@ Argument DIR is the repository path."
                                     'face 'stgit-description-face)
                  (when (memq patchsym stgit-marked-patches)
                    (replace-match "*" nil nil nil 2)
-                   (setq marked (cons patchsym marked))))))
+                   (setq marked (cons patchsym marked)))))
+              ((looking-at "stg series: Branch \".*\" not initialised")
+               (forward-line 1)
+               (insert "Run M-x stgit-init to initialise")))
         (forward-line 1))
       (setq stgit-marked-patches (nreverse marked)))))
 
@@ -218,6 +221,13 @@ Commands:
       (goto-char p)
       nil)))
 
+(defun stgit-init ()
+  "Run stg init"
+  (interactive)
+  (stgit-capture-output nil
+   (stgit-run "init"))
+  (stgit-refresh))
+
 (defun stgit-mark ()
   "Mark the patch under point"
   (interactive)
Signature · 5 lines
1.6.0.rc2.7.gbf8a


-- 
David Kågedal