Skip to contentSkip to conversation

Series short description

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

lore
Share & tools
lore
#0 lore raw

cover Series short description

The following series an emacs interface to stgit patch stacks. It shows a buffer with the the output of "stg series" and allows you to do some common operations on it, such as push/pop, commit/uncommit, edit, rename, repair, and coalesce.

The coalesce command obviosly requires the kha/experimental branch. The edit command requires the edit fixes in kha/safe.

---

David Kågedal (10):
Emacs mode: coalesce command
Emacs mode: Add mark command
Emacs mode: Added stgit-new
Emacs mode: added fontification
Emacs mode: Add stgit-edit command
Emacs mode: added stgit-commit and stgit-uncommit Emacs mode: add stgit-repair
Emacs mode: Bind n and p
Emacs mode: Improve the output buffer state Add an StGit mode for emacs

Karl Hasselström (7):
Emacs mode: show patches' short description Emacs mode: Bind "G" to "stg goto"
Emacs mode: Let "P" push or pop patch at point Emacs mode: push/pop next patch, not patch at point Emacs mode: Makefile for building stgit.el Emacs mode: Add an explanatory header
Emacs mode: Show keybindings when user presses "h" or "?"

 contrib/Makefile |   19 +++
 contrib/stgit.el |  377 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 396 insertions(+), 0 deletions(-)
 create mode 100644 contrib/Makefile
 create mode 100644 contrib/stgit.el
Signature · 1 line
Signature
#1 lore raw

PATCH 1/17 Add an StGit mode for emacs

---

 contrib/stgit.el |  141 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 141 insertions(+), 0 deletions(-)
 create mode 100644 contrib/stgit.el
contrib/stgit.el new file +141 -0
new file mode 100644
index 0000000..1bdc0a5
@@ -0,0 +1,141 @@
+(defun stgit (dir)
+  "Manage stgit patches"
+  (interactive "DDirectory: \n")
+  (switch-to-stgit-buffer dir)
+  (stgit-refresh))
+
+(defun switch-to-stgit-buffer (dir)
+  "Switch to a (possibly new) buffer displaying StGit patches for DIR"
+  (setq dir (file-name-as-directory dir))
+  (let ((buffers (buffer-list)))
+    (while (and buffers
+                (not (with-current-buffer (car buffers)
+                       (and (eq major-mode 'stgit-mode)
+                            (string= default-directory dir)))))
+      (setq buffers (cdr buffers)))
+    (switch-to-buffer (if buffers
+                          (car buffers)
+                        (create-stgit-buffer dir)))))
+
+(defun create-stgit-buffer (dir)
+  "Create a buffer for showing StGit patches.
+Argument DIR is the repository path."
+  (let ((buf (create-file-buffer (concat dir "*stgit*")))
+        (inhibit-read-only t))
+    (with-current-buffer buf
+      (setq default-directory dir)
+      (stgit-mode)
+      (setq buffer-read-only t))
+    buf))
+
+(defmacro stgit-capture-output (name &rest body)
+  "Capture StGit output and show it in a window at the end"
+  `(let ((output-buf (get-buffer-create ,(or name "*StGit output*"))))
+     (with-current-buffer output-buf
+       (erase-buffer))
+     (let ((standard-output output-buf))
+       ,@body)
+     (if (with-current-buffer output-buf (< (point-min) (point-max)))
+         (display-buffer output-buf t))))
+(put 'stgit-capture-output 'lisp-indent-function 1)
+
+(defun stgit-run (&rest args)
+  (apply 'call-process "stg" nil standard-output nil args))
+
+(defun stgit-refresh ()
+  "Update the contents of the stgit buffer"
+  (interactive)
+  (let ((inhibit-read-only t)
+        (curline (line-number-at-pos))
+        (curpatch (stgit-patch-at-point)))
+    (erase-buffer)
+    (insert "Branch: ")
+    (stgit-run "branch")
+    (stgit-run "series")
+    (if curpatch
+        (stgit-goto-patch curpatch)
+      (goto-line curline))))
+
+(defvar stgit-mode-hook nil
+  "Run after `stgit-mode' is setup.")
+
+(defvar stgit-mode-map nil
+  "Keymap for StGit major mode.")
+
+(unless stgit-mode-map
+  (setq stgit-mode-map (make-keymap))
+  (suppress-keymap stgit-mode-map)
+  (define-key stgit-mode-map "g"   'stgit-refresh)
+  (define-key stgit-mode-map "r"   'stgit-rename)
+  (define-key stgit-mode-map ">"   'stgit-push-next)
+  (define-key stgit-mode-map "<"   'stgit-pop)
+  (define-key stgit-mode-map "="   'stgit-show))
+
+(defun stgit-mode ()
+  "Major mode for interacting with StGit.
+Commands:
+\\{stgit-mode-map}"
+  (kill-all-local-variables)
+  (buffer-disable-undo)
+  (setq mode-name "StGit"
+        major-mode 'stgit-mode
+        goal-column 2)
+  (use-local-map stgit-mode-map)
+  (set (make-local-variable 'list-buffers-directory) default-directory)
+  (run-hooks 'stgit-mode-hook))
+
+(defun stgit-patch-at-point ()
+  "Return the patch name on the current line"
+  (save-excursion
+    (beginning-of-line)
+    (if (looking-at "[>+-] \\(.*\\)")
+        (match-string 1)
+      nil)))
+
+(defun stgit-goto-patch (patch)
+  "Move point to the line containing PATCH"
+  (let ((p (point)))
+    (goto-char (point-min))
+    (if (re-search-forward (concat "[>+-] " (regexp-quote patch) "$") nil t)
+        (progn (move-to-column goal-column)
+               t)
+      (goto-char p)
+      nil)))
+
+(defun stgit-rename (name)
+  "Rename the patch under point"
+  (interactive (list (read-string "Patch name: " (stgit-patch-at-point))))
+  (let ((old-name (stgit-patch-at-point)))
+    (unless old-name
+      (error "No patch on this line"))
+    (stgit-capture-output nil
+      (stgit-run "rename" old-name name))
+    (stgit-refresh)
+    (stgit-goto-patch name)))
+
+(defun stgit-push-next ()
+  "Push the patch on the line after pos"
+  (interactive)
+  (forward-line 1)
+  (let ((patch (stgit-patch-at-point)))
+    (stgit-capture-output nil
+      (stgit-run "push" patch))
+    (stgit-refresh)))
+
+(defun stgit-pop ()
+  "Pop the patch on the current line"
+  (interactive)
+  (let ((patch (stgit-patch-at-point)))
+    (stgit-capture-output nil
+      (stgit-run "pop" patch))
+    (stgit-refresh)
+    (previous-line)))
+
+(defun stgit-show ()
+  "Show the patch on the current line"
+  (interactive)
+  (stgit-capture-output "*StGit patch*"
+    (stgit-run "show" (stgit-patch-at-point))
+    (with-current-buffer standard-output
+      (goto-char (point-min))
+      (diff-mode))))
#2 lore raw

PATCH 2/17 Emacs mode: Show keybindings when user presses "h" or "?"

In reply to David Kågedal

From: Karl Hasselström <[email protected]>

These are the same keys the git emacs mode uses.

---

 contrib/stgit.el |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
contrib/stgit.el +7 -0
index 1bdc0a5..09dec8b 100644
@@ -65,6 +65,8 @@ Argument DIR is the repository path."
 (unless stgit-mode-map
   (setq stgit-mode-map (make-keymap))
   (suppress-keymap stgit-mode-map)
+  (define-key stgit-mode-map "?"   'stgit-help)
+  (define-key stgit-mode-map "h"   'stgit-help)
   (define-key stgit-mode-map "g"   'stgit-refresh)
   (define-key stgit-mode-map "r"   'stgit-rename)
   (define-key stgit-mode-map ">"   'stgit-push-next)
@@ -139,3 +141,8 @@ Commands:
     (with-current-buffer standard-output
       (goto-char (point-min))
       (diff-mode))))
+
+(defun stgit-help ()
+  "Display help for the StGit mode."
+  (interactive)
+  (describe-function 'stgit-mode))
#3 lore raw

PATCH 3/17 Emacs mode: Add an explanatory header

In reply to David Kågedal

From: Karl Hasselström <[email protected]>

---

 contrib/stgit.el |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
contrib/stgit.el +13 -0
index 09dec8b..cce0c0e 100644
@@ -1,3 +1,14 @@
+;; stgit.el: An emacs mode for StGit
+;;
+;; Copyright (C) 2007 David Kågedal <[email protected]>
+;;
+;; To install: put this file on the load-path and place the following
+;; in your .emacs file:
+;;
+;;    (require 'stgit)
+;;
+;; To start: `M-x stgit'
+
 (defun stgit (dir)
   "Manage stgit patches"
   (interactive "DDirectory: \n")
@@ -146,3 +157,5 @@ Commands:
   "Display help for the StGit mode."
   (interactive)
   (describe-function 'stgit-mode))
+
+(provide 'stgit)
#4 lore raw

PATCH 4/17 Emacs mode: Makefile for building stgit.el

In reply to David Kågedal

From: Karl Hasselström <[email protected]>

Shamelessly stolen from git's contrib/emacs/Makefile.

---

 contrib/Makefile |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
 create mode 100644 contrib/Makefile
contrib/Makefile new file +19 -0
new file mode 100644
index 0000000..8556910
@@ -0,0 +1,19 @@
+EMACS = emacs
+
+ELC = stgit.elc
+INSTALL ?= install
+INSTALL_ELC = $(INSTALL) -m 644
+prefix ?= $(HOME)
+emacsdir = $(prefix)/share/emacs/site-lisp
+RM ?= rm -f
+
+all: $(ELC)
+
+install: all
+	$(INSTALL) -d $(DESTDIR)$(emacsdir)
+	$(INSTALL_ELC) $(ELC:.elc=.el) $(ELC) $(DESTDIR)$(emacsdir)
+
+%.elc: %.el
+	$(EMACS) -batch -f batch-byte-compile $<
+
+clean:; $(RM) $(ELC)
#5 lore raw

PATCH 5/17 Emacs mode: push/pop next patch, not patch at point

In reply to David Kågedal

From: Karl Hasselström <[email protected]>

The three operations we should have are:

* Pop the topmost applied patch, no matter where point is.

* Push the first unapplied patch, no matter where point is.

* Push/pop the patch at point, depending on whether it's currently applied.

This patch makes "<" and ">" do the first two operations. The third is coming in a later patch.

---

 contrib/stgit.el |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)
contrib/stgit.el +8 -14
index cce0c0e..17b5d6b 100644
@@ -81,7 +81,7 @@ Argument DIR is the repository path."
   (define-key stgit-mode-map "g"   'stgit-refresh)
   (define-key stgit-mode-map "r"   'stgit-rename)
   (define-key stgit-mode-map ">"   'stgit-push-next)
-  (define-key stgit-mode-map "<"   'stgit-pop)
+  (define-key stgit-mode-map "<"   'stgit-pop-next)
   (define-key stgit-mode-map "="   'stgit-show))
 
 (defun stgit-mode ()
@@ -127,22 +127,16 @@ Commands:
     (stgit-goto-patch name)))
 
 (defun stgit-push-next ()
-  "Push the patch on the line after pos"
+  "Push the first unapplied patch"
   (interactive)
-  (forward-line 1)
-  (let ((patch (stgit-patch-at-point)))
-    (stgit-capture-output nil
-      (stgit-run "push" patch))
-    (stgit-refresh)))
+  (stgit-capture-output nil (stgit-run "push"))
+  (stgit-refresh))
 
-(defun stgit-pop ()
-  "Pop the patch on the current line"
+(defun stgit-pop-next ()
+  "Pop the topmost applied patch"
   (interactive)
-  (let ((patch (stgit-patch-at-point)))
-    (stgit-capture-output nil
-      (stgit-run "pop" patch))
-    (stgit-refresh)
-    (previous-line)))
+  (stgit-capture-output nil (stgit-run "pop"))
+  (stgit-refresh))
 
 (defun stgit-show ()
   "Show the patch on the current line"
#6 lore raw

PATCH 6/17 Emacs mode: Let "P" push or pop patch at point

In reply to David Kågedal

From: Karl Hasselström <[email protected]>

When the user presses "P", push or pop the patch at point depending on whether it's applied or unapplied.

---

 contrib/stgit.el |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
contrib/stgit.el +16 -0
index 17b5d6b..d371e71 100644
@@ -82,6 +82,7 @@ Argument DIR is the repository path."
   (define-key stgit-mode-map "r"   'stgit-rename)
   (define-key stgit-mode-map ">"   'stgit-push-next)
   (define-key stgit-mode-map "<"   'stgit-pop-next)
+  (define-key stgit-mode-map "P"   'stgit-push-or-pop)
   (define-key stgit-mode-map "="   'stgit-show))
 
 (defun stgit-mode ()
@@ -138,6 +139,21 @@ Commands:
   (stgit-capture-output nil (stgit-run "pop"))
   (stgit-refresh))
 
+(defun stgit-applied-at-point ()
+  "Is the patch on the current line applied?"
+  (save-excursion
+    (beginning-of-line)
+    (looking-at "[>+]")))
+
+(defun stgit-push-or-pop ()
+  "Push or pop the patch on the current line"
+  (interactive)
+  (let ((patch (stgit-patch-at-point))
+        (applied (stgit-applied-at-point)))
+    (stgit-capture-output nil
+       (stgit-run (if applied "pop" "push") patch))
+    (stgit-refresh)))
+
 (defun stgit-show ()
   "Show the patch on the current line"
   (interactive)
#7 lore raw

PATCH 7/17 Emacs mode: Bind "G" to "stg goto"

In reply to David Kågedal

From: Karl Hasselström <[email protected]>

---

 contrib/stgit.el |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
contrib/stgit.el +9 -0
index d371e71..78e9520 100644
@@ -83,6 +83,7 @@ Argument DIR is the repository path."
   (define-key stgit-mode-map ">"   'stgit-push-next)
   (define-key stgit-mode-map "<"   'stgit-pop-next)
   (define-key stgit-mode-map "P"   'stgit-push-or-pop)
+  (define-key stgit-mode-map "G"   'stgit-goto)
   (define-key stgit-mode-map "="   'stgit-show))
 
 (defun stgit-mode ()
@@ -154,6 +155,14 @@ Commands:
        (stgit-run (if applied "pop" "push") patch))
     (stgit-refresh)))
 
+(defun stgit-goto ()
+  "Go to the patch on the current line"
+  (interactive)
+  (let ((patch (stgit-patch-at-point)))
+    (stgit-capture-output nil
+       (stgit-run "goto" patch))
+    (stgit-refresh)))
+
 (defun stgit-show ()
   "Show the patch on the current line"
   (interactive)
#8 lore raw

PATCH 8/17 Emacs mode: show patches' short description

In reply to David Kågedal

From: Karl Hasselström <[email protected]>

---

 contrib/stgit.el |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
contrib/stgit.el +4 -3
index 78e9520..ed2fc37 100644
@@ -62,7 +62,7 @@ Argument DIR is the repository path."
     (erase-buffer)
     (insert "Branch: ")
     (stgit-run "branch")
-    (stgit-run "series")
+    (stgit-run "series" "--description")
     (if curpatch
         (stgit-goto-patch curpatch)
       (goto-line curline))))
@@ -97,13 +97,14 @@ Commands:
         goal-column 2)
   (use-local-map stgit-mode-map)
   (set (make-local-variable 'list-buffers-directory) default-directory)
+  (set-variable 'truncate-lines 't)
   (run-hooks 'stgit-mode-hook))
 
 (defun stgit-patch-at-point ()
   "Return the patch name on the current line"
   (save-excursion
     (beginning-of-line)
-    (if (looking-at "[>+-] \\(.*\\)")
+    (if (looking-at "[>+-] \\([^ ]*\\)")
         (match-string 1)
       nil)))
 
@@ -111,7 +112,7 @@ Commands:
   "Move point to the line containing PATCH"
   (let ((p (point)))
     (goto-char (point-min))
-    (if (re-search-forward (concat "[>+-] " (regexp-quote patch) "$") nil t)
+    (if (re-search-forward (concat "[>+-] " (regexp-quote patch) " ") nil t)
         (progn (move-to-column goal-column)
                t)
       (goto-char p)
#9 lore raw

PATCH 9/17 Emacs mode: Improve the output buffer state

In reply to David Kågedal

Make the output buffer have the correct default-directory, and make it read-only and unmodified.

---

 contrib/stgit.el |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
contrib/stgit.el +11 -4
index ed2fc37..82f0d38 100644
@@ -41,13 +41,20 @@ Argument DIR is the repository path."
 
 (defmacro stgit-capture-output (name &rest body)
   "Capture StGit output and show it in a window at the end"
-  `(let ((output-buf (get-buffer-create ,(or name "*StGit output*"))))
+  `(let ((output-buf (get-buffer-create ,(or name "*StGit output*")))
+         (stgit-dir default-directory)
+         (inhibit-read-only t))
      (with-current-buffer output-buf
-       (erase-buffer))
+       (erase-buffer)
+       (setq default-directory stgit-dir)
+       (setq buffer-read-only t))
      (let ((standard-output output-buf))
        ,@body)
-     (if (with-current-buffer output-buf (< (point-min) (point-max)))
-         (display-buffer output-buf t))))
+     (with-current-buffer output-buf
+       (set-buffer-modified-p nil)
+       (setq buffer-read-only t)
+       (if (< (point-min) (point-max))
+           (display-buffer output-buf t)))))
 (put 'stgit-capture-output 'lisp-indent-function 1)
 
 (defun stgit-run (&rest args)
#10 lore raw

PATCH 10/17 Emacs mode: Bind n and p

In reply to David Kågedal

---

 contrib/stgit.el |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
contrib/stgit.el +2 -0
index 82f0d38..2d18061 100644
@@ -85,6 +85,8 @@ Argument DIR is the repository path."
   (suppress-keymap stgit-mode-map)
   (define-key stgit-mode-map "?"   'stgit-help)
   (define-key stgit-mode-map "h"   'stgit-help)
+  (define-key stgit-mode-map "p"   'previous-line)
+  (define-key stgit-mode-map "n"   'next-line)
   (define-key stgit-mode-map "g"   'stgit-refresh)
   (define-key stgit-mode-map "r"   'stgit-rename)
   (define-key stgit-mode-map ">"   'stgit-push-next)
#11 lore raw

PATCH 11/17 Emacs mode: add stgit-repair

In reply to David Kågedal

---

 contrib/stgit.el |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
contrib/stgit.el +8 -0
index 2d18061..20cb08f 100644
@@ -89,6 +89,7 @@ Argument DIR is the repository path."
   (define-key stgit-mode-map "n"   'next-line)
   (define-key stgit-mode-map "g"   'stgit-refresh)
   (define-key stgit-mode-map "r"   'stgit-rename)
+  (define-key stgit-mode-map "\C-r"   'stgit-repair)
   (define-key stgit-mode-map ">"   'stgit-push-next)
   (define-key stgit-mode-map "<"   'stgit-pop-next)
   (define-key stgit-mode-map "P"   'stgit-push-or-pop)
@@ -138,6 +139,13 @@ Commands:
     (stgit-refresh)
     (stgit-goto-patch name)))
 
+(defun stgit-repair ()
+  "Run stg repair"
+  (interactive)
+  (stgit-capture-output nil
+   (stgit-run "repair"))
+  (stgit-refresh))
+
 (defun stgit-push-next ()
   "Push the first unapplied patch"
   (interactive)
#12 lore raw

PATCH 12/17 Emacs mode: added stgit-commit and stgit-uncommit

In reply to David Kågedal

---

 contrib/stgit.el |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
contrib/stgit.el +14 -0
index 20cb08f..4282585 100644
@@ -90,6 +90,8 @@ Argument DIR is the repository path."
   (define-key stgit-mode-map "g"   'stgit-refresh)
   (define-key stgit-mode-map "r"   'stgit-rename)
   (define-key stgit-mode-map "\C-r"   'stgit-repair)
+  (define-key stgit-mode-map "C"   'stgit-commit)
+  (define-key stgit-mode-map "U"   'stgit-uncommit)
   (define-key stgit-mode-map ">"   'stgit-push-next)
   (define-key stgit-mode-map "<"   'stgit-pop-next)
   (define-key stgit-mode-map "P"   'stgit-push-or-pop)
@@ -146,6 +148,18 @@ Commands:
    (stgit-run "repair"))
   (stgit-refresh))
 
+(defun stgit-commit ()
+  "Run stg commit."
+  (interactive)
+  (stgit-capture-output nil (stgit-run "commit"))
+  (stgit-refresh))
+
+(defun stgit-uncommit (arg)
+  "Run stg uncommit. Numeric arg determines number of patches to uncommit."
+  (interactive "p")
+  (stgit-capture-output nil (stgit-run "uncommit" "-n" (number-to-string arg)))
+  (stgit-refresh))
+
 (defun stgit-push-next ()
   "Push the first unapplied patch"
   (interactive)
#13 lore raw

PATCH 13/17 Emacs mode: Add stgit-edit command

In reply to David Kågedal

---

 contrib/stgit.el |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
contrib/stgit.el +25 -0
index 4282585..a344869 100644
@@ -89,6 +89,7 @@ Argument DIR is the repository path."
   (define-key stgit-mode-map "n"   'next-line)
   (define-key stgit-mode-map "g"   'stgit-refresh)
   (define-key stgit-mode-map "r"   'stgit-rename)
+  (define-key stgit-mode-map "e"   'stgit-edit)
   (define-key stgit-mode-map "\C-r"   'stgit-repair)
   (define-key stgit-mode-map "C"   'stgit-commit)
   (define-key stgit-mode-map "U"   'stgit-uncommit)
@@ -204,6 +205,30 @@ Commands:
       (goto-char (point-min))
       (diff-mode))))
 
+(defun stgit-edit ()
+  "Edit the patch on the current line"
+  (interactive)
+  (let ((patch (if (stgit-applied-at-point)
+                   (stgit-patch-at-point)
+                 (error "This patch is not applied")))
+        (edit-buf (get-buffer-create "*stgit edit*"))
+        (dir default-directory))
+    (log-edit 'stgit-confirm-edit t nil edit-buf)
+    (set (make-local-variable 'stgit-edit-patch) patch)
+    (setq default-directory dir)
+    (let ((standard-output edit-buf))
+      (stgit-run "edit" "--save-template=-" patch))))
+
+(defun stgit-confirm-edit ()
+  (interactive)
+  (let ((file (make-temp-file "stgit-edit-")))
+    (write-region (point-min) (point-max) file)
+    (stgit-capture-output nil
+      (stgit-run "edit" "-f" file stgit-edit-patch))
+    (with-current-buffer log-edit-parent-buffer
+      (stgit-refresh))))
+
+
 (defun stgit-help ()
   "Display help for the StGit mode."
   (interactive)
#14 lore raw

PATCH 14/17 Emacs mode: added fontification

In reply to David Kågedal

---

 contrib/stgit.el |   44 +++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 43 insertions(+), 1 deletions(-)
contrib/stgit.el +43 -1
index a344869..0859086 100644
@@ -70,10 +70,52 @@ Argument DIR is the repository path."
     (insert "Branch: ")
     (stgit-run "branch")
     (stgit-run "series" "--description")
+    (stgit-rehighlight (point-min) (point-max))
     (if curpatch
         (stgit-goto-patch curpatch)
       (goto-line curline))))
 
+(defface stgit-description-face
+  '((((background dark)) (:foreground "tan"))
+    (((background light)) (:foreground "dark red")))
+  "The face used for StGit desriptions")
+
+(defface stgit-top-patch-face
+  '((((background dark)) (:weight bold :foreground "yellow"))
+    (((background light)) (:weight bold :foreground "purple"))
+    (t (:weight bold)))
+  "The face used for the top patch names")
+
+(defface stgit-applied-patch-face
+  '((((background dark)) (:foreground "light yellow"))
+    (((background light)) (:foreground "purple"))
+    (t ()))
+  "The face used for applied patch names")
+
+(defface stgit-unapplied-patch-face
+  '((((background dark)) (:foreground "gray80"))
+    (((background light)) (:foreground "orchid"))
+    (t ()))
+  "The face used for unapplied patch names")
+
+(defun stgit-rehighlight (start end)
+  "Refresh fontification of region between START and END."
+  (save-excursion
+    (goto-char start)
+    (while (< (point) end)
+      (cond ((looking-at "Branch: \\(.*\\)")
+             (put-text-property (match-beginning 1) (match-end 1) 'face 'bold))
+            ((looking-at "\\([>+-]\\) \\([^ ]+\\) *| \\(.*\\)")
+             (let ((state (match-string 1)))
+               (put-text-property
+                (match-beginning 2) (match-end 2)
+                'face (cond ((string= state ">") 'stgit-top-patch-face)
+                            ((string= state "+") 'stgit-applied-patch-face)
+                            ((string= state "-") 'stgit-unapplied-patch-face)))
+               (put-text-property (match-beginning 3) (match-end 3)
+                                  'face 'stgit-description-face))))
+      (forward-line 1))))
+
 (defvar stgit-mode-hook nil
   "Run after `stgit-mode' is setup.")
 
@@ -118,7 +160,7 @@ Commands:
   (save-excursion
     (beginning-of-line)
     (if (looking-at "[>+-] \\([^ ]*\\)")
-        (match-string 1)
+        (match-string-no-properties 1)
       nil)))
 
 (defun stgit-goto-patch (patch)
#15 lore raw

PATCH 15/17 Emacs mode: Added stgit-new

In reply to David Kågedal

---

 contrib/stgit.el |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
contrib/stgit.el +39 -0
index 0859086..1cb4dd2 100644
@@ -132,6 +132,7 @@ Argument DIR is the repository path."
   (define-key stgit-mode-map "g"   'stgit-refresh)
   (define-key stgit-mode-map "r"   'stgit-rename)
   (define-key stgit-mode-map "e"   'stgit-edit)
+  (define-key stgit-mode-map "N"   'stgit-new)
   (define-key stgit-mode-map "\C-r"   'stgit-repair)
   (define-key stgit-mode-map "C"   'stgit-commit)
   (define-key stgit-mode-map "U"   'stgit-uncommit)
@@ -270,6 +271,44 @@ Commands:
     (with-current-buffer log-edit-parent-buffer
       (stgit-refresh))))
 
+(defun stgit-new ()
+  "Create a new patch"
+  (interactive)
+  (let ((edit-buf (get-buffer-create "*stgit edit*")))
+    (log-edit 'stgit-confirm-new t nil edit-buf)))
+
+(defun stgit-confirm-new ()
+  (interactive)
+  (let ((file (make-temp-file "stgit-edit-"))
+        (patch (stgit-create-patch-name
+                (buffer-substring (point-min)
+                                  (save-excursion (goto-char (point-min))
+                                                  (end-of-line)
+                                                  (point))))))
+    (write-region (point-min) (point-max) file)
+    (stgit-capture-output nil
+      (stgit-run "new" "-m" "placeholder" patch)
+      (stgit-run "edit" "-f" file patch))
+    (with-current-buffer log-edit-parent-buffer
+      (stgit-refresh))))
+
+(defun stgit-create-patch-name (description)
+  "Create a patch name from a long description"
+  (let ((patch ""))
+    (while (> (length description) 0)
+      (cond ((string-match "\\`[a-zA-Z_-]+" description)
+             (setq patch (downcase (concat patch (match-string 0 description))))
+             (setq description (substring description (match-end 0))))
+            ((string-match "\\` +" description)
+             (setq patch (concat patch "-"))
+             (setq description (substring description (match-end 0))))
+            ((string-match "\\`[^a-zA-Z_-]+" description)
+             (setq description (substring description (match-end 0))))))
+    (cond ((= (length patch) 0)
+           "patch")
+          ((> (length patch) 20)
+           (substring patch 0 20))
+          (t patch))))
 
 (defun stgit-help ()
   "Display help for the StGit mode."
#16 lore raw

PATCH 16/17 Emacs mode: Add mark command

In reply to David Kågedal

---

 contrib/stgit.el |   76 +++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 57 insertions(+), 19 deletions(-)
contrib/stgit.el +57 -19
index 1cb4dd2..dfbf4a0 100644
@@ -70,7 +70,7 @@ Argument DIR is the repository path."
     (insert "Branch: ")
     (stgit-run "branch")
     (stgit-run "series" "--description")
-    (stgit-rehighlight (point-min) (point-max))
+    (stgit-rescan)
     (if curpatch
         (stgit-goto-patch curpatch)
       (goto-line curline))))
@@ -98,23 +98,30 @@ Argument DIR is the repository path."
     (t ()))
   "The face used for unapplied patch names")
 
-(defun stgit-rehighlight (start end)
-  "Refresh fontification of region between START and END."
+(defun stgit-rescan ()
+  "Rescan the status buffer."
   (save-excursion
-    (goto-char start)
-    (while (< (point) end)
-      (cond ((looking-at "Branch: \\(.*\\)")
-             (put-text-property (match-beginning 1) (match-end 1) 'face 'bold))
-            ((looking-at "\\([>+-]\\) \\([^ ]+\\) *| \\(.*\\)")
-             (let ((state (match-string 1)))
-               (put-text-property
-                (match-beginning 2) (match-end 2)
-                'face (cond ((string= state ">") 'stgit-top-patch-face)
-                            ((string= state "+") 'stgit-applied-patch-face)
-                            ((string= state "-") 'stgit-unapplied-patch-face)))
-               (put-text-property (match-beginning 3) (match-end 3)
-                                  'face 'stgit-description-face))))
-      (forward-line 1))))
+    (let ((marked ()))
+      (goto-char (point-min))
+      (while (not (eobp))
+        (cond ((looking-at "Branch: \\(.*\\)")
+               (put-text-property (match-beginning 1) (match-end 1)
+                                  'face 'bold))
+              ((looking-at "\\([>+-]\\)\\( \\)\\([^ ]+\\) *| \\(.*\\)")
+               (let ((state (match-string 1))
+                     (patchsym (intern (match-string 3))))
+                 (put-text-property
+                  (match-beginning 3) (match-end 3) 'face
+                  (cond ((string= state ">") 'stgit-top-patch-face)
+                        ((string= state "+") 'stgit-applied-patch-face)
+                        ((string= state "-") 'stgit-unapplied-patch-face)))
+                 (put-text-property (match-beginning 4) (match-end 4)
+                                    'face 'stgit-description-face)
+                 (when (memq patchsym stgit-marked-patches)
+                   (replace-match "*" nil nil nil 2)
+                   (setq marked (cons patchsym marked))))))
+        (forward-line 1))
+      (setq stgit-marked-patches (nreverse marked)))))
 
 (defvar stgit-mode-hook nil
   "Run after `stgit-mode' is setup.")
@@ -125,6 +132,8 @@ Argument DIR is the repository path."
 (unless stgit-mode-map
   (setq stgit-mode-map (make-keymap))
   (suppress-keymap stgit-mode-map)
+  (define-key stgit-mode-map " "   'stgit-mark)
+  (define-key stgit-mode-map "\d" 'stgit-unmark)
   (define-key stgit-mode-map "?"   'stgit-help)
   (define-key stgit-mode-map "h"   'stgit-help)
   (define-key stgit-mode-map "p"   'previous-line)
@@ -153,14 +162,27 @@ Commands:
         goal-column 2)
   (use-local-map stgit-mode-map)
   (set (make-local-variable 'list-buffers-directory) default-directory)
+  (set (make-local-variable 'stgit-marked-patches) nil)
   (set-variable 'truncate-lines 't)
   (run-hooks 'stgit-mode-hook))
 
+(defun stgit-add-mark (patch)
+  (let ((patchsym (intern patch)))
+    (setq stgit-marked-patches (cons patchsym stgit-marked-patches))))
+
+(defun stgit-remove-mark (patch)
+  (let ((patchsym (intern patch)))
+    (setq stgit-marked-patches (delq patchsym stgit-marked-patches))))
+
+(defun stgit-marked-patches ()
+  "Return the names of the marked patches."
+  (mapcar 'symbol-name stgit-marked-patches))
+
 (defun stgit-patch-at-point ()
   "Return the patch name on the current line"
   (save-excursion
     (beginning-of-line)
-    (if (looking-at "[>+-] \\([^ ]*\\)")
+    (if (looking-at "[>+-][ *]\\([^ ]*\\)")
         (match-string-no-properties 1)
       nil)))
 
@@ -168,12 +190,28 @@ Commands:
   "Move point to the line containing PATCH"
   (let ((p (point)))
     (goto-char (point-min))
-    (if (re-search-forward (concat "[>+-] " (regexp-quote patch) " ") nil t)
+    (if (re-search-forward (concat "^[>+-][ *]" (regexp-quote patch) " ") nil t)
         (progn (move-to-column goal-column)
                t)
       (goto-char p)
       nil)))
 
+(defun stgit-mark ()
+  "Mark the patch under point"
+  (interactive)
+  (let ((patch (stgit-patch-at-point)))
+    (stgit-add-mark patch)
+    (stgit-refresh))
+  (next-line))
+
+(defun stgit-unmark ()
+  "Mark the patch on the previous line"
+  (interactive)
+  (forward-line -1)
+  (let ((patch (stgit-patch-at-point)))
+    (stgit-remove-mark patch)
+    (stgit-refresh)))
+
 (defun stgit-rename (name)
   "Rename the patch under point"
   (interactive (list (read-string "Patch name: " (stgit-patch-at-point))))
#17 lore raw

PATCH 17/17 Emacs mode: coalesce command

In reply to David Kågedal

---

 contrib/stgit.el |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
contrib/stgit.el +21 -0
index dfbf4a0..4d0faca 100644
@@ -141,6 +141,7 @@ Argument DIR is the repository path."
   (define-key stgit-mode-map "g"   'stgit-refresh)
   (define-key stgit-mode-map "r"   'stgit-rename)
   (define-key stgit-mode-map "e"   'stgit-edit)
+  (define-key stgit-mode-map "c"   'stgit-coalesce)
   (define-key stgit-mode-map "N"   'stgit-new)
   (define-key stgit-mode-map "\C-r"   'stgit-repair)
   (define-key stgit-mode-map "C"   'stgit-commit)
@@ -348,6 +349,26 @@ Commands:
            (substring patch 0 20))
           (t patch))))
 
+(defun stgit-coalesce (patch-names)
+  "Run stg coalesce on the named patches"
+  (interactive (list (stgit-marked-patches)))
+  (let ((edit-buf (get-buffer-create "*stgit edit*"))
+        (dir default-directory))
+    (log-edit 'stgit-confirm-coalesce t nil edit-buf)
+    (set (make-local-variable 'stgit-patches) patch-names)
+    (setq default-directory dir)
+    (let ((standard-output edit-buf))
+      (apply 'stgit-run "coalesce" "--save-template=-" patch-names))))
+
+(defun stgit-confirm-coalesce ()
+  (interactive)
+  (let ((file (make-temp-file "stgit-edit-")))
+    (write-region (point-min) (point-max) file)
+    (stgit-capture-output nil
+      (apply 'stgit-run "coalesce" "-f" file stgit-patches))
+    (with-current-buffer log-edit-parent-buffer
+      (stgit-refresh))))
+
 (defun stgit-help ()
   "Display help for the StGit mode."
   (interactive)
#18 lore raw
In reply to David Kågedal
Quoted 4 lines · David Kågedal

The following series an emacs interface to stgit patch stacks. It shows a buffer with the the output of "stg series" and allows you to do some common operations on it, such as push/pop, commit/uncommit, edit, rename, repair, and coalesce.

That's really cool stuff! Thanks.

Quoted 2 lines

The coalesce command obviosly requires the kha/experimental branch. The edit command requires the edit fixes in kha/safe.

I'll start this week merging patches from kha/experimental (I'm a bit slow because of the Christmas activities).

Signature · 1 line
Catalin
#19 lore raw
Quoted 8 lines · Catalin Marinas
Quoted 4 lines · David Kågedal

The following series an emacs interface to stgit patch stacks. It shows a buffer with the the output of "stg series" and allows you to do some common operations on it, such as push/pop, commit/uncommit, edit, rename, repair, and coalesce.

That's really cool stuff! Thanks.

Yes, incredibly useful.

I've put this series in kha/safe -- except for the mark and coalesce patches, which are at the tip of kha/experimental. The latter because it obviously has to be, the former because the latter is the only thing using it and it's _extremely annoying_ to be able to mark patches but not, say, push or pop all marked patches.

My stack is now 53 patches deep, so running the test suite on every patch is getting time consuming -- I'd guess about two hours on my poor laptop. And I plan to sleep while that runs, so I won't actually push this until tomorrow.

Quoted 5 lines
Quoted 2 lines

The coalesce command obviosly requires the kha/experimental branch. The edit command requires the edit fixes in kha/safe.

I'll start this week merging patches from kha/experimental (I'm a bit slow because of the Christmas activities).

Be careful about merging past the "goto" patch -- I'm pretty sure it breaks when called from a subdirectory, and I don't have time to fix that right now. (It should be a clean fix, though -- just adjust the cwd for precisely those git subprocesses that need it, which is very few. I think.)

If you like, I can advance "safe" to include as many patches as I think you should merge right now.

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#20 lore raw

kha/safe and kha/experimental updated

Quoted 2 lines · Karl Hasselström

If you like, I can advance "safe" to include as many patches as I think you should merge right now.

And here it is:

The following changes since commit 5be69cd8d89bd89be31364e9c0fd9e947b6ef644:
Karl Hasselström (1):
Name the exit codes to improve legibility

are available in the git repository at:

git://repo.or.cz/stgit/kha.git safe

David Kågedal (17):
Add an StGit mode for emacs
Emacs mode: Improve the output buffer state
Emacs mode: Bind n and p
Emacs mode: add stgit-repair
Emacs mode: added stgit-commit and stgit-uncommit Emacs mode: Add stgit-edit command
Emacs mode: added fontification
Emacs mode: Added stgit-new
Check bottom and invariants
Remove the 'bottom' field
Remove the 'top' field
Split git.merge into two functions
Leave working dir and index alone after failed (conflicting) push Added a test case to check what happens when push finds a conflict Simplify merge_recursive
Use the output from merge-recursive to list conflicts Ask git about unmerged files

Karl Hasselström (24):
Emacs mode: Show keybindings when user presses "h" or "?" Emacs mode: Add an explanatory header
Emacs mode: Makefile for building stgit.el
Emacs mode: push/pop next patch, not patch at point Emacs mode: Let "P" push or pop patch at point
Emacs mode: Bind "G" to "stg goto"
Emacs mode: show patches' short description
Write removed fields for backwards compatibility Nicer conflict markers
Better error message if merge fails
Fix "stg resolved" to work with new conflict representation
Refactoring: pass more than one file to resolved()
We keep the different stages of a conflict in the index now "stg status --reset" is not needed anymore
Remove "stg add"
Remove "stg rm"
Remove "stg cp"
Remove "stg resolved"
New StGit core infrastructure: repository operations Write metadata files used by the old infrastructure Upgrade older stacks to newest version
Let "stg clean" use the new infrastructure
Add "stg coalesce"
Let "stg applied" and "stg unapplied" use the new infrastructure

 Documentation/stg-cp.txt      |   63 --------
 Documentation/stg.txt         |    2 -
 Documentation/tutorial.txt    |   31 +++--
 contrib/Makefile              |   19 +++
 contrib/stgit-completion.bash |    4 +-
 contrib/stgit.el              |  318 +++++++++++++++++++++++++++++++++++++++++
 examples/gitconfig            |   19 +---
 setup.py                      |    2 +-
 stgit/commands/add.py         |   44 ------
 stgit/commands/applied.py     |   27 ++--
 stgit/commands/clean.py       |   68 +++++-----
 stgit/commands/coalesce.py    |   84 +++++++++++
 stgit/commands/common.py      |   39 +++---
 stgit/commands/copy.py        |   45 ------
 stgit/commands/pick.py        |    2 +-
 stgit/commands/resolved.py    |   94 ------------
 stgit/commands/rm.py          |   48 ------
 stgit/commands/status.py      |   31 ++---
 stgit/commands/sync.py        |    1 -
 stgit/commands/unapplied.py   |   23 ++--
 stgit/config.py               |    1 -
 stgit/git.py                  |   75 ++++++----
 stgit/gitmergeonefile.py      |   97 +------------
 stgit/lib/__init__.py         |   18 +++
 stgit/lib/git.py              |  260 +++++++++++++++++++++++++++++++++
 stgit/lib/stack.py            |  172 ++++++++++++++++++++++
 stgit/lib/stackupgrade.py     |   96 ++++++++++++
 stgit/lib/transaction.py      |   79 ++++++++++
 stgit/main.py                 |   10 +-
 stgit/run.py                  |    3 +
 stgit/stack.py                |  156 ++++----------------
 stgit/utils.py                |   24 +++
 t/t0002-status.sh             |   15 +-
 t/t1200-push-modified.sh      |    2 +-
 t/t1202-push-undo.sh          |    6 +-
 t/t1203-push-conflict.sh      |   70 +++++++++
 t/t1204-pop-keep.sh           |    2 +-
 t/t1205-push-subdir.sh        |    8 +-
 t/t1300-uncommit.sh           |    4 +-
 t/t1301-repair.sh             |    2 +-
 t/t1400-patch-history.sh      |    4 +-
 t/t1500-float.sh              |   14 +-
 t/t1600-delete-one.sh         |   12 +-
 t/t1601-delete-many.sh        |    2 +-
 t/t1700-goto-top.sh           |    2 +-
 t/t2000-sync.sh               |   12 +-
 t/t2100-pull-policy-fetch.sh  |    4 +-
 t/t2101-pull-policy-pull.sh   |    4 +-
 t/t2102-pull-policy-rebase.sh |    4 +-
 t/t2300-refresh-subdir.sh     |    2 +-
 t/t2600-coalesce.sh           |   31 ++++
 51 files changed, 1420 insertions(+), 735 deletions(-)
 delete mode 100644 Documentation/stg-cp.txt
 create mode 100644 contrib/Makefile
 create mode 100644 contrib/stgit.el
 delete mode 100644 stgit/commands/add.py
 create mode 100644 stgit/commands/coalesce.py
 delete mode 100644 stgit/commands/copy.py
 delete mode 100644 stgit/commands/resolved.py
 delete mode 100644 stgit/commands/rm.py
 create mode 100644 stgit/lib/__init__.py
 create mode 100644 stgit/lib/git.py
 create mode 100644 stgit/lib/stack.py
 create mode 100644 stgit/lib/stackupgrade.py
 create mode 100644 stgit/lib/transaction.py
 create mode 100755 t/t1203-push-conflict.sh
 create mode 100755 t/t2600-coalesce.sh
                                 -+-

The following changes since commit 1189271615e7157ca3da3288a9ce3c9bcaeb2d5f:
Karl Hasselström (1):
Let "stg applied" and "stg unapplied" use the new infrastructure

are available in the git repository at:

git://repo.or.cz/stgit/kha.git experimental

David Kågedal (2):
Emacs mode: Add mark command
Emacs mode: coalesce command

Karl Hasselström (10):
Teach the new infrastructure about the index and worktree Let "stg clean" use the new transaction primitives Let "stg goto" use the new infrastructure
Convert "stg uncommit" to the new infrastructure New infrastructure: Make sure that the branch is initialized Expose transaction abort function
stg coalesce: Support --file and --save-template Set exit code to 3 on merge conflict
Convert "stg commit" to new infrastructure
Make "stg commit" fancier

 contrib/stgit.el           |   97 +++++++++++++++++++-----
 stgit/commands/clean.py    |   35 ++-------
 stgit/commands/coalesce.py |  118 +++++++++++++++++++----------
 stgit/commands/commit.py   |  111 +++++++++++++++++----------
 stgit/commands/goto.py     |   52 +++++---------
 stgit/commands/uncommit.py |   81 +++++++++-----------
 stgit/lib/git.py           |  127 +++++++++++++++++++++++++++++++
 stgit/lib/stack.py         |   10 ++-
 stgit/lib/stackupgrade.py  |    6 +-
 stgit/lib/transaction.py   |  178 ++++++++++++++++++++++++++++++++++++++------
 stgit/main.py              |    4 +-
 stgit/utils.py             |    1 +
 t/t1300-uncommit.sh        |   12 ++--
 13 files changed, 588 insertions(+), 244 deletions(-)
Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#21 lore raw

Re: kha/safe and kha/experimental updated

Thanks again for maintaining these branches.

Quoted 3 lines · Karl Hasselström

git://repo.or.cz/stgit/kha.git safe

David Kågedal (17):

[...]

Quoted 2 lines

Simplify merge_recursive
Use the output from merge-recursive to list conflicts

I'll drop git.merge() entirely since it is only used by the 'sync' command due to the performance issues I had in the past with rename detection in git-merge-recursive. Hopefully, these are gone now.

I'll try to fix the automatic invocation of the interactive merger in case of conflicts (it is only present in git.merge()).

Quoted 2 lines

Karl Hasselström (24):
Fix "stg resolved" to work with new conflict representation

For some reason, the interactive resolving keeps invoking the merger. I'll have a look.

Quoted 1 line

"stg status --reset" is not needed anymore

I would keep this as an alias for 'git reset --hard' (see below as well).

Quoted 3 lines

Remove "stg add"
Remove "stg rm"
Remove "stg cp"

I plan to add a generic command for these kind of aliases. The reason is that I don't really like mixing GIT and StGIT commands (I think at some point I'll get confused and try to run stg commands with git).

Quoted 1 line

Remove "stg resolved"

I'd like to keep this command. git-mergetool doesn't support the tool I use (emacs + ediff and more stgit-specific file extensions like current, patch etc.). I also don't find 'git add' to be meaningful for marking a conflict as solved.

Signature · 1 line
Catalin
#22 lore raw

Re: kha/safe and kha/experimental updated

Quoted 7 lines · Catalin Marinas
Quoted 1 line · Karl Hasselström

"stg status --reset" is not needed anymore

I would keep this as an alias for 'git reset --hard' (see below as well).

Quoted 8 lines
Quoted 3 lines

Remove "stg add"
Remove "stg rm"
Remove "stg cp"

I plan to add a generic command for these kind of aliases. The reason is that I don't really like mixing GIT and StGIT commands (I think at some point I'll get confused and try to run stg commands with git).

How should these aliases be presented in the documentation etc.? I suggest making it very clear that they are only aliases.

Quoted 5 lines
Quoted 1 line

Remove "stg resolved"

I'd like to keep this command. git-mergetool doesn't support the tool I use (emacs + ediff and more stgit-specific file extensions like current, patch etc.).

So why have a separate command instead of fixing git-mergetool?

Quoted 2 lines

I also don't find 'git add' to be meaningful for marking a conflict as solved.

So maybe let "stg resolved" be an alias for "git add"?

This is all our usual disagreement: You want stg to be a fairly standalone tool, and I want it to be a tool to use side by side with git. The problem I see with your approach is that stg risks ending up like Cogito: it'll provide inspiration for improving git, but will itself become obsolete because of the simple fact that git has so much more development manpower. I think it'd be more productive to let stg do one thing -- patch stacks -- and do it well, and rely on git for everything else.

Of course, if stuff like "stg add" and "stg resolved" are really implemented as three-line wrappers around git commands, we don't have that problem.

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#23 lore raw

Re: kha/safe and kha/experimental updated

Quoted 13 lines · Karl Hasselström
Quoted 11 lines · Catalin Marinas
Quoted 1 line · Karl Hasselström

"stg status --reset" is not needed anymore

I would keep this as an alias for 'git reset --hard' (see below as well).

Quoted 3 lines

Remove "stg add"
Remove "stg rm"
Remove "stg cp"

Quoted 7 lines
Quoted 4 lines

I plan to add a generic command for these kind of aliases. The reason is that I don't really like mixing GIT and StGIT commands (I think at some point I'll get confused and try to run stg commands with git).

How should these aliases be presented in the documentation etc.? I suggest making it very clear that they are only aliases.

Yes, 'stg help' should clearly mark them as aliases of git commands. I'm not sure how I'll do this yet. For the 'status --reset', I'll keep it if we have a separate 'resolved' command.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Remove "stg resolved"

I'd like to keep this command. git-mergetool doesn't support the tool I use (emacs + ediff and more stgit-specific file extensions like current, patch etc.).

So why have a separate command instead of fixing git-mergetool?

In the past, StGIT only used the core git functionality and stayed away from the porcelain scripts. We now started to use some of the built-in commands more and more and I think it is fine but the git scripts look more volatile to me than the C code (look at the many variants the git merging went through, from shell scripts to python and only now seems to be stabilised with the recursive merge as a built-in command).

Adding the functionality I need to git-mergetool would also mean always using the latest GIT with StGIT. Anyway, if you like git-mergetool, I think you can easily change the StGIT configuration to

Quoted 4 lines
Quoted 2 lines

I also don't find 'git add' to be meaningful for marking a conflict as solved.

So maybe let "stg resolved" be an alias for "git add"?

It's not a simple alias, if you use 'stg resolved -a'. Now, if we allow stgit.keeporig, it needs even more functionality.

Quoted 6 lines

This is all our usual disagreement: You want stg to be a fairly standalone tool, and I want it to be a tool to use side by side with git. The problem I see with your approach is that stg risks ending up like Cogito: it'll provide inspiration for improving git, but will itself become obsolete because of the simple fact that git has so much more development manpower.

If GIT would have all the functionality I need for my workflow, I wouldn't mind giving up StGIT (I started StGIT because I needed easier patch management on top of GIT and modifying Quilt would've been too intrusive).

Quoted 3 lines

I think it'd be more productive to let stg
do one thing -- patch stacks -- and do it well, and rely on git for everything else.

In principle, yes, but I have some minor problems with the UI of GIT (like resolved == add). I think there is also a fundamental difference between 'git commit' and 'stg refresh'. The former requires explicit marking of the files to commit (or use the -a option) while the latter always adds all the local changes to the current patch. Maybe GIT users are more used to running 'git add' after fixing a conflict but I use StGIT almost exclusively.

Quoted 3 lines

Of course, if stuff like "stg add" and "stg resolved" are really implemented as three-line wrappers around git commands, we don't have that problem.

For add/rm/cp, they should just be a generic wrapper which doesn't even parse the command line options. That's not the case with 'resolved'.

Signature · 1 line
Catalin
#24 lore raw

Re: kha/safe and kha/experimental updated

Quoted 2 lines · Catalin Marinas

For the 'status --reset', I'll keep it if we have a separate 'resolved' command.

?

Quoted 7 lines

In the past, StGIT only used the core git functionality and stayed away from the porcelain scripts. We now started to use some of the built-in commands more and more and I think it is fine but the git scripts look more volatile to me than the C code (look at the many variants the git merging went through, from shell scripts to python and only now seems to be stabilised with the recursive merge as a built-in command).

Hmm? Have we started to use more porcelain lately?

Quoted 2 lines

Adding the functionality I need to git-mergetool would also mean always using the latest GIT with StGIT.

It wouldn't keep being the latest git version, though.

Quoted 2 lines

Anyway, if you like git-mergetool, I think you can easily change the StGIT configuration to

I don't use interactive merging at all. What I wanted was to get rid of StGit's own interactive merging.

Quoted 11 lines · Karl Hasselström
Quoted 7 lines · Catalin Marinas
Quoted 3 lines

I also don't find 'git add' to be meaningful for marking a conflict as solved.

So maybe let "stg resolved" be an alias for "git add"?

It's not a simple alias, if you use 'stg resolved -a'. Now, if we allow stgit.keeporig, it needs even more functionality.

Hmm, yes.

(I still don't quite like it, because I think that if there's anything that "stg resolved" does that "git add" can't do, then "git add" should learn to do it. But until it has learned it, it's a hypothetical argument.)

Quoted 10 lines
Quoted 2 lines

I think it'd be more productive to let stg do one thing -- patch stacks -- and do it well, and rely on git for everything else.

In principle, yes, but I have some minor problems with the UI of GIT (like resolved == add). I think there is also a fundamental difference between 'git commit' and 'stg refresh'. The former requires explicit marking of the files to commit (or use the -a option) while the latter always adds all the local changes to the current patch. Maybe GIT users are more used to running 'git add' after fixing a conflict but I use StGIT almost exclusively.

So you want StGit to do two things: patch stacks, and fix some git UI warts. Hey, I can live with that. :-) But I firmly believe that the wart fixing parts of StGit should be (1) optional, so that the same job can easily be done with just git; and (2) as thin as possible, to make them easy to explain in terms of git, and cheap to maintain.

Quoted 6 lines
Quoted 3 lines

Of course, if stuff like "stg add" and "stg resolved" are really implemented as three-line wrappers around git commands, we don't have that problem.

For add/rm/cp, they should just be a generic wrapper which doesn't even parse the command line options.

OK.

Quoted 1 line

That's not the case with 'resolved'.

No, I see.

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#25 lore raw

Re: kha/safe and kha/experimental updated

Quoted 6 lines · Karl Hasselström
Quoted 2 lines · Catalin Marinas

For the 'status --reset', I'll keep it if we have a separate 'resolved' command.

?

It needs to call the resolved_all to remove checked-out stages if stgit.keeporig == 'yes'. Maybe it could also do some sanity check if HEAD != top. With 'git reset --hard', people might easily add an argument and break the whole stack.

Quoted 9 lines
Quoted 7 lines

In the past, StGIT only used the core git functionality and stayed away from the porcelain scripts. We now started to use some of the built-in commands more and more and I think it is fine but the git scripts look more volatile to me than the C code (look at the many variants the git merging went through, from shell scripts to python and only now seems to be stabilised with the recursive merge as a built-in command).

Hmm? Have we started to use more porcelain lately?

I think Yann was complaining about using git-show since it looks more like a porcelain command.

Quoted 4 lines
Quoted 2 lines

Adding the functionality I need to git-mergetool would also mean always using the latest GIT with StGIT.

It wouldn't keep being the latest git version, though.

Yes, but at least initially it should be pretty recent.

Quoted 5 lines
Quoted 2 lines

Anyway, if you like git-mergetool, I think you can easily change the StGIT configuration to

I don't use interactive merging at all. What I wanted was to get rid of StGit's own interactive merging.

I use it quite often and I even invoke it automatically (stgit.autoimerge). I'll push some patches tonight together with most of your safe branch and we can alter them afterwards.

Quoted 5 lines

So you want StGit to do two things: patch stacks, and fix some git UI warts. Hey, I can live with that. :-) But I firmly believe that the wart fixing parts of StGit should be (1) optional, so that the same job can easily be done with just git; and (2) as thin as possible, to make them easy to explain in terms of git, and cheap to maintain.

Unless you need the keeporig functionality, you can now always use plain git for solving merges, add/rm/cp, 'reset --hard' etc. At some point, we could make it safe for 'git rebase' but I think we need the DAG patches.

Quoted 3 lines
Quoted 1 line

That's not the case with 'resolved'.

No, I see.

As I said, if you don't need keeporig, just use git-add (or stg-add when I'll add the alias).

Signature · 1 line
Catalin
#26 lore raw

Re: kha/safe and kha/experimental updated

Quoted 11 lines · Catalin Marinas
Quoted 6 lines · Karl Hasselström
Quoted 2 lines · Catalin Marinas

For the 'status --reset', I'll keep it if we have a separate 'resolved' command.

?

It needs to call the resolved_all to remove checked-out stages if stgit.keeporig == 'yes'.

Ah, right.

Quoted 3 lines

Maybe it could also do some sanity check if HEAD != top. With 'git reset --hard', people might easily add an argument and break the whole stack.

True.

Quoted 4 lines
Quoted 1 line

Hmm? Have we started to use more porcelain lately?

I think Yann was complaining about using git-show since it looks more like a porcelain command.

We should probably use cat-file or something instead.

Quoted 3 lines
Quoted 1 line

It wouldn't keep being the latest git version, though.

Yes, but at least initially it should be pretty recent.

:-)

Quoted 6 lines
Quoted 2 lines

I don't use interactive merging at all. What I wanted was to get rid of StGit's own interactive merging.

I use it quite often and I even invoke it automatically (stgit.autoimerge). I'll push some patches tonight together with most of your safe branch and we can alter them afterwards.

Jolly good! My stack was getting unwieldy ...

Quoted 9 lines
Quoted 6 lines

So you want StGit to do two things: patch stacks, and fix some git UI warts. Hey, I can live with that. :-) But I firmly believe that the wart fixing parts of StGit should be (1) optional, so that the same job can easily be done with just git; and (2) as thin as possible, to make them easy to explain in terms of git, and cheap to maintain.

Unless you need the keeporig functionality, you can now always use plain git for solving merges, add/rm/cp, 'reset --hard' etc.

Yes, with David's conflict series.

Quoted 2 lines

At some point, we could make it safe for 'git rebase' but I think we need the DAG patches.

I wouldn't resurrect the DAG patches for this; I'd just invoke "stg repair" automatically when we detect that top != HEAD.

But I think that for "git rebase", we'd want to teach "repair" to detect that the patches' commits have been changed, rather than just marking them unapplied.

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#27 lore raw

Re: kha/safe and kha/experimental updated

In reply to Catalin Marinas
Quoted 5 lines · Catalin Marinas
Quoted 1 line · Karl Hasselström

Fix "stg resolved" to work with new conflict representation

For some reason, the interactive resolving keeps invoking the merger. I'll have a look.

I found the problem. git.ls_files() now returns all three stages if there was a conflict and the file list got longer. I added a set to remove the duplicates.

Signature · 1 line
Catalin
#28 lore raw

Re: kha/safe and kha/experimental updated

In reply to Catalin Marinas
Quoted 11 lines · Catalin Marinas

Thanks again for maintaining these branches.

Quoted 3 lines · Karl Hasselström

git://repo.or.cz/stgit/kha.git safe

Remove "stg resolved"

I'd like to keep this command. git-mergetool doesn't support the tool I use (emacs + ediff and more stgit-specific file extensions like current, patch etc.). I also don't find 'git add' to be meaningful for marking a conflict as solved.

I also would like to have this command kept (and shown in 'stg help'!). Contrary to 'git add' it can check and add to index / update index only for files with conflict; we have -r (ancestor|current|patched) to choose one side, and we could add --check to check if there are no conflict markers with files (useful with -a/--all).

Signature · 3 lines
Jakub Narebski
Poland
ShadeHawk on #git
#29 lore raw

Re: kha/safe and kha/experimental updated

Quoted 11 lines · Jakub Narebski
Quoted 8 lines · Catalin Marinas
Quoted 1 line · Karl Hasselström

Remove "stg resolved"

I'd like to keep this command. git-mergetool doesn't support the tool I use (emacs + ediff and more stgit-specific file extensions like current, patch etc.). I also don't find 'git add' to be meaningful for marking a conflict as solved.

Quoted 6 lines

I also would like to have this command kept (and shown in 'stg help'!). Contrary to 'git add' it can check and add to index / update index only for files with conflict; we have -r (ancestor|current|patched) to choose one side, and we could add --check to check if there are no conflict markers with files (useful with -a/--all).

This too sounds like stuff that could profitably be added to "git add". Except for the ancestor/current/patched words, it is not specific to patch stacks, so the implementation should be in git and not in stg.

IMHO, of course. :-)

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#30 lore raw

Re: kha/safe and kha/experimental updated

Quoted 19 lines · Karl Hasselström
Quoted 11 lines · Jakub Narebski
Quoted 8 lines · Catalin Marinas
Quoted 1 line · Karl Hasselström

Remove "stg resolved"

I'd like to keep this command. git-mergetool doesn't support the tool I use (emacs + ediff and more stgit-specific file extensions like current, patch etc.). I also don't find 'git add' to be meaningful for marking a conflict as solved.

Quoted 6 lines

I also would like to have this command kept (and shown in 'stg help'!). Contrary to 'git add' it can check and add to index / update index only for files with conflict; we have -r (ancestor|current|patched) to choose one side, and we could add --check to check if there are no conflict markers with files (useful with -a/--all).

Quoted 4 lines

This too sounds like stuff that could profitably be added to "git add". Except for the ancestor/current/patched words, it is not specific to patch stacks, so the implementation should be in git and not in stg.

No it cannot, at least the '-r (ancestor|current|patched)' part for resetting file to given version, even if we change the wording to ancestor, ours and theirs. The git-add command is about adding contents, which updates index, which almost as a intended side-effect clears merge state, i.e. stages; and not about resetting to stage.

Besides with "stg resolved" you can update index _only_ for files which were in the conflict, also for -a/--all, and not all the files not only those which were in the conflict like "git add -u" does.

"stg resolved --check" could happily ignore things that only look like conflict markers, but must have been intended, because they are in files not in conflict.

Unless you are talking about adding "resolve"/"resolved" command to git-core, as a porcelain wrapper around git-update-index, like "git add"...

P.S. I have just noticed that 'git-checkout' [<tree-ish>] <paths>... form of operation is not documented; you can derive what it do only from examples.

Signature · 2 lines
Jakub Narebski
Poland
#31 lore raw

Re: kha/safe and kha/experimental updated

Quoted 16 lines · Jakub Narebski
Quoted 9 lines · Karl Hasselström
Quoted 6 lines · Jakub Narebski

I also would like to have this command kept (and shown in 'stg help'!). Contrary to 'git add' it can check and add to index / update index only for files with conflict; we have -r (ancestor|current|patched) to choose one side, and we could add --check to check if there are no conflict markers with files (useful with -a/--all).

Quoted 4 lines

This too sounds like stuff that could profitably be added to "git add". Except for the ancestor/current/patched words, it is not specific to patch stacks, so the implementation should be in git and not in stg.

Quoted 6 lines

No it cannot, at least the '-r (ancestor|current|patched)' part for resetting file to given version, even if we change the wording to ancestor, ours and theirs. The git-add command is about adding contents, which updates index, which almost as a intended side-effect clears merge state, i.e. stages; and not about resetting to stage.

  git checkout-index --stage=1|2|3 <filename>

does what you want. But "git cat-file" knows this handy syntax for getting at particular index stages:

:stage:<filename>

It would be very convenient to be able to do

git checkout :stage:<filename>

but it doesn't seem to work currently. Does anyone know the "best" way of manually checking out a particular index stage in git?

Quoted 3 lines

Besides with "stg resolved" you can update index _only_ for files which were in the conflict, also for -a/--all, and not all the files not only those which were in the conflict like "git add -u" does.

This sounds like a straightforward addition to "git add".

Quoted 3 lines

"stg resolved --check" could happily ignore things that only look like conflict markers, but must have been intended, because they are in files not in conflict.

git knows about conflicting files too.

Quoted 3 lines

Unless you are talking about adding "resolve"/"resolved" command to git-core, as a porcelain wrapper around git-update-index, like "git add"...

Yes, that's what I want. You and others like what "stg resolved" does, but I don't want it in StGit because it's a generic git enhancement that has nothing to with patch stacks. People who don't use StGit would presumably like it as well.

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#32 lore raw

Re: kha/safe and kha/experimental updated

Quoted 23 lines · Karl Hasselström
Quoted 15 lines · Jakub Narebski
Quoted 9 lines · Karl Hasselström
Quoted 6 lines · Jakub Narebski

I also would like to have this command kept (and shown in 'stg help'!). Contrary to 'git add' it can check and add to index / update index only for files with conflict; we have -r (ancestor|current|patched) to choose one side, and we could add --check to check if there are no conflict markers with files (useful with -a/--all).

Quoted 4 lines

This too sounds like stuff that could profitably be added to "git add". Except for the ancestor/current/patched words, it is not specific to patch stacks, so the implementation should be in git and not in stg.

Quoted 6 lines

No it cannot, at least the '-r (ancestor|current|patched)' part for resetting file to given version, even if we change the wording to ancestor, ours and theirs. The git-add command is about adding contents, which updates index, which almost as a intended side-effect clears merge state, i.e. stages; and not about resetting to stage.

Quoted 6 lines
  git checkout-index --stage=1|2|3 <filename>

does what you want. But "git cat-file" knows this handy syntax for getting at particular index stages:

:stage:<filename>

I always forget which stage is which. It would be nice if git-checkout-index implemented human-friendly names, just like git-diff-files has --base, --ours, --theirs, i.e. if it would be possible to write

  git checkout-index --stage=base|ours|theirs <filename>

and perhaps even

:base|ours|theirs:<filename>.

(but there is a problem with files containing ':'...).

Quoted 6 lines

It would be very convenient to be able to do

git checkout :stage:<filename>

but it doesn't seem to work currently. Does anyone know the "best" way of manually checking out a particular index stage in git?

It's a pity it doesn't work. Or if not this, then perhaps

  git checkout --stage=ours -- <filename>
Quoted 12 lines
Quoted 3 lines

Besides with "stg resolved" you can update index _only_ for files which were in the conflict, also for -a/--all, and not all the files not only those which were in the conflict like "git add -u" does.

This sounds like a straightforward addition to "git add".

Quoted 3 lines

"stg resolved --check" could happily ignore things that only look like conflict markers, but must have been intended, because they are in files not in conflict.

git knows about conflicting files too.

Quoted 8 lines
Quoted 3 lines

Unless you are talking about adding "resolve"/"resolved" command to git-core, as a porcelain wrapper around git-update-index, like "git add"...

Yes, that's what I want. You and others like what "stg resolved" does, but I don't want it in StGit because it's a generic git enhancement that has nothing to with patch stacks. People who don't use StGit would presumably like it as well.

You mean adding another option to git-add, similar to '-u' option, but updating only the files which were (are) in merge conflict; '-c'/'-r'/'-s' perhaps? This would be replacement for
"stg resolved --all", wouldn't it (and with filename replacement for "stg resolved <filename>", of course)?

P.S. Sidenote: it would be nice if git-mergetool was updated to understand StGIT style interactive 2-way and 3-way merge configuration, and not offer only limited choice of pre-defined interactive merge tools (although pre-defined are nice, too).

Signature · 2 lines
Jakub Narebski
Poland
#33 lore raw

Re: kha/safe and kha/experimental updated

Quoted 14 lines · Jakub Narebski
Quoted 6 lines · Karl Hasselström
  git checkout-index --stage=1|2|3 <filename>

does what you want. But "git cat-file" knows this handy syntax for getting at particular index stages:

:stage:<filename>

I always forget which stage is which. It would be nice if git-checkout-index implemented human-friendly names, just like git-diff-files has --base, --ours, --theirs, i.e. if it would be possible to write

Quoted 7 lines
  git checkout-index --stage=base|ours|theirs <filename>

and perhaps even

:base|ours|theirs:<filename>.

(but there is a problem with files containing ':'...).

<ref>:<path> is already accepted, so I don't think this would be much worse.

And yes, I agree that the base/ours/theirs aliases are nice, and should be accepted by at least the porcelain commands.

Quoted 8 lines
Quoted 4 lines

Yes, that's what I want. You and others like what "stg resolved" does, but I don't want it in StGit because it's a generic git enhancement that has nothing to with patch stacks. People who don't use StGit would presumably like it as well.

You mean adding another option to git-add, similar to '-u' option, but updating only the files which were (are) in merge conflict; '-c'/'-r'/'-s' perhaps?

Yes. That _is_ the operation you want, isn't it?

Quoted 2 lines

This would be replacement for "stg resolved --all", wouldn't it (and with filename replacement for "stg resolved <filename>", of course)?

Yes. Though with a filename argument, you wouldn't need the new flag.

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#34 lore raw

Re: kha/safe and kha/experimental updated

In reply to Jakub Narebski
Quoted 29 lines · Jakub Narebski
Quoted 28 lines · Karl Hasselström
Quoted 15 lines · Jakub Narebski
Quoted 9 lines · Karl Hasselström
Quoted 6 lines · Jakub Narebski

I also would like to have this command kept (and shown in 'stg help'!). Contrary to 'git add' it can check and add to index / update index only for files with conflict; we have -r (ancestor|current|patched) to choose one side, and we could add --check to check if there are no conflict markers with files (useful with -a/--all).

Quoted 4 lines

This too sounds like stuff that could profitably be added to "git add". Except for the ancestor/current/patched words, it is not specific to patch stacks, so the implementation should be in git and not in stg.

Quoted 6 lines

No it cannot, at least the '-r (ancestor|current|patched)' part for resetting file to given version, even if we change the wording to ancestor, ours and theirs. The git-add command is about adding contents, which updates index, which almost as a intended side-effect clears merge state, i.e. stages; and not about resetting to stage.

  git checkout-index --stage=1|2|3 <filename>

does what you want. But "git cat-file" knows this handy syntax for getting at particular index stages:

Quoted 8 lines
Quoted 1 line

:stage:<filename>

I always forget which stage is which. It would be nice if git-checkout-index implemented human-friendly names, just like git-diff-files has --base, --ours, --theirs, i.e. if it would be possible to write

  git checkout-index --stage=base|ours|theirs <filename>

This gets even more confusing with StGIT. For plain git, after a git merge or pull conflict, 'theirs' is stage 3. With StGIT, we first advance the base of the stack and merge the patches onto it, in which case the 'patched' (which I would normally call 'ours' rather than 'theirs') is 3.

Signature · 1 line
Catalin
#35 lore raw

Re: kha/safe and kha/experimental updated

Quoted 5 lines · Catalin Marinas
Quoted 5 lines

I always forget which stage is which. It would be nice if git-checkout-index implemented human-friendly names, just like git-diff-files has --base, --ours, --theirs, i.e. if it would be possible to write

Quoted 7 lines
Quoted 1 line
  git checkout-index --stage=base|ours|theirs <filename>

This gets even more confusing with StGIT. For plain git, after a git merge or pull conflict, 'theirs' is stage 3. With StGIT, we first advance the base of the stack and merge the patches onto it, in which case the 'patched' (which I would normally call 'ours' rather than 'theirs') is 3.

True. And the same problem obviously exists for "git rebase".

Signature · 1 line
David Kågedal
#36 lore raw

Re: kha/safe and kha/experimental updated

In reply to Karl Hasselström
Quoted 4 lines · Karl Hasselström

You and others like what "stg resolved" does,
but I don't want it in StGit because it's a generic git enhancement that has nothing to with patch stacks. People who don't use StGit would presumably like it as well.

The --reset option would never be added to git, at least not with the same name for arguments since git doesn't manage patches. As I said, I would have to remember what stage my 'patched' file is in.

Signature · 1 line
Catalin
#37 lore raw

Re: kha/safe and kha/experimental updated

In reply to Jakub Narebski
Quoted 14 lines · Jakub Narebski
Quoted 11 lines · Catalin Marinas

Thanks again for maintaining these branches.

Quoted 3 lines · Karl Hasselström

git://repo.or.cz/stgit/kha.git safe

Remove "stg resolved"

I'd like to keep this command. git-mergetool doesn't support the tool I use (emacs + ediff and more stgit-specific file extensions like current, patch etc.). I also don't find 'git add' to be meaningful for marking a conflict as solved.

Quoted 5 lines

I also would like to have this command kept (and shown in 'stg help'!). Contrary to 'git add' it can check and add to index / update index only for files with conflict; we have -r (ancestor|current|patched) to choose one side, and we could add --check to check if there are no conflict markers with files (useful with -a/--all).

I'd also like to re-add the stgit.keeporig option and additional functionality so that the *.{ancestor,current,patched} can be left in the working tree. Some people might use them when manually fixing conflicts (I have a look at them from time to time when the emacs + ediff shows a hard to understand conflict).

Signature · 1 line
Catalin
#38 lore raw

Re: kha/safe and kha/experimental updated

Quoted 21 lines · Catalin Marinas
Quoted 14 lines · Jakub Narebski
Quoted 11 lines · Catalin Marinas

Thanks again for maintaining these branches.

Quoted 3 lines · Karl Hasselström

git://repo.or.cz/stgit/kha.git safe

Remove "stg resolved"

I'd like to keep this command. git-mergetool doesn't support the tool I use (emacs + ediff and more stgit-specific file extensions like current, patch etc.). I also don't find 'git add' to be meaningful for marking a conflict as solved.

Quoted 5 lines

I also would like to have this command kept (and shown in 'stg help'!). Contrary to 'git add' it can check and add to index / update index only for files with conflict; we have -r (ancestor|current|patched) to choose one side, and we could add --check to check if there are no conflict markers with files (useful with -a/--all).

Quoted 5 lines

I'd also like to re-add the stgit.keeporig option and additional functionality so that the *.{ancestor,current,patched} can be left in the working tree. Some people might use them when manually fixing conflicts (I have a look at them from time to time when the emacs + ediff shows a hard to understand conflict).

Since all the information is in git, it is of course easy to recreate it. But the important question to ask is: how do you use these extra files? git.el provides a way to diff against both parent versions, and maybe that is actually what you need.

I don't mind that you want these files, but they are mostly clutter to me.

Signature · 1 line
David Kågedal
#39 lore raw

Re: kha/safe and kha/experimental updated

Quoted 29 lines · David Kågedal
Quoted 21 lines · Catalin Marinas
Quoted 14 lines · Jakub Narebski
Quoted 11 lines · Catalin Marinas

Thanks again for maintaining these branches.

Quoted 3 lines · Karl Hasselström

git://repo.or.cz/stgit/kha.git safe

Remove "stg resolved"

I'd like to keep this command. git-mergetool doesn't support the tool I use (emacs + ediff and more stgit-specific file extensions like current, patch etc.). I also don't find 'git add' to be meaningful for marking a conflict as solved.

Quoted 5 lines

I also would like to have this command kept (and shown in 'stg help'!). Contrary to 'git add' it can check and add to index / update index only for files with conflict; we have -r (ancestor|current|patched) to choose one side, and we could add --check to check if there are no conflict markers with files (useful with -a/--all).

Quoted 5 lines

I'd also like to re-add the stgit.keeporig option and additional functionality so that the *.{ancestor,current,patched} can be left in the working tree. Some people might use them when manually fixing conflicts (I have a look at them from time to time when the emacs + ediff shows a hard to understand conflict).

Quoted 4 lines

Since all the information is in git, it is of course easy to recreate it. But the important question to ask is: how do you use these extra files? git.el provides a way to diff against both parent versions, and maybe that is actually what you need.

Note that I'm talking about the kha/experimental branch here. The point of my patches there are to make sure that the git index is left in the unmerged state so that normal git tools can be used. This means that git diff-files -2 and -3 does what you want.

Signature · 1 line
David Kågedal
#40 lore raw

Re: kha/safe and kha/experimental updated

In reply to David Kågedal
Quoted 7 lines · David Kågedal
Quoted 5 lines · Catalin Marinas

I'd also like to re-add the stgit.keeporig option and additional functionality so that the *.{ancestor,current,patched} can be left in the working tree. Some people might use them when manually fixing conflicts (I have a look at them from time to time when the emacs + ediff shows a hard to understand conflict).

Quoted 7 lines

Since all the information is in git, it is of course easy to recreate it. But the important question to ask is: how do you use these extra files? git.el provides a way to diff against both parent versions, and maybe that is actually what you need.

I don't mind that you want these files, but they are mostly clutter to me.

You can set stgit.keeporig to 'no' if you don't want these files.

For people not using emacs + git.el, the files might be useful. As you said, you could use 'git diff -2/-3' but, in various occasions I just wanted to copy a block of code from one of the checked-out stages. Without this feature, I would have to use plain git and remember what stage corresponds to my patch.

Note that there are other users (apart from me) that use StGIT almost exclusively. I really don't like forcing them to use more and more plain git commands (at some point, they might even discover 'git rebase -i' to be good enough and give up on StGIT :-)).

Signature · 1 line
Catalin
#41 lore raw

Re: kha/safe and kha/experimental updated

In reply to Karl Hasselström
Quoted 1 line · Karl Hasselström

git://repo.or.cz/stgit/kha.git safe

[...]

Quoted 1 line

Ask git about unmerged files

This patch wrongly assumes that there is a stage 2 entry in the index. Test t1202-push-undo.sh fails because a file is added, differently, in both master and patch but it doesn't exist in ancestor (no stage 2). Using stage 3 doesn't fix it either because a patch might remove a file.

I fixed it by using a set to get the unique names.

Signature · 1 line
Catalin
#42 lore raw

Re: kha/safe and kha/experimental updated

Quoted 5 lines · Catalin Marinas
Quoted 1 line · Karl Hasselström

git://repo.or.cz/stgit/kha.git safe

[...]

Quoted 1 line

Ask git about unmerged files

Quoted 7 lines

This patch wrongly assumes that there is a stage 2 entry in the index. Test t1202-push-undo.sh fails because a file is added, differently, in both master and patch but it doesn't exist in ancestor (no stage 2). Using stage 3 doesn't fix it either because a patch might remove a file.

I fixed it by using a set to get the unique names.

That sounds reasonable.

Signature · 1 line
David Kågedal
#43 lore raw
In reply to Karl Hasselström
Quoted 4 lines · Karl Hasselström
Quoted 2 lines · Catalin Marinas

On 14/12/2007, David Kågedal <[email protected]> wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

The following series an emacs interface to stgit patch stacks. It shows a buffer with the the output of "stg series" and allows you to do some common operations on it, such as push/pop, commit/uncommit, edit, rename, repair, and coalesce.

That's really cool stuff! Thanks.

Yes, incredibly useful.

Other useful commands would be support for 'patches' and a local diff/status (and maybe a menu).

Quoted 5 lines

Be careful about merging past the "goto" patch -- I'm pretty sure it breaks when called from a subdirectory, and I don't have time to fix that right now. (It should be a clean fix, though -- just adjust the cwd for precisely those git subprocesses that need it, which is very few. I think.)

Why not just change the cwd when the command starts and it should be safe for all the git subprocesses.

Quoted 2 lines

If you like, I can advance "safe" to include as many patches as I think you should merge right now.

OK, thanks.

Signature · 1 line
Catalin
#44 lore raw
Quoted 10 lines · Catalin Marinas
Quoted 5 lines · Karl Hasselström

Be careful about merging past the "goto" patch -- I'm pretty sure it breaks when called from a subdirectory, and I don't have time to fix that right now. (It should be a clean fix, though -- just adjust the cwd for precisely those git subprocesses that need it, which is very few. I think.)

Why not just change the cwd when the command starts and it should be safe for all the git subprocesses.

It doesn't feel very clean to require the caller of some unspecified subset of git calls to remember to set the correct piece of global state.

And the correct solution should really be very simple, since it's precisely the worktree operations (specifically, the subset thereof that have to operate on the whole tree) that require setting cwd. And those are very clearly separated out from the rest in the new infrastructure.

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#45 lore raw

cover Make new infrastructure subdirectory safe

---

Karl Hasselström (2):
Make "stg goto" subdirectory safe
Test that "stg goto" can be called from a subdirectory

 stgit/lib/git.py       |    5 ++--
 stgit/run.py           |    9 +++++--
 t/t2800-goto-subdir.sh |   59 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 68 insertions(+), 5 deletions(-)
 create mode 100755 t/t2800-goto-subdir.sh
Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#46 lore raw

PATCH 1/2 Test that "stg goto" can be called from a subdirectory

It currently can't; therefore, the tests are marked as known failures.

---

 t/t2800-goto-subdir.sh |   59 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 59 insertions(+), 0 deletions(-)
 create mode 100755 t/t2800-goto-subdir.sh
t/t2800-goto-subdir.sh new file +59 -0
new file mode 100755
index 0000000..9f3ab26
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+test_description='Run "stg goto" in a subdirectory'
+
+. ./test-lib.sh
+
+test_expect_success 'Initialize StGit stack' '
+    stg init &&
+    echo expected1.txt >> .git/info/exclude &&
+    echo expected2.txt >> .git/info/exclude &&
+    echo actual.txt >> .git/info/exclude &&
+    mkdir foo &&
+    for i in 1 2 3; do
+        echo foo$i >> foo/bar &&
+        stg new p$i -m p$i &&
+        git add foo/bar &&
+        stg refresh
+    done
+'
+
+cat > expected1.txt <<EOF
+foo1
+EOF
+cat > expected2.txt <<EOF
+bar
+EOF
+test_expect_failure 'Goto in subdirectory (just pop)' '
+    (cd foo && stg goto p1) &&
+    cat foo/bar > actual.txt &&
+    diff -u expected1.txt actual.txt &&
+    ls foo > actual.txt &&
+    diff -u expected2.txt actual.txt
+'
+
+test_expect_success 'Prepare conflicting goto' '
+    stg delete p2
+'
+
+cat > expected1.txt <<EOF
+foo1
+<<<<<<< current:foo/bar
+=======
+foo2
+foo3
+>>>>>>> patched:foo/bar
+EOF
+cat > expected2.txt <<EOF
+bar
+EOF
+test_expect_failure 'Goto in subdirectory (conflicting push)' '
+    (cd foo && stg goto p3) ;
+    [ $? -eq 3 ] &&
+    cat foo/bar > actual.txt &&
+    diff -u expected1.txt actual.txt &&
+    ls foo > actual.txt &&
+    diff -u expected2.txt actual.txt
+'
+
+test_done
#47 lore raw

PATCH 2/2 Make "stg goto" subdirectory safe

In reply to Karl Hasselström

This is not specific to "stg goto" -- it affects all commands that use the new infrastructure. (But of those, only goto and coalesce were subdirectory unsafe.)

---

Quoted 17 lines · Karl Hasselström
Quoted 10 lines · Catalin Marinas
Quoted 5 lines · Karl Hasselström

Be careful about merging past the "goto" patch -- I'm pretty sure it breaks when called from a subdirectory, and I don't have time to fix that right now. (It should be a clean fix, though -- just adjust the cwd for precisely those git subprocesses that need it, which is very few. I think.)

Why not just change the cwd when the command starts and it should be safe for all the git subprocesses.

It doesn't feel very clean to require the caller of some unspecified subset of git calls to remember to set the correct piece of global state.

Quoted 5 lines

And the correct solution should really be very simple, since it's precisely the worktree operations (specifically, the subset thereof that have to operate on the whole tree) that require setting cwd. And those are very clearly separated out from the rest in the new infrastructure.

And here it is! Note that not counting the cwd support in run.py and changing the test to expect success, I had to change just three lines to fix this problem for _all_ "new infrastructure" commands. And no unintended side effects, since the cwd is changed only where it's necessary.

 stgit/lib/git.py       |    5 +++--
 stgit/run.py           |    9 ++++++---
 t/t2800-goto-subdir.sh |    4 ++--
 3 files changed, 11 insertions(+), 7 deletions(-)
stgit/lib/git.py +3 -2
index 6aba966..118c9b2 100644
@@ -344,6 +344,7 @@ class Worktree(object):
     def __init__(self, directory):
         self.__directory = directory
     env = property(lambda self: { 'GIT_WORK_TREE': self.__directory })
+    directory = property(lambda self: self.__directory)
 
 class CheckoutException(exception.StgException):
     pass
@@ -364,7 +365,7 @@ class IndexAndWorktree(RunWithEnv):
             self.run(['git', 'read-tree', '-u', '-m',
                       '--exclude-per-directory=.gitignore',
                       old_tree.sha1, new_tree.sha1]
-                     ).discard_output()
+                     ).cwd(self.__worktree.directory).discard_output()
         except run.RunException:
             raise CheckoutException('Index/workdir dirty')
     def merge(self, base, ours, theirs):
@@ -377,7 +378,7 @@ class IndexAndWorktree(RunWithEnv):
                      env = { 'GITHEAD_%s' % base.sha1: 'ancestor',
                              'GITHEAD_%s' % ours.sha1: 'current',
                              'GITHEAD_%s' % theirs.sha1: 'patched'}
-                     ).discard_output()
+                     ).cwd(self.__worktree.directory).discard_output()
         except run.RunException, e:
             raise MergeException('Index/worktree dirty')
     def changed_files(self):
stgit/run.py +6 -3
index 78537db..77f2e65 100644
@@ -42,7 +42,7 @@ class Run:
             if type(c) != str:
                 raise Exception, 'Bad command: %r' % (cmd,)
         self.__good_retvals = [0]
-        self.__env = None
+        self.__env = self.__cwd = None
         self.__indata = None
         self.__discard_stderr = False
     def __log_start(self):
@@ -67,7 +67,7 @@ class Run:
         """Run with captured IO."""
         self.__log_start()
         try:
-            p = subprocess.Popen(self.__cmd, env = self.__env,
+            p = subprocess.Popen(self.__cmd, env = self.__env, cwd = self.__cwd,
                                  stdin = subprocess.PIPE,
                                  stdout = subprocess.PIPE,
                                  stderr = subprocess.PIPE)
@@ -85,7 +85,7 @@ class Run:
         assert self.__indata == None
         self.__log_start()
         try:
-            p = subprocess.Popen(self.__cmd, env = self.__env)
+            p = subprocess.Popen(self.__cmd, env = self.__env, cwd = self.__cwd)
             self.exitcode = p.wait()
         except OSError, e:
             raise self.exc('%s failed: %s' % (self.__cmd[0], e))
@@ -104,6 +104,9 @@ class Run:
         self.__env = dict(os.environ)
         self.__env.update(env)
         return self
+    def cwd(self, cwd):
+        self.__cwd = cwd
+        return self
     def raw_input(self, indata):
         self.__indata = indata
         return self
t/t2800-goto-subdir.sh +2 -2
index 9f3ab26..fcad7da 100755
@@ -24,7 +24,7 @@ EOF
 cat > expected2.txt <<EOF
 bar
 EOF
-test_expect_failure 'Goto in subdirectory (just pop)' '
+test_expect_success 'Goto in subdirectory (just pop)' '
     (cd foo && stg goto p1) &&
     cat foo/bar > actual.txt &&
     diff -u expected1.txt actual.txt &&
@@ -47,7 +47,7 @@ EOF
 cat > expected2.txt <<EOF
 bar
 EOF
-test_expect_failure 'Goto in subdirectory (conflicting push)' '
+test_expect_success 'Goto in subdirectory (conflicting push)' '
     (cd foo && stg goto p3) ;
     [ $? -eq 3 ] &&
     cat foo/bar > actual.txt &&
#48 lore raw

kha/safe updated

Quoted 1 line · Karl Hasselström

And here it is!

And with that, I don't see any reason to not recommend that you pull every patch I have. Which is:

The following changes since commit 5be69cd8d89bd89be31364e9c0fd9e947b6ef644:
Karl Hasselström (1):
Name the exit codes to improve legibility

are available in the git repository at:

git://repo.or.cz/stgit/kha.git safe

David Kågedal (19):
Add an StGit mode for emacs
Emacs mode: Improve the output buffer state
Emacs mode: Bind n and p
Emacs mode: add stgit-repair
Emacs mode: added stgit-commit and stgit-uncommit Emacs mode: Add stgit-edit command
Emacs mode: added fontification
Emacs mode: Added stgit-new
Check bottom and invariants
Remove the 'bottom' field
Remove the 'top' field
Split git.merge into two functions
Leave working dir and index alone after failed (conflicting) push Added a test case to check what happens when push finds a conflict Simplify merge_recursive
Use the output from merge-recursive to list conflicts Ask git about unmerged files
Emacs mode: Add mark command
Emacs mode: coalesce command

Karl Hasselström (36):
Emacs mode: Show keybindings when user presses "h" or "?" Emacs mode: Add an explanatory header
Emacs mode: Makefile for building stgit.el
Emacs mode: push/pop next patch, not patch at point Emacs mode: Let "P" push or pop patch at point
Emacs mode: Bind "G" to "stg goto"
Emacs mode: show patches' short description
Write removed fields for backwards compatibility Nicer conflict markers
Better error message if merge fails
Fix "stg resolved" to work with new conflict representation
Refactoring: pass more than one file to resolved()
We keep the different stages of a conflict in the index now "stg status --reset" is not needed anymore
Remove "stg add"
Remove "stg rm"
Remove "stg cp"
Remove "stg resolved"
New StGit core infrastructure: repository operations Write metadata files used by the old infrastructure Upgrade older stacks to newest version
Let "stg clean" use the new infrastructure
Add "stg coalesce"
Let "stg applied" and "stg unapplied" use the new infrastructure Teach the new infrastructure about the index and worktree Let "stg clean" use the new transaction primitives Let "stg goto" use the new infrastructure
Convert "stg uncommit" to the new infrastructure
New infrastructure: Make sure that the branch is initialized Expose transaction abort function
stg coalesce: Support --file and --save-template
Set exit code to 3 on merge conflict
Convert "stg commit" to new infrastructure
Make "stg commit" fancier
Test that "stg goto" can be called from a subdirectory Make "stg goto" subdirectory safe

 Documentation/stg-cp.txt      |   63 -------
 Documentation/stg.txt         |    2 -
 Documentation/tutorial.txt    |   31 ++--
 contrib/Makefile              |   19 ++
 contrib/stgit-completion.bash |    4 +-
 contrib/stgit.el              |  377 +++++++++++++++++++++++++++++++++++++++
 examples/gitconfig            |   19 +--
 setup.py                      |    2 +-
 stgit/commands/add.py         |   44 -----
 stgit/commands/applied.py     |   27 ++--
 stgit/commands/clean.py       |   49 ++----
 stgit/commands/coalesce.py    |  122 +++++++++++++
 stgit/commands/commit.py      |  111 ++++++++-----
 stgit/commands/common.py      |   39 ++---
 stgit/commands/copy.py        |   45 -----
 stgit/commands/goto.py        |   52 ++----
 stgit/commands/pick.py        |    2 +-
 stgit/commands/resolved.py    |   94 ----------
 stgit/commands/rm.py          |   48 -----
 stgit/commands/status.py      |   31 ++--
 stgit/commands/sync.py        |    1 -
 stgit/commands/unapplied.py   |   23 ++--
 stgit/commands/uncommit.py    |   81 ++++-----
 stgit/config.py               |    1 -
 stgit/git.py                  |   75 +++++---
 stgit/gitmergeonefile.py      |   97 +----------
 stgit/lib/__init__.py         |   18 ++
 stgit/lib/git.py              |  388 +++++++++++++++++++++++++++++++++++++++++
 stgit/lib/stack.py            |  176 +++++++++++++++++++
 stgit/lib/stackupgrade.py     |   98 +++++++++++
 stgit/lib/transaction.py      |  209 ++++++++++++++++++++++
 stgit/main.py                 |   14 +-
 stgit/run.py                  |   12 +-
 stgit/stack.py                |  156 ++++-------------
 stgit/utils.py                |   25 +++
 t/t0002-status.sh             |   15 +-
 t/t1200-push-modified.sh      |    2 +-
 t/t1202-push-undo.sh          |    6 +-
 t/t1203-push-conflict.sh      |   70 ++++++++
 t/t1204-pop-keep.sh           |    2 +-
 t/t1205-push-subdir.sh        |    8 +-
 t/t1300-uncommit.sh           |   16 +-
 t/t1301-repair.sh             |    2 +-
 t/t1400-patch-history.sh      |    4 +-
 t/t1500-float.sh              |   14 +-
 t/t1600-delete-one.sh         |   12 +-
 t/t1601-delete-many.sh        |    2 +-
 t/t1700-goto-top.sh           |    2 +-
 t/t2000-sync.sh               |   12 +-
 t/t2100-pull-policy-fetch.sh  |    4 +-
 t/t2101-pull-policy-pull.sh   |    4 +-
 t/t2102-pull-policy-rebase.sh |    4 +-
 t/t2300-refresh-subdir.sh     |    2 +-
 t/t2600-coalesce.sh           |   31 ++++
 t/t2800-goto-subdir.sh        |   59 ++++++
 55 files changed, 1959 insertions(+), 867 deletions(-)
 delete mode 100644 Documentation/stg-cp.txt
 create mode 100644 contrib/Makefile
 create mode 100644 contrib/stgit.el
 delete mode 100644 stgit/commands/add.py
 create mode 100644 stgit/commands/coalesce.py
 delete mode 100644 stgit/commands/copy.py
 delete mode 100644 stgit/commands/resolved.py
 delete mode 100644 stgit/commands/rm.py
 create mode 100644 stgit/lib/__init__.py
 create mode 100644 stgit/lib/git.py
 create mode 100644 stgit/lib/stack.py
 create mode 100644 stgit/lib/stackupgrade.py
 create mode 100644 stgit/lib/transaction.py
 create mode 100755 t/t1203-push-conflict.sh
 create mode 100755 t/t2600-coalesce.sh
 create mode 100755 t/t2800-goto-subdir.sh

kha/experimental points to the same commit as kha/safe, for now.

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#49 lore raw

Re: kha/safe updated

Quoted 6 lines · Karl Hasselström
Quoted 1 line · Karl Hasselström

And here it is!

And with that, I don't see any reason to not recommend that you pull every patch I have. Which is:

The conflict series of patches from me works for me, but I know that I don't use all the merging features that other users use, so I can't guarantee that everything works. But it seems that Catalin has been looking over it, so I guess it's ok.

Signature · 1 line
David Kågedal
#50 lore raw

Re: kha/safe updated

Quoted 9 lines · David Kågedal
Quoted 2 lines · Karl Hasselström

And with that, I don't see any reason to not recommend that you pull every patch I have. Which is:

The conflict series of patches from me works for me, but I know that I don't use all the merging features that other users use, so I can't guarantee that everything works. But it seems that Catalin has been looking over it, so I guess it's ok.

I've been running it for quite some time too. And the criteria for getting into kha/stable aren't _that_ onerous: I don't guarantee that there are no bugs, just that the patches seem to be ready for widespread testing.

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#51 lore raw

Re: kha/safe updated

In reply to Karl Hasselström
Quoted 6 lines · Karl Hasselström
Quoted 1 line · Karl Hasselström

And here it is!

And with that, I don't see any reason to not recommend that you pull every patch I have. Which is:

Please rebase again when you have time since I already merged most of this branch and added some patches that might conflict with yours.

Signature · 1 line
Catalin
#52 lore raw

Re: kha/safe updated

Quoted 8 lines · Catalin Marinas
Quoted 2 lines · Karl Hasselström

And with that, I don't see any reason to not recommend that you pull every patch I have. Which is:

Please rebase again when you have time since I already merged most of this branch and added some patches that might conflict with yours.

You hadn't pushed any of it out when I last checked about two hours ago ...

Will do, but not tonight. In fact, it may be a few days, I'm afraid.

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#53 lore raw

Re: kha/safe updated

Quoted 7 lines · Karl Hasselström
Quoted 5 lines · Catalin Marinas
Quoted 2 lines · Karl Hasselström

And with that, I don't see any reason to not recommend that you pull every patch I have. Which is:

Quoted 6 lines
Quoted 3 lines

Please rebase again when you have time since I already merged most of this branch and added some patches that might conflict with yours.

You hadn't pushed any of it out when I last checked about two hours ago ...

I just pushed the changes a few minutes ago.

Quoted 1 line

Will do, but not tonight. In fact, it may be a few days, I'm afraid.

No problem. Anyway, if I don't here from you in the meantime, have a good Christmas :-).

Signature · 1 line
Catalin
#54 lore raw

Re: kha/safe updated

Quoted 6 lines · Catalin Marinas
Quoted 2 lines · Karl Hasselström

You hadn't pushed any of it out when I last checked about two hours ago ...

I just pushed the changes a few minutes ago.

So I guessed. :-)

Quoted 5 lines
Quoted 2 lines

Will do, but not tonight. In fact, it may be a few days, I'm afraid.

No problem. Anyway, if I don't here from you in the meantime, have a good Christmas :-).

You too! (Or anything else you may prefer to celebrate this time of year.)

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#55 lore raw

Re: [StGit PATCH 0/2] Make new infrastructure subdirectory safe

In reply to Karl Hasselström
Quoted 3 lines · Karl Hasselström

Karl Hasselström (2):
Make "stg goto" subdirectory safe
Test that "stg goto" can be called from a subdirectory

I forgot to say, but this goes on top of kha/experimental. The test makes use of the "return exit code 3 when there was conflicts" patch to make sure that there was a conflict and not another error.

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
#56 lore raw
In reply to Catalin Marinas
Quoted 10 lines · Catalin Marinas
Quoted 9 lines · Karl Hasselström
Quoted 7 lines · Catalin Marinas
Quoted 4 lines · David Kågedal

The following series an emacs interface to stgit patch stacks. It shows a buffer with the the output of "stg series" and allows you to do some common operations on it, such as push/pop, commit/uncommit, edit, rename, repair, and coalesce.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

That's really cool stuff! Thanks.

Yes, incredibly useful.

Other useful commands would be support for 'patches' and a local diff/status (and maybe a menu).

I have some ideas for some way of showing the current status, but nothing is implemented yet. For some of the more complex cases, I'd like to refer to git.el, although I think that needs some improvements.

I don't think I ever used the 'patches' command, so I'm not sure what the best way to implement it would be.

And my emacs has no menu, so I'm probably not the best person to adda menu, either :-)

Signature · 1 line
David Kågedal