Add support for initializing a branch for stgit from Emacs.
authorDavid Kågedal <davidk@lysator.liu.se>
Sun, 21 Sep 2008 12:17:38 +0000 (14:17 +0200)
committerKarl Hasselström <kha@treskal.com>
Sun, 21 Sep 2008 12:17:38 +0000 (14:17 +0200)
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
contrib/stgit.el

index 5aaf311..aafefaf 100644 (file)
@@ -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)