# [StGit PATCH] Add support for initializing a branch for stgit from Emacs.

2 messages from 2008-09-09 to 2008-09-10. Participants: David Kågedal, Karl Hasselström.
Thread: https://gitlist.dev/t/15445

## David Kågedal, 2008-09-09 08:47

Subject: [StGit PATCH] Add support for initializing a branch for stgit from Emacs.
Message-ID: <878wu1904l.fsf@lysator.liu.se>
URL: https://gitlist.dev/e/878wu1904l.fsf%40lysator.liu.se

```
Signed-off-by: David Kågedal <davidk@lysator.liu.se>
---
 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.

diff --git a/contrib/stgit.el b/contrib/stgit.el
index 5aaf311..aafefaf 100644
--- a/contrib/stgit.el
+++ b/contrib/stgit.el
@@ -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)
-- 
1.6.0.rc2.7.gbf8a


-- 
David Kågedal

```

## Karl Hasselström, 2008-09-10 15:58

Subject: Re: [StGit PATCH] Add support for initializing a branch for stgit from Emacs.
Message-ID: <20080910155806.GB26098@diana.vm.bytemark.co.uk>
URL: https://gitlist.dev/e/20080910155806.GB26098%40diana.vm.bytemark.co.uk
In-Reply-To: <878wu1904l.fsf@lysator.liu.se>

```
Thanks, that's a nice addition. (I haven't had the chance to try it
out yet, though.)

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle

```
