{"thread":{"id":"11288","subject":"[StGit PATCH 00/17] Series short description","startedAt":"2007-12-14T10:55:25Z","lastAt":"2007-12-20T06:39:55Z","messageCount":57,"participants":["David Kågedal","Catalin Marinas","Karl Hasselström","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":17},"messages":[{"id":"63137","messageId":"20071214105238.18066.23281.stgit@krank","threadId":"11288","inReplyTo":null,"subject":"[StGit PATCH 00/17] Series short description","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:55:25Z","receivedAt":"2007-12-14T10:55:25Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"The following series an emacs interface to stgit patch stacks. It\nshows a buffer with the the output of \"stg series\" and allows you to\ndo some common operations on it, such as push/pop, commit/uncommit,\nedit, rename, repair, and coalesce.\n\nThe coalesce command obviosly requires the kha/experimental branch.\nThe edit command requires the edit fixes in kha/safe.\n\n---\n\nDavid Kågedal (10):\n      Emacs mode: coalesce command\n      Emacs mode: Add mark command\n      Emacs mode: Added stgit-new\n      Emacs mode: added fontification\n      Emacs mode: Add stgit-edit command\n      Emacs mode: added stgit-commit and stgit-uncommit\n      Emacs mode: add stgit-repair\n      Emacs mode: Bind n and p\n      Emacs mode: Improve the output buffer state\n      Add an StGit mode for emacs\n\nKarl Hasselström (7):\n      Emacs mode: show patches' short description\n      Emacs mode: Bind \"G\" to \"stg goto\"\n      Emacs mode: Let \"P\" push or pop patch at point\n      Emacs mode: push/pop next patch, not patch at point\n      Emacs mode: Makefile for building stgit.el\n      Emacs mode: Add an explanatory header\n      Emacs mode: Show keybindings when user presses \"h\" or \"?\"\n\n\n contrib/Makefile |   19 +++\n contrib/stgit.el |  377 ++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 396 insertions(+), 0 deletions(-)\n create mode 100644 contrib/Makefile\n create mode 100644 contrib/stgit.el\n\n-- \nSignature\n"},{"id":"63138","messageId":"20071214105530.18066.14326.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 01/17] Add an StGit mode for emacs","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:55:42Z","receivedAt":"2007-12-14T10:55:42Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Signed-off-by: David Kågedal <davidk@lysator.liu.se>\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n---\n\n contrib/stgit.el |  141 ++++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 141 insertions(+), 0 deletions(-)\n create mode 100644 contrib/stgit.el\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nnew file mode 100644\nindex 0000000..1bdc0a5\n--- /dev/null\n+++ b/contrib/stgit.el\n@@ -0,0 +1,141 @@\n+(defun stgit (dir)\n+  \"Manage stgit patches\"\n+  (interactive \"DDirectory: \\n\")\n+  (switch-to-stgit-buffer dir)\n+  (stgit-refresh))\n+\n+(defun switch-to-stgit-buffer (dir)\n+  \"Switch to a (possibly new) buffer displaying StGit patches for DIR\"\n+  (setq dir (file-name-as-directory dir))\n+  (let ((buffers (buffer-list)))\n+    (while (and buffers\n+                (not (with-current-buffer (car buffers)\n+                       (and (eq major-mode 'stgit-mode)\n+                            (string= default-directory dir)))))\n+      (setq buffers (cdr buffers)))\n+    (switch-to-buffer (if buffers\n+                          (car buffers)\n+                        (create-stgit-buffer dir)))))\n+\n+(defun create-stgit-buffer (dir)\n+  \"Create a buffer for showing StGit patches.\n+Argument DIR is the repository path.\"\n+  (let ((buf (create-file-buffer (concat dir \"*stgit*\")))\n+        (inhibit-read-only t))\n+    (with-current-buffer buf\n+      (setq default-directory dir)\n+      (stgit-mode)\n+      (setq buffer-read-only t))\n+    buf))\n+\n+(defmacro stgit-capture-output (name &rest body)\n+  \"Capture StGit output and show it in a window at the end\"\n+  `(let ((output-buf (get-buffer-create ,(or name \"*StGit output*\"))))\n+     (with-current-buffer output-buf\n+       (erase-buffer))\n+     (let ((standard-output output-buf))\n+       ,@body)\n+     (if (with-current-buffer output-buf (< (point-min) (point-max)))\n+         (display-buffer output-buf t))))\n+(put 'stgit-capture-output 'lisp-indent-function 1)\n+\n+(defun stgit-run (&rest args)\n+  (apply 'call-process \"stg\" nil standard-output nil args))\n+\n+(defun stgit-refresh ()\n+  \"Update the contents of the stgit buffer\"\n+  (interactive)\n+  (let ((inhibit-read-only t)\n+        (curline (line-number-at-pos))\n+        (curpatch (stgit-patch-at-point)))\n+    (erase-buffer)\n+    (insert \"Branch: \")\n+    (stgit-run \"branch\")\n+    (stgit-run \"series\")\n+    (if curpatch\n+        (stgit-goto-patch curpatch)\n+      (goto-line curline))))\n+\n+(defvar stgit-mode-hook nil\n+  \"Run after `stgit-mode' is setup.\")\n+\n+(defvar stgit-mode-map nil\n+  \"Keymap for StGit major mode.\")\n+\n+(unless stgit-mode-map\n+  (setq stgit-mode-map (make-keymap))\n+  (suppress-keymap stgit-mode-map)\n+  (define-key stgit-mode-map \"g\"   'stgit-refresh)\n+  (define-key stgit-mode-map \"r\"   'stgit-rename)\n+  (define-key stgit-mode-map \">\"   'stgit-push-next)\n+  (define-key stgit-mode-map \"<\"   'stgit-pop)\n+  (define-key stgit-mode-map \"=\"   'stgit-show))\n+\n+(defun stgit-mode ()\n+  \"Major mode for interacting with StGit.\n+Commands:\n+\\\\{stgit-mode-map}\"\n+  (kill-all-local-variables)\n+  (buffer-disable-undo)\n+  (setq mode-name \"StGit\"\n+        major-mode 'stgit-mode\n+        goal-column 2)\n+  (use-local-map stgit-mode-map)\n+  (set (make-local-variable 'list-buffers-directory) default-directory)\n+  (run-hooks 'stgit-mode-hook))\n+\n+(defun stgit-patch-at-point ()\n+  \"Return the patch name on the current line\"\n+  (save-excursion\n+    (beginning-of-line)\n+    (if (looking-at \"[>+-] \\\\(.*\\\\)\")\n+        (match-string 1)\n+      nil)))\n+\n+(defun stgit-goto-patch (patch)\n+  \"Move point to the line containing PATCH\"\n+  (let ((p (point)))\n+    (goto-char (point-min))\n+    (if (re-search-forward (concat \"[>+-] \" (regexp-quote patch) \"$\") nil t)\n+        (progn (move-to-column goal-column)\n+               t)\n+      (goto-char p)\n+      nil)))\n+\n+(defun stgit-rename (name)\n+  \"Rename the patch under point\"\n+  (interactive (list (read-string \"Patch name: \" (stgit-patch-at-point))))\n+  (let ((old-name (stgit-patch-at-point)))\n+    (unless old-name\n+      (error \"No patch on this line\"))\n+    (stgit-capture-output nil\n+      (stgit-run \"rename\" old-name name))\n+    (stgit-refresh)\n+    (stgit-goto-patch name)))\n+\n+(defun stgit-push-next ()\n+  \"Push the patch on the line after pos\"\n+  (interactive)\n+  (forward-line 1)\n+  (let ((patch (stgit-patch-at-point)))\n+    (stgit-capture-output nil\n+      (stgit-run \"push\" patch))\n+    (stgit-refresh)))\n+\n+(defun stgit-pop ()\n+  \"Pop the patch on the current line\"\n+  (interactive)\n+  (let ((patch (stgit-patch-at-point)))\n+    (stgit-capture-output nil\n+      (stgit-run \"pop\" patch))\n+    (stgit-refresh)\n+    (previous-line)))\n+\n+(defun stgit-show ()\n+  \"Show the patch on the current line\"\n+  (interactive)\n+  (stgit-capture-output \"*StGit patch*\"\n+    (stgit-run \"show\" (stgit-patch-at-point))\n+    (with-current-buffer standard-output\n+      (goto-char (point-min))\n+      (diff-mode))))\n"},{"id":"63139","messageId":"20071214105548.18066.10999.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 02/17] Emacs mode: Show keybindings when user presses \"h\" or \"?\"","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:56:28Z","receivedAt":"2007-12-14T10:56:28Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"From: Karl Hasselström <kha@treskal.com>\n\nThese are the same keys the git emacs mode uses.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex 1bdc0a5..09dec8b 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -65,6 +65,8 @@ Argument DIR is the repository path.\"\n (unless stgit-mode-map\n   (setq stgit-mode-map (make-keymap))\n   (suppress-keymap stgit-mode-map)\n+  (define-key stgit-mode-map \"?\"   'stgit-help)\n+  (define-key stgit-mode-map \"h\"   'stgit-help)\n   (define-key stgit-mode-map \"g\"   'stgit-refresh)\n   (define-key stgit-mode-map \"r\"   'stgit-rename)\n   (define-key stgit-mode-map \">\"   'stgit-push-next)\n@@ -139,3 +141,8 @@ Commands:\n     (with-current-buffer standard-output\n       (goto-char (point-min))\n       (diff-mode))))\n+\n+(defun stgit-help ()\n+  \"Display help for the StGit mode.\"\n+  (interactive)\n+  (describe-function 'stgit-mode))\n"},{"id":"63140","messageId":"20071214105633.18066.49991.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 03/17] Emacs mode: Add an explanatory header","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:56:49Z","receivedAt":"2007-12-14T10:56:49Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"From: Karl Hasselström <kha@treskal.com>\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |   13 +++++++++++++\n 1 files changed, 13 insertions(+), 0 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex 09dec8b..cce0c0e 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -1,3 +1,14 @@\n+;; stgit.el: An emacs mode for StGit\n+;;\n+;; Copyright (C) 2007 David Kågedal <davidk@lysator.liu.se>\n+;;\n+;; To install: put this file on the load-path and place the following\n+;; in your .emacs file:\n+;;\n+;;    (require 'stgit)\n+;;\n+;; To start: `M-x stgit'\n+\n (defun stgit (dir)\n   \"Manage stgit patches\"\n   (interactive \"DDirectory: \\n\")\n@@ -146,3 +157,5 @@ Commands:\n   \"Display help for the StGit mode.\"\n   (interactive)\n   (describe-function 'stgit-mode))\n+\n+(provide 'stgit)\n"},{"id":"63141","messageId":"20071214105655.18066.47733.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 04/17] Emacs mode: Makefile for building stgit.el","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:57:00Z","receivedAt":"2007-12-14T10:57:00Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"From: Karl Hasselström <kha@treskal.com>\n\nShamelessly stolen from git's contrib/emacs/Makefile.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/Makefile |   19 +++++++++++++++++++\n 1 files changed, 19 insertions(+), 0 deletions(-)\n create mode 100644 contrib/Makefile\n\n\ndiff --git a/contrib/Makefile b/contrib/Makefile\nnew file mode 100644\nindex 0000000..8556910\n--- /dev/null\n+++ b/contrib/Makefile\n@@ -0,0 +1,19 @@\n+EMACS = emacs\n+\n+ELC = stgit.elc\n+INSTALL ?= install\n+INSTALL_ELC = $(INSTALL) -m 644\n+prefix ?= $(HOME)\n+emacsdir = $(prefix)/share/emacs/site-lisp\n+RM ?= rm -f\n+\n+all: $(ELC)\n+\n+install: all\n+\t$(INSTALL) -d $(DESTDIR)$(emacsdir)\n+\t$(INSTALL_ELC) $(ELC:.elc=.el) $(ELC) $(DESTDIR)$(emacsdir)\n+\n+%.elc: %.el\n+\t$(EMACS) -batch -f batch-byte-compile $<\n+\n+clean:; $(RM) $(ELC)\n"},{"id":"63142","messageId":"20071214105705.18066.30571.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 05/17] Emacs mode: push/pop next patch, not patch at point","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:57:19Z","receivedAt":"2007-12-14T10:57:19Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"From: Karl Hasselström <kha@treskal.com>\n\nThe three operations we should have are:\n\n  * Pop the topmost applied patch, no matter where point is.\n\n  * Push the first unapplied patch, no matter where point is.\n\n  * Push/pop the patch at point, depending on whether it's currently\n    applied.\n\nThis patch makes \"<\" and \">\" do the first two operations. The third is\ncoming in a later patch.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |   22 ++++++++--------------\n 1 files changed, 8 insertions(+), 14 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex cce0c0e..17b5d6b 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -81,7 +81,7 @@ Argument DIR is the repository path.\"\n   (define-key stgit-mode-map \"g\"   'stgit-refresh)\n   (define-key stgit-mode-map \"r\"   'stgit-rename)\n   (define-key stgit-mode-map \">\"   'stgit-push-next)\n-  (define-key stgit-mode-map \"<\"   'stgit-pop)\n+  (define-key stgit-mode-map \"<\"   'stgit-pop-next)\n   (define-key stgit-mode-map \"=\"   'stgit-show))\n \n (defun stgit-mode ()\n@@ -127,22 +127,16 @@ Commands:\n     (stgit-goto-patch name)))\n \n (defun stgit-push-next ()\n-  \"Push the patch on the line after pos\"\n+  \"Push the first unapplied patch\"\n   (interactive)\n-  (forward-line 1)\n-  (let ((patch (stgit-patch-at-point)))\n-    (stgit-capture-output nil\n-      (stgit-run \"push\" patch))\n-    (stgit-refresh)))\n+  (stgit-capture-output nil (stgit-run \"push\"))\n+  (stgit-refresh))\n \n-(defun stgit-pop ()\n-  \"Pop the patch on the current line\"\n+(defun stgit-pop-next ()\n+  \"Pop the topmost applied patch\"\n   (interactive)\n-  (let ((patch (stgit-patch-at-point)))\n-    (stgit-capture-output nil\n-      (stgit-run \"pop\" patch))\n-    (stgit-refresh)\n-    (previous-line)))\n+  (stgit-capture-output nil (stgit-run \"pop\"))\n+  (stgit-refresh))\n \n (defun stgit-show ()\n   \"Show the patch on the current line\"\n"},{"id":"63143","messageId":"20071214105724.18066.2112.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 06/17] Emacs mode: Let \"P\" push or pop patch at point","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:57:31Z","receivedAt":"2007-12-14T10:57:31Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"From: Karl Hasselström <kha@treskal.com>\n\nWhen the user presses \"P\", push or pop the patch at point depending on\nwhether it's applied or unapplied.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |   16 ++++++++++++++++\n 1 files changed, 16 insertions(+), 0 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex 17b5d6b..d371e71 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -82,6 +82,7 @@ Argument DIR is the repository path.\"\n   (define-key stgit-mode-map \"r\"   'stgit-rename)\n   (define-key stgit-mode-map \">\"   'stgit-push-next)\n   (define-key stgit-mode-map \"<\"   'stgit-pop-next)\n+  (define-key stgit-mode-map \"P\"   'stgit-push-or-pop)\n   (define-key stgit-mode-map \"=\"   'stgit-show))\n \n (defun stgit-mode ()\n@@ -138,6 +139,21 @@ Commands:\n   (stgit-capture-output nil (stgit-run \"pop\"))\n   (stgit-refresh))\n \n+(defun stgit-applied-at-point ()\n+  \"Is the patch on the current line applied?\"\n+  (save-excursion\n+    (beginning-of-line)\n+    (looking-at \"[>+]\")))\n+\n+(defun stgit-push-or-pop ()\n+  \"Push or pop the patch on the current line\"\n+  (interactive)\n+  (let ((patch (stgit-patch-at-point))\n+        (applied (stgit-applied-at-point)))\n+    (stgit-capture-output nil\n+       (stgit-run (if applied \"pop\" \"push\") patch))\n+    (stgit-refresh)))\n+\n (defun stgit-show ()\n   \"Show the patch on the current line\"\n   (interactive)\n"},{"id":"63144","messageId":"20071214105736.18066.55979.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 07/17] Emacs mode: Bind \"G\" to \"stg goto\"","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:57:44Z","receivedAt":"2007-12-14T10:57:44Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"From: Karl Hasselström <kha@treskal.com>\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |    9 +++++++++\n 1 files changed, 9 insertions(+), 0 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex d371e71..78e9520 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -83,6 +83,7 @@ Argument DIR is the repository path.\"\n   (define-key stgit-mode-map \">\"   'stgit-push-next)\n   (define-key stgit-mode-map \"<\"   'stgit-pop-next)\n   (define-key stgit-mode-map \"P\"   'stgit-push-or-pop)\n+  (define-key stgit-mode-map \"G\"   'stgit-goto)\n   (define-key stgit-mode-map \"=\"   'stgit-show))\n \n (defun stgit-mode ()\n@@ -154,6 +155,14 @@ Commands:\n        (stgit-run (if applied \"pop\" \"push\") patch))\n     (stgit-refresh)))\n \n+(defun stgit-goto ()\n+  \"Go to the patch on the current line\"\n+  (interactive)\n+  (let ((patch (stgit-patch-at-point)))\n+    (stgit-capture-output nil\n+       (stgit-run \"goto\" patch))\n+    (stgit-refresh)))\n+\n (defun stgit-show ()\n   \"Show the patch on the current line\"\n   (interactive)\n"},{"id":"63146","messageId":"20071214105749.18066.43175.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 08/17] Emacs mode: show patches' short description","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:57:55Z","receivedAt":"2007-12-14T10:57:55Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"From: Karl Hasselström <kha@treskal.com>\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |    7 ++++---\n 1 files changed, 4 insertions(+), 3 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex 78e9520..ed2fc37 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -62,7 +62,7 @@ Argument DIR is the repository path.\"\n     (erase-buffer)\n     (insert \"Branch: \")\n     (stgit-run \"branch\")\n-    (stgit-run \"series\")\n+    (stgit-run \"series\" \"--description\")\n     (if curpatch\n         (stgit-goto-patch curpatch)\n       (goto-line curline))))\n@@ -97,13 +97,14 @@ Commands:\n         goal-column 2)\n   (use-local-map stgit-mode-map)\n   (set (make-local-variable 'list-buffers-directory) default-directory)\n+  (set-variable 'truncate-lines 't)\n   (run-hooks 'stgit-mode-hook))\n \n (defun stgit-patch-at-point ()\n   \"Return the patch name on the current line\"\n   (save-excursion\n     (beginning-of-line)\n-    (if (looking-at \"[>+-] \\\\(.*\\\\)\")\n+    (if (looking-at \"[>+-] \\\\([^ ]*\\\\)\")\n         (match-string 1)\n       nil)))\n \n@@ -111,7 +112,7 @@ Commands:\n   \"Move point to the line containing PATCH\"\n   (let ((p (point)))\n     (goto-char (point-min))\n-    (if (re-search-forward (concat \"[>+-] \" (regexp-quote patch) \"$\") nil t)\n+    (if (re-search-forward (concat \"[>+-] \" (regexp-quote patch) \" \") nil t)\n         (progn (move-to-column goal-column)\n                t)\n       (goto-char p)\n"},{"id":"63148","messageId":"20071214105800.18066.28256.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 09/17] Emacs mode: Improve the output buffer state","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:58:12Z","receivedAt":"2007-12-14T10:58:12Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Make the output buffer have the correct default-directory, and make it\nread-only and unmodified.\n\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |   15 +++++++++++----\n 1 files changed, 11 insertions(+), 4 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex ed2fc37..82f0d38 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -41,13 +41,20 @@ Argument DIR is the repository path.\"\n \n (defmacro stgit-capture-output (name &rest body)\n   \"Capture StGit output and show it in a window at the end\"\n-  `(let ((output-buf (get-buffer-create ,(or name \"*StGit output*\"))))\n+  `(let ((output-buf (get-buffer-create ,(or name \"*StGit output*\")))\n+         (stgit-dir default-directory)\n+         (inhibit-read-only t))\n      (with-current-buffer output-buf\n-       (erase-buffer))\n+       (erase-buffer)\n+       (setq default-directory stgit-dir)\n+       (setq buffer-read-only t))\n      (let ((standard-output output-buf))\n        ,@body)\n-     (if (with-current-buffer output-buf (< (point-min) (point-max)))\n-         (display-buffer output-buf t))))\n+     (with-current-buffer output-buf\n+       (set-buffer-modified-p nil)\n+       (setq buffer-read-only t)\n+       (if (< (point-min) (point-max))\n+           (display-buffer output-buf t)))))\n (put 'stgit-capture-output 'lisp-indent-function 1)\n \n (defun stgit-run (&rest args)\n"},{"id":"63147","messageId":"20071214105817.18066.55619.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 10/17] Emacs mode: Bind n and p","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:58:28Z","receivedAt":"2007-12-14T10:58:28Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex 82f0d38..2d18061 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -85,6 +85,8 @@ Argument DIR is the repository path.\"\n   (suppress-keymap stgit-mode-map)\n   (define-key stgit-mode-map \"?\"   'stgit-help)\n   (define-key stgit-mode-map \"h\"   'stgit-help)\n+  (define-key stgit-mode-map \"p\"   'previous-line)\n+  (define-key stgit-mode-map \"n\"   'next-line)\n   (define-key stgit-mode-map \"g\"   'stgit-refresh)\n   (define-key stgit-mode-map \"r\"   'stgit-rename)\n   (define-key stgit-mode-map \">\"   'stgit-push-next)\n"},{"id":"63145","messageId":"20071214105833.18066.46153.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 11/17] Emacs mode: add stgit-repair","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:58:39Z","receivedAt":"2007-12-14T10:58:39Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |    8 ++++++++\n 1 files changed, 8 insertions(+), 0 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex 2d18061..20cb08f 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -89,6 +89,7 @@ Argument DIR is the repository path.\"\n   (define-key stgit-mode-map \"n\"   'next-line)\n   (define-key stgit-mode-map \"g\"   'stgit-refresh)\n   (define-key stgit-mode-map \"r\"   'stgit-rename)\n+  (define-key stgit-mode-map \"\\C-r\"   'stgit-repair)\n   (define-key stgit-mode-map \">\"   'stgit-push-next)\n   (define-key stgit-mode-map \"<\"   'stgit-pop-next)\n   (define-key stgit-mode-map \"P\"   'stgit-push-or-pop)\n@@ -138,6 +139,13 @@ Commands:\n     (stgit-refresh)\n     (stgit-goto-patch name)))\n \n+(defun stgit-repair ()\n+  \"Run stg repair\"\n+  (interactive)\n+  (stgit-capture-output nil\n+   (stgit-run \"repair\"))\n+  (stgit-refresh))\n+\n (defun stgit-push-next ()\n   \"Push the first unapplied patch\"\n   (interactive)\n"},{"id":"63149","messageId":"20071214105844.18066.69094.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 12/17] Emacs mode: added stgit-commit and stgit-uncommit","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:58:51Z","receivedAt":"2007-12-14T10:58:51Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |   14 ++++++++++++++\n 1 files changed, 14 insertions(+), 0 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex 20cb08f..4282585 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -90,6 +90,8 @@ Argument DIR is the repository path.\"\n   (define-key stgit-mode-map \"g\"   'stgit-refresh)\n   (define-key stgit-mode-map \"r\"   'stgit-rename)\n   (define-key stgit-mode-map \"\\C-r\"   'stgit-repair)\n+  (define-key stgit-mode-map \"C\"   'stgit-commit)\n+  (define-key stgit-mode-map \"U\"   'stgit-uncommit)\n   (define-key stgit-mode-map \">\"   'stgit-push-next)\n   (define-key stgit-mode-map \"<\"   'stgit-pop-next)\n   (define-key stgit-mode-map \"P\"   'stgit-push-or-pop)\n@@ -146,6 +148,18 @@ Commands:\n    (stgit-run \"repair\"))\n   (stgit-refresh))\n \n+(defun stgit-commit ()\n+  \"Run stg commit.\"\n+  (interactive)\n+  (stgit-capture-output nil (stgit-run \"commit\"))\n+  (stgit-refresh))\n+\n+(defun stgit-uncommit (arg)\n+  \"Run stg uncommit. Numeric arg determines number of patches to uncommit.\"\n+  (interactive \"p\")\n+  (stgit-capture-output nil (stgit-run \"uncommit\" \"-n\" (number-to-string arg)))\n+  (stgit-refresh))\n+\n (defun stgit-push-next ()\n   \"Push the first unapplied patch\"\n   (interactive)\n"},{"id":"63153","messageId":"20071214105856.18066.18189.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 13/17] Emacs mode: Add stgit-edit command","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:59:02Z","receivedAt":"2007-12-14T10:59:02Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |   25 +++++++++++++++++++++++++\n 1 files changed, 25 insertions(+), 0 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex 4282585..a344869 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -89,6 +89,7 @@ Argument DIR is the repository path.\"\n   (define-key stgit-mode-map \"n\"   'next-line)\n   (define-key stgit-mode-map \"g\"   'stgit-refresh)\n   (define-key stgit-mode-map \"r\"   'stgit-rename)\n+  (define-key stgit-mode-map \"e\"   'stgit-edit)\n   (define-key stgit-mode-map \"\\C-r\"   'stgit-repair)\n   (define-key stgit-mode-map \"C\"   'stgit-commit)\n   (define-key stgit-mode-map \"U\"   'stgit-uncommit)\n@@ -204,6 +205,30 @@ Commands:\n       (goto-char (point-min))\n       (diff-mode))))\n \n+(defun stgit-edit ()\n+  \"Edit the patch on the current line\"\n+  (interactive)\n+  (let ((patch (if (stgit-applied-at-point)\n+                   (stgit-patch-at-point)\n+                 (error \"This patch is not applied\")))\n+        (edit-buf (get-buffer-create \"*stgit edit*\"))\n+        (dir default-directory))\n+    (log-edit 'stgit-confirm-edit t nil edit-buf)\n+    (set (make-local-variable 'stgit-edit-patch) patch)\n+    (setq default-directory dir)\n+    (let ((standard-output edit-buf))\n+      (stgit-run \"edit\" \"--save-template=-\" patch))))\n+\n+(defun stgit-confirm-edit ()\n+  (interactive)\n+  (let ((file (make-temp-file \"stgit-edit-\")))\n+    (write-region (point-min) (point-max) file)\n+    (stgit-capture-output nil\n+      (stgit-run \"edit\" \"-f\" file stgit-edit-patch))\n+    (with-current-buffer log-edit-parent-buffer\n+      (stgit-refresh))))\n+\n+\n (defun stgit-help ()\n   \"Display help for the StGit mode.\"\n   (interactive)\n"},{"id":"63152","messageId":"20071214105907.18066.5325.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 14/17] Emacs mode: added fontification","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:59:13Z","receivedAt":"2007-12-14T10:59:13Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |   44 +++++++++++++++++++++++++++++++++++++++++++-\n 1 files changed, 43 insertions(+), 1 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex a344869..0859086 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -70,10 +70,52 @@ Argument DIR is the repository path.\"\n     (insert \"Branch: \")\n     (stgit-run \"branch\")\n     (stgit-run \"series\" \"--description\")\n+    (stgit-rehighlight (point-min) (point-max))\n     (if curpatch\n         (stgit-goto-patch curpatch)\n       (goto-line curline))))\n \n+(defface stgit-description-face\n+  '((((background dark)) (:foreground \"tan\"))\n+    (((background light)) (:foreground \"dark red\")))\n+  \"The face used for StGit desriptions\")\n+\n+(defface stgit-top-patch-face\n+  '((((background dark)) (:weight bold :foreground \"yellow\"))\n+    (((background light)) (:weight bold :foreground \"purple\"))\n+    (t (:weight bold)))\n+  \"The face used for the top patch names\")\n+\n+(defface stgit-applied-patch-face\n+  '((((background dark)) (:foreground \"light yellow\"))\n+    (((background light)) (:foreground \"purple\"))\n+    (t ()))\n+  \"The face used for applied patch names\")\n+\n+(defface stgit-unapplied-patch-face\n+  '((((background dark)) (:foreground \"gray80\"))\n+    (((background light)) (:foreground \"orchid\"))\n+    (t ()))\n+  \"The face used for unapplied patch names\")\n+\n+(defun stgit-rehighlight (start end)\n+  \"Refresh fontification of region between START and END.\"\n+  (save-excursion\n+    (goto-char start)\n+    (while (< (point) end)\n+      (cond ((looking-at \"Branch: \\\\(.*\\\\)\")\n+             (put-text-property (match-beginning 1) (match-end 1) 'face 'bold))\n+            ((looking-at \"\\\\([>+-]\\\\) \\\\([^ ]+\\\\) *| \\\\(.*\\\\)\")\n+             (let ((state (match-string 1)))\n+               (put-text-property\n+                (match-beginning 2) (match-end 2)\n+                'face (cond ((string= state \">\") 'stgit-top-patch-face)\n+                            ((string= state \"+\") 'stgit-applied-patch-face)\n+                            ((string= state \"-\") 'stgit-unapplied-patch-face)))\n+               (put-text-property (match-beginning 3) (match-end 3)\n+                                  'face 'stgit-description-face))))\n+      (forward-line 1))))\n+\n (defvar stgit-mode-hook nil\n   \"Run after `stgit-mode' is setup.\")\n \n@@ -118,7 +160,7 @@ Commands:\n   (save-excursion\n     (beginning-of-line)\n     (if (looking-at \"[>+-] \\\\([^ ]*\\\\)\")\n-        (match-string 1)\n+        (match-string-no-properties 1)\n       nil)))\n \n (defun stgit-goto-patch (patch)\n"},{"id":"63154","messageId":"20071214105918.18066.55913.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 15/17] Emacs mode: Added stgit-new","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:59:23Z","receivedAt":"2007-12-14T10:59:23Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |   39 +++++++++++++++++++++++++++++++++++++++\n 1 files changed, 39 insertions(+), 0 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex 0859086..1cb4dd2 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -132,6 +132,7 @@ Argument DIR is the repository path.\"\n   (define-key stgit-mode-map \"g\"   'stgit-refresh)\n   (define-key stgit-mode-map \"r\"   'stgit-rename)\n   (define-key stgit-mode-map \"e\"   'stgit-edit)\n+  (define-key stgit-mode-map \"N\"   'stgit-new)\n   (define-key stgit-mode-map \"\\C-r\"   'stgit-repair)\n   (define-key stgit-mode-map \"C\"   'stgit-commit)\n   (define-key stgit-mode-map \"U\"   'stgit-uncommit)\n@@ -270,6 +271,44 @@ Commands:\n     (with-current-buffer log-edit-parent-buffer\n       (stgit-refresh))))\n \n+(defun stgit-new ()\n+  \"Create a new patch\"\n+  (interactive)\n+  (let ((edit-buf (get-buffer-create \"*stgit edit*\")))\n+    (log-edit 'stgit-confirm-new t nil edit-buf)))\n+\n+(defun stgit-confirm-new ()\n+  (interactive)\n+  (let ((file (make-temp-file \"stgit-edit-\"))\n+        (patch (stgit-create-patch-name\n+                (buffer-substring (point-min)\n+                                  (save-excursion (goto-char (point-min))\n+                                                  (end-of-line)\n+                                                  (point))))))\n+    (write-region (point-min) (point-max) file)\n+    (stgit-capture-output nil\n+      (stgit-run \"new\" \"-m\" \"placeholder\" patch)\n+      (stgit-run \"edit\" \"-f\" file patch))\n+    (with-current-buffer log-edit-parent-buffer\n+      (stgit-refresh))))\n+\n+(defun stgit-create-patch-name (description)\n+  \"Create a patch name from a long description\"\n+  (let ((patch \"\"))\n+    (while (> (length description) 0)\n+      (cond ((string-match \"\\\\`[a-zA-Z_-]+\" description)\n+             (setq patch (downcase (concat patch (match-string 0 description))))\n+             (setq description (substring description (match-end 0))))\n+            ((string-match \"\\\\` +\" description)\n+             (setq patch (concat patch \"-\"))\n+             (setq description (substring description (match-end 0))))\n+            ((string-match \"\\\\`[^a-zA-Z_-]+\" description)\n+             (setq description (substring description (match-end 0))))))\n+    (cond ((= (length patch) 0)\n+           \"patch\")\n+          ((> (length patch) 20)\n+           (substring patch 0 20))\n+          (t patch))))\n \n (defun stgit-help ()\n   \"Display help for the StGit mode.\"\n"},{"id":"63150","messageId":"20071214105928.18066.94814.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 16/17] Emacs mode: Add mark command","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:59:32Z","receivedAt":"2007-12-14T10:59:32Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |   76 +++++++++++++++++++++++++++++++++++++++++-------------\n 1 files changed, 57 insertions(+), 19 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex 1cb4dd2..dfbf4a0 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -70,7 +70,7 @@ Argument DIR is the repository path.\"\n     (insert \"Branch: \")\n     (stgit-run \"branch\")\n     (stgit-run \"series\" \"--description\")\n-    (stgit-rehighlight (point-min) (point-max))\n+    (stgit-rescan)\n     (if curpatch\n         (stgit-goto-patch curpatch)\n       (goto-line curline))))\n@@ -98,23 +98,30 @@ Argument DIR is the repository path.\"\n     (t ()))\n   \"The face used for unapplied patch names\")\n \n-(defun stgit-rehighlight (start end)\n-  \"Refresh fontification of region between START and END.\"\n+(defun stgit-rescan ()\n+  \"Rescan the status buffer.\"\n   (save-excursion\n-    (goto-char start)\n-    (while (< (point) end)\n-      (cond ((looking-at \"Branch: \\\\(.*\\\\)\")\n-             (put-text-property (match-beginning 1) (match-end 1) 'face 'bold))\n-            ((looking-at \"\\\\([>+-]\\\\) \\\\([^ ]+\\\\) *| \\\\(.*\\\\)\")\n-             (let ((state (match-string 1)))\n-               (put-text-property\n-                (match-beginning 2) (match-end 2)\n-                'face (cond ((string= state \">\") 'stgit-top-patch-face)\n-                            ((string= state \"+\") 'stgit-applied-patch-face)\n-                            ((string= state \"-\") 'stgit-unapplied-patch-face)))\n-               (put-text-property (match-beginning 3) (match-end 3)\n-                                  'face 'stgit-description-face))))\n-      (forward-line 1))))\n+    (let ((marked ()))\n+      (goto-char (point-min))\n+      (while (not (eobp))\n+        (cond ((looking-at \"Branch: \\\\(.*\\\\)\")\n+               (put-text-property (match-beginning 1) (match-end 1)\n+                                  'face 'bold))\n+              ((looking-at \"\\\\([>+-]\\\\)\\\\( \\\\)\\\\([^ ]+\\\\) *| \\\\(.*\\\\)\")\n+               (let ((state (match-string 1))\n+                     (patchsym (intern (match-string 3))))\n+                 (put-text-property\n+                  (match-beginning 3) (match-end 3) 'face\n+                  (cond ((string= state \">\") 'stgit-top-patch-face)\n+                        ((string= state \"+\") 'stgit-applied-patch-face)\n+                        ((string= state \"-\") 'stgit-unapplied-patch-face)))\n+                 (put-text-property (match-beginning 4) (match-end 4)\n+                                    'face 'stgit-description-face)\n+                 (when (memq patchsym stgit-marked-patches)\n+                   (replace-match \"*\" nil nil nil 2)\n+                   (setq marked (cons patchsym marked))))))\n+        (forward-line 1))\n+      (setq stgit-marked-patches (nreverse marked)))))\n \n (defvar stgit-mode-hook nil\n   \"Run after `stgit-mode' is setup.\")\n@@ -125,6 +132,8 @@ Argument DIR is the repository path.\"\n (unless stgit-mode-map\n   (setq stgit-mode-map (make-keymap))\n   (suppress-keymap stgit-mode-map)\n+  (define-key stgit-mode-map \" \"   'stgit-mark)\n+  (define-key stgit-mode-map \"\\d\" 'stgit-unmark)\n   (define-key stgit-mode-map \"?\"   'stgit-help)\n   (define-key stgit-mode-map \"h\"   'stgit-help)\n   (define-key stgit-mode-map \"p\"   'previous-line)\n@@ -153,14 +162,27 @@ Commands:\n         goal-column 2)\n   (use-local-map stgit-mode-map)\n   (set (make-local-variable 'list-buffers-directory) default-directory)\n+  (set (make-local-variable 'stgit-marked-patches) nil)\n   (set-variable 'truncate-lines 't)\n   (run-hooks 'stgit-mode-hook))\n \n+(defun stgit-add-mark (patch)\n+  (let ((patchsym (intern patch)))\n+    (setq stgit-marked-patches (cons patchsym stgit-marked-patches))))\n+\n+(defun stgit-remove-mark (patch)\n+  (let ((patchsym (intern patch)))\n+    (setq stgit-marked-patches (delq patchsym stgit-marked-patches))))\n+\n+(defun stgit-marked-patches ()\n+  \"Return the names of the marked patches.\"\n+  (mapcar 'symbol-name stgit-marked-patches))\n+\n (defun stgit-patch-at-point ()\n   \"Return the patch name on the current line\"\n   (save-excursion\n     (beginning-of-line)\n-    (if (looking-at \"[>+-] \\\\([^ ]*\\\\)\")\n+    (if (looking-at \"[>+-][ *]\\\\([^ ]*\\\\)\")\n         (match-string-no-properties 1)\n       nil)))\n \n@@ -168,12 +190,28 @@ Commands:\n   \"Move point to the line containing PATCH\"\n   (let ((p (point)))\n     (goto-char (point-min))\n-    (if (re-search-forward (concat \"[>+-] \" (regexp-quote patch) \" \") nil t)\n+    (if (re-search-forward (concat \"^[>+-][ *]\" (regexp-quote patch) \" \") nil t)\n         (progn (move-to-column goal-column)\n                t)\n       (goto-char p)\n       nil)))\n \n+(defun stgit-mark ()\n+  \"Mark the patch under point\"\n+  (interactive)\n+  (let ((patch (stgit-patch-at-point)))\n+    (stgit-add-mark patch)\n+    (stgit-refresh))\n+  (next-line))\n+\n+(defun stgit-unmark ()\n+  \"Mark the patch on the previous line\"\n+  (interactive)\n+  (forward-line -1)\n+  (let ((patch (stgit-patch-at-point)))\n+    (stgit-remove-mark patch)\n+    (stgit-refresh)))\n+\n (defun stgit-rename (name)\n   \"Rename the patch under point\"\n   (interactive (list (read-string \"Patch name: \" (stgit-patch-at-point))))\n"},{"id":"63151","messageId":"20071214105937.18066.96219.stgit@krank","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"[StGit PATCH 17/17] Emacs mode: coalesce command","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-14T10:59:49Z","receivedAt":"2007-12-14T10:59:49Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"\nSigned-off-by: David Kågedal <davidk@lysator.liu.se>\n---\n\n contrib/stgit.el |   21 +++++++++++++++++++++\n 1 files changed, 21 insertions(+), 0 deletions(-)\n\n\ndiff --git a/contrib/stgit.el b/contrib/stgit.el\nindex dfbf4a0..4d0faca 100644\n--- a/contrib/stgit.el\n+++ b/contrib/stgit.el\n@@ -141,6 +141,7 @@ Argument DIR is the repository path.\"\n   (define-key stgit-mode-map \"g\"   'stgit-refresh)\n   (define-key stgit-mode-map \"r\"   'stgit-rename)\n   (define-key stgit-mode-map \"e\"   'stgit-edit)\n+  (define-key stgit-mode-map \"c\"   'stgit-coalesce)\n   (define-key stgit-mode-map \"N\"   'stgit-new)\n   (define-key stgit-mode-map \"\\C-r\"   'stgit-repair)\n   (define-key stgit-mode-map \"C\"   'stgit-commit)\n@@ -348,6 +349,26 @@ Commands:\n            (substring patch 0 20))\n           (t patch))))\n \n+(defun stgit-coalesce (patch-names)\n+  \"Run stg coalesce on the named patches\"\n+  (interactive (list (stgit-marked-patches)))\n+  (let ((edit-buf (get-buffer-create \"*stgit edit*\"))\n+        (dir default-directory))\n+    (log-edit 'stgit-confirm-coalesce t nil edit-buf)\n+    (set (make-local-variable 'stgit-patches) patch-names)\n+    (setq default-directory dir)\n+    (let ((standard-output edit-buf))\n+      (apply 'stgit-run \"coalesce\" \"--save-template=-\" patch-names))))\n+\n+(defun stgit-confirm-coalesce ()\n+  (interactive)\n+  (let ((file (make-temp-file \"stgit-edit-\")))\n+    (write-region (point-min) (point-max) file)\n+    (stgit-capture-output nil\n+      (apply 'stgit-run \"coalesce\" \"-f\" file stgit-patches))\n+    (with-current-buffer log-edit-parent-buffer\n+      (stgit-refresh))))\n+\n (defun stgit-help ()\n   \"Display help for the StGit mode.\"\n   (interactive)\n"},{"id":"63401","messageId":"b0943d9e0712170309n415dc6cs9d1c1f8a9c687bf8@mail.gmail.com","threadId":"11288","inReplyTo":"20071214105238.18066.23281.stgit@krank","subject":"Re: [StGit PATCH 00/17] Series short description","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-12-17T11:09:06Z","receivedAt":"2007-12-17T11:09:06Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 14/12/2007, David Kågedal <davidk@lysator.liu.se> wrote:\n> The following series an emacs interface to stgit patch stacks. It\n> shows a buffer with the the output of \"stg series\" and allows you to\n> do some common operations on it, such as push/pop, commit/uncommit,\n> edit, rename, repair, and coalesce.\n\nThat's really cool stuff! Thanks.\n\n> The coalesce command obviosly requires the kha/experimental branch.\n> The edit command requires the edit fixes in kha/safe.\n\nI'll start this week merging patches from kha/experimental (I'm a bit\nslow because of the Christmas activities).\n\n-- \nCatalin\n"},{"id":"63504","messageId":"20071217224812.GA6342@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"b0943d9e0712170309n415dc6cs9d1c1f8a9c687bf8@mail.gmail.com","subject":"Re: [StGit PATCH 00/17] Series short description","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-17T22:48:12Z","receivedAt":"2007-12-17T22:48:12Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-17 11:09:06 +0000, Catalin Marinas wrote:\n\n> On 14/12/2007, David Kågedal <davidk@lysator.liu.se> wrote:\n>\n> > The following series an emacs interface to stgit patch stacks. It\n> > shows a buffer with the the output of \"stg series\" and allows you\n> > to do some common operations on it, such as push/pop,\n> > commit/uncommit, edit, rename, repair, and coalesce.\n>\n> That's really cool stuff! Thanks.\n\nYes, incredibly useful.\n\nI've put this series in kha/safe -- except for the mark and coalesce\npatches, which are at the tip of kha/experimental. The latter because\nit obviously has to be, the former because the latter is the only\nthing using it and it's _extremely annoying_ to be able to mark\npatches but not, say, push or pop all marked patches.\n\nMy stack is now 53 patches deep, so running the test suite on every\npatch is getting time consuming -- I'd guess about two hours on my\npoor laptop. And I plan to sleep while that runs, so I won't actually\npush this until tomorrow.\n\n> > The coalesce command obviosly requires the kha/experimental\n> > branch. The edit command requires the edit fixes in kha/safe.\n>\n> I'll start this week merging patches from kha/experimental (I'm a\n> bit slow because of the Christmas activities).\n\nBe careful about merging past the \"goto\" patch -- I'm pretty sure it\nbreaks when called from a subdirectory, and I don't have time to fix\nthat right now. (It should be a clean fix, though -- just adjust the\ncwd for precisely those git subprocesses that need it, which is very\nfew. I think.)\n\nIf you like, I can advance \"safe\" to include as many patches as I\nthink you should merge right now.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63559","messageId":"20071218052115.GA13422@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"20071217224812.GA6342@diana.vm.bytemark.co.uk","subject":"kha/safe and kha/experimental updated","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-18T05:21:15Z","receivedAt":"2007-12-18T05:21:15Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-17 23:48:12 +0100, Karl Hasselström wrote:\n\n> If you like, I can advance \"safe\" to include as many patches as I\n> think you should merge right now.\n\nAnd here it is:\n\nThe following changes since commit 5be69cd8d89bd89be31364e9c0fd9e947b6ef644:\n  Karl Hasselström (1):\n        Name the exit codes to improve legibility\n\nare available in the git repository at:\n\n  git://repo.or.cz/stgit/kha.git safe\n\nDavid Kågedal (17):\n      Add an StGit mode for emacs\n      Emacs mode: Improve the output buffer state\n      Emacs mode: Bind n and p\n      Emacs mode: add stgit-repair\n      Emacs mode: added stgit-commit and stgit-uncommit\n      Emacs mode: Add stgit-edit command\n      Emacs mode: added fontification\n      Emacs mode: Added stgit-new\n      Check bottom and invariants\n      Remove the 'bottom' field\n      Remove the 'top' field\n      Split git.merge into two functions\n      Leave working dir and index alone after failed (conflicting) push\n      Added a test case to check what happens when push finds a conflict\n      Simplify merge_recursive\n      Use the output from merge-recursive to list conflicts\n      Ask git about unmerged files\n\nKarl Hasselström (24):\n      Emacs mode: Show keybindings when user presses \"h\" or \"?\"\n      Emacs mode: Add an explanatory header\n      Emacs mode: Makefile for building stgit.el\n      Emacs mode: push/pop next patch, not patch at point\n      Emacs mode: Let \"P\" push or pop patch at point\n      Emacs mode: Bind \"G\" to \"stg goto\"\n      Emacs mode: show patches' short description\n      Write removed fields for backwards compatibility\n      Nicer conflict markers\n      Better error message if merge fails\n      Fix \"stg resolved\" to work with new conflict representation\n      Refactoring: pass more than one file to resolved()\n      We keep the different stages of a conflict in the index now\n      \"stg status --reset\" is not needed anymore\n      Remove \"stg add\"\n      Remove \"stg rm\"\n      Remove \"stg cp\"\n      Remove \"stg resolved\"\n      New StGit core infrastructure: repository operations\n      Write metadata files used by the old infrastructure\n      Upgrade older stacks to newest version\n      Let \"stg clean\" use the new infrastructure\n      Add \"stg coalesce\"\n      Let \"stg applied\" and \"stg unapplied\" use the new infrastructure\n\n Documentation/stg-cp.txt      |   63 --------\n Documentation/stg.txt         |    2 -\n Documentation/tutorial.txt    |   31 +++--\n contrib/Makefile              |   19 +++\n contrib/stgit-completion.bash |    4 +-\n contrib/stgit.el              |  318 +++++++++++++++++++++++++++++++++++++++++\n examples/gitconfig            |   19 +---\n setup.py                      |    2 +-\n stgit/commands/add.py         |   44 ------\n stgit/commands/applied.py     |   27 ++--\n stgit/commands/clean.py       |   68 +++++-----\n stgit/commands/coalesce.py    |   84 +++++++++++\n stgit/commands/common.py      |   39 +++---\n stgit/commands/copy.py        |   45 ------\n stgit/commands/pick.py        |    2 +-\n stgit/commands/resolved.py    |   94 ------------\n stgit/commands/rm.py          |   48 ------\n stgit/commands/status.py      |   31 ++---\n stgit/commands/sync.py        |    1 -\n stgit/commands/unapplied.py   |   23 ++--\n stgit/config.py               |    1 -\n stgit/git.py                  |   75 ++++++----\n stgit/gitmergeonefile.py      |   97 +------------\n stgit/lib/__init__.py         |   18 +++\n stgit/lib/git.py              |  260 +++++++++++++++++++++++++++++++++\n stgit/lib/stack.py            |  172 ++++++++++++++++++++++\n stgit/lib/stackupgrade.py     |   96 ++++++++++++\n stgit/lib/transaction.py      |   79 ++++++++++\n stgit/main.py                 |   10 +-\n stgit/run.py                  |    3 +\n stgit/stack.py                |  156 ++++----------------\n stgit/utils.py                |   24 +++\n t/t0002-status.sh             |   15 +-\n t/t1200-push-modified.sh      |    2 +-\n t/t1202-push-undo.sh          |    6 +-\n t/t1203-push-conflict.sh      |   70 +++++++++\n t/t1204-pop-keep.sh           |    2 +-\n t/t1205-push-subdir.sh        |    8 +-\n t/t1300-uncommit.sh           |    4 +-\n t/t1301-repair.sh             |    2 +-\n t/t1400-patch-history.sh      |    4 +-\n t/t1500-float.sh              |   14 +-\n t/t1600-delete-one.sh         |   12 +-\n t/t1601-delete-many.sh        |    2 +-\n t/t1700-goto-top.sh           |    2 +-\n t/t2000-sync.sh               |   12 +-\n t/t2100-pull-policy-fetch.sh  |    4 +-\n t/t2101-pull-policy-pull.sh   |    4 +-\n t/t2102-pull-policy-rebase.sh |    4 +-\n t/t2300-refresh-subdir.sh     |    2 +-\n t/t2600-coalesce.sh           |   31 ++++\n 51 files changed, 1420 insertions(+), 735 deletions(-)\n delete mode 100644 Documentation/stg-cp.txt\n create mode 100644 contrib/Makefile\n create mode 100644 contrib/stgit.el\n delete mode 100644 stgit/commands/add.py\n create mode 100644 stgit/commands/coalesce.py\n delete mode 100644 stgit/commands/copy.py\n delete mode 100644 stgit/commands/resolved.py\n delete mode 100644 stgit/commands/rm.py\n create mode 100644 stgit/lib/__init__.py\n create mode 100644 stgit/lib/git.py\n create mode 100644 stgit/lib/stack.py\n create mode 100644 stgit/lib/stackupgrade.py\n create mode 100644 stgit/lib/transaction.py\n create mode 100755 t/t1203-push-conflict.sh\n create mode 100755 t/t2600-coalesce.sh\n\n                                 -+-\n\nThe following changes since commit 1189271615e7157ca3da3288a9ce3c9bcaeb2d5f:\n  Karl Hasselström (1):\n        Let \"stg applied\" and \"stg unapplied\" use the new infrastructure\n\nare available in the git repository at:\n\n  git://repo.or.cz/stgit/kha.git experimental\n\nDavid Kågedal (2):\n      Emacs mode: Add mark command\n      Emacs mode: coalesce command\n\nKarl Hasselström (10):\n      Teach the new infrastructure about the index and worktree\n      Let \"stg clean\" use the new transaction primitives\n      Let \"stg goto\" use the new infrastructure\n      Convert \"stg uncommit\" to the new infrastructure\n      New infrastructure: Make sure that the branch is initialized\n      Expose transaction abort function\n      stg coalesce: Support --file and --save-template\n      Set exit code to 3 on merge conflict\n      Convert \"stg commit\" to new infrastructure\n      Make \"stg commit\" fancier\n\n contrib/stgit.el           |   97 +++++++++++++++++++-----\n stgit/commands/clean.py    |   35 ++-------\n stgit/commands/coalesce.py |  118 +++++++++++++++++++----------\n stgit/commands/commit.py   |  111 +++++++++++++++++----------\n stgit/commands/goto.py     |   52 +++++---------\n stgit/commands/uncommit.py |   81 +++++++++-----------\n stgit/lib/git.py           |  127 +++++++++++++++++++++++++++++++\n stgit/lib/stack.py         |   10 ++-\n stgit/lib/stackupgrade.py  |    6 +-\n stgit/lib/transaction.py   |  178 ++++++++++++++++++++++++++++++++++++++------\n stgit/main.py              |    4 +-\n stgit/utils.py             |    1 +\n t/t1300-uncommit.sh        |   12 ++--\n 13 files changed, 588 insertions(+), 244 deletions(-)\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63572","messageId":"b0943d9e0712180111l3294e1adj60b5271b9820c60c@mail.gmail.com","threadId":"11288","inReplyTo":"20071217224812.GA6342@diana.vm.bytemark.co.uk","subject":"Re: [StGit PATCH 00/17] Series short description","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-12-18T09:11:00Z","receivedAt":"2007-12-18T09:11:00Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 17/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> On 2007-12-17 11:09:06 +0000, Catalin Marinas wrote:\n>\n> > On 14/12/2007, David Kågedal <davidk@lysator.liu.se> wrote:\n> >\n> > > The following series an emacs interface to stgit patch stacks. It\n> > > shows a buffer with the the output of \"stg series\" and allows you\n> > > to do some common operations on it, such as push/pop,\n> > > commit/uncommit, edit, rename, repair, and coalesce.\n> >\n> > That's really cool stuff! Thanks.\n>\n> Yes, incredibly useful.\n\nOther useful commands would be support for 'patches' and a local\ndiff/status (and maybe a menu).\n\n> Be careful about merging past the \"goto\" patch -- I'm pretty sure it\n> breaks when called from a subdirectory, and I don't have time to fix\n> that right now. (It should be a clean fix, though -- just adjust the\n> cwd for precisely those git subprocesses that need it, which is very\n> few. I think.)\n\nWhy not just change the cwd when the command starts and it should be\nsafe for all the git subprocesses.\n\n> If you like, I can advance \"safe\" to include as many patches as I\n> think you should merge right now.\n\nOK, thanks.\n\n-- \nCatalin\n"},{"id":"63574","messageId":"871w9kmkaj.fsf@lysator.liu.se","threadId":"11288","inReplyTo":"b0943d9e0712180111l3294e1adj60b5271b9820c60c@mail.gmail.com","subject":"Re: [StGit PATCH 00/17] Series short description","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-18T09:20:04Z","receivedAt":"2007-12-18T09:20:04Z","isPatch":true,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"\"Catalin Marinas\" <catalin.marinas@gmail.com> writes:\n\n> On 17/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n>> On 2007-12-17 11:09:06 +0000, Catalin Marinas wrote:\n>>\n>> > On 14/12/2007, David Kågedal <davidk@lysator.liu.se> wrote:\n>> >\n>> > > The following series an emacs interface to stgit patch stacks. It\n>> > > shows a buffer with the the output of \"stg series\" and allows you\n>> > > to do some common operations on it, such as push/pop,\n>> > > commit/uncommit, edit, rename, repair, and coalesce.\n>> >\n>> > That's really cool stuff! Thanks.\n>>\n>> Yes, incredibly useful.\n>\n> Other useful commands would be support for 'patches' and a local\n> diff/status (and maybe a menu).\n\nI have some ideas for some way of showing the current status, but\nnothing is implemented yet. For some of the more complex cases, I'd\nlike to refer to git.el, although I think that needs some\nimprovements.\n\nI don't think I ever used the 'patches' command, so I'm not sure what\nthe best way to implement it would be.\n\nAnd my emacs has no menu, so I'm probably not the best person to adda\nmenu, either :-)\n\n-- \nDavid Kågedal\n"},{"id":"63575","messageId":"20071218092419.GA16029@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"b0943d9e0712180111l3294e1adj60b5271b9820c60c@mail.gmail.com","subject":"Re: [StGit PATCH 00/17] Series short description","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-18T09:24:19Z","receivedAt":"2007-12-18T09:24:19Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-18 09:11:00 +0000, Catalin Marinas wrote:\n\n> On 17/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n>\n> > Be careful about merging past the \"goto\" patch -- I'm pretty sure\n> > it breaks when called from a subdirectory, and I don't have time\n> > to fix that right now. (It should be a clean fix, though -- just\n> > adjust the cwd for precisely those git subprocesses that need it,\n> > which is very few. I think.)\n>\n> Why not just change the cwd when the command starts and it should be\n> safe for all the git subprocesses.\n\nIt doesn't feel very clean to require the caller of some unspecified\nsubset of git calls to remember to set the correct piece of global\nstate.\n\nAnd the correct solution should really be very simple, since it's\nprecisely the worktree operations (specifically, the subset thereof\nthat have to operate on the whole tree) that require setting cwd. And\nthose are very clearly separated out from the rest in the new\ninfrastructure.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63630","messageId":"b0943d9e0712180809l4d2d01b8j32ab2a410885cc5e@mail.gmail.com","threadId":"11288","inReplyTo":"20071218052115.GA13422@diana.vm.bytemark.co.uk","subject":"Re: kha/safe and kha/experimental updated","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-12-18T16:09:24Z","receivedAt":"2007-12-18T16:09:24Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"Thanks again for maintaining these branches.\n\nOn 18/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n>   git://repo.or.cz/stgit/kha.git safe\n>\n> David Kågedal (17):\n[...]\n>       Simplify merge_recursive\n>       Use the output from merge-recursive to list conflicts\n\nI'll drop git.merge() entirely since it is only used by the 'sync'\ncommand due to the performance issues I had in the past with rename\ndetection in git-merge-recursive. Hopefully, these are gone now.\n\nI'll try to fix the automatic invocation of the interactive merger in\ncase of conflicts (it is only present in git.merge()).\n\n> Karl Hasselström (24):\n>       Fix \"stg resolved\" to work with new conflict representation\n\nFor some reason, the interactive resolving keeps invoking the merger.\nI'll have a look.\n\n>       \"stg status --reset\" is not needed anymore\n\nI would keep this as an alias for 'git reset --hard' (see below as well).\n\n>       Remove \"stg add\"\n>       Remove \"stg rm\"\n>       Remove \"stg cp\"\n\nI plan to add a generic command for these kind of aliases. The reason\nis that I don't really like mixing GIT and StGIT commands (I think at\nsome point I'll get confused and try to run stg commands with git).\n\n>       Remove \"stg resolved\"\n\nI'd like to keep this command. git-mergetool doesn't support the tool\nI use (emacs + ediff and more stgit-specific file extensions like\ncurrent, patch etc.). I also don't find 'git add' to be meaningful for\nmarking a conflict as solved.\n\n-- \nCatalin\n"},{"id":"63636","messageId":"m3hcigot3h.fsf@roke.D-201","threadId":"11288","inReplyTo":"b0943d9e0712180809l4d2d01b8j32ab2a410885cc5e@mail.gmail.com","subject":"Re: kha/safe and kha/experimental updated","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-12-18T16:39:52Z","receivedAt":"2007-12-18T16:39:52Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\"Catalin Marinas\" <catalin.marinas@gmail.com> writes:\n\n> Thanks again for maintaining these branches.\n> \n> On 18/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> >   git://repo.or.cz/stgit/kha.git safe\n\n> >       Remove \"stg resolved\"\n> \n> I'd like to keep this command. git-mergetool doesn't support the tool\n> I use (emacs + ediff and more stgit-specific file extensions like\n> current, patch etc.). I also don't find 'git add' to be meaningful for\n> marking a conflict as solved.\n\nI also would like to have this command kept (and shown in 'stg help'!).\nContrary to 'git add' it can check and add to index / update index\nonly for files with conflict; we have -r (ancestor|current|patched)\nto choose one side, and we could add --check to check if there are\nno conflict markers with files (useful with -a/--all).\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"63639","messageId":"b0943d9e0712180852y62c5bea2x61463b235b26ca04@mail.gmail.com","threadId":"11288","inReplyTo":"m3hcigot3h.fsf@roke.D-201","subject":"Re: kha/safe and kha/experimental updated","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-12-18T16:52:18Z","receivedAt":"2007-12-18T16:52:18Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 18/12/2007, Jakub Narebski <jnareb@gmail.com> wrote:\n> \"Catalin Marinas\" <catalin.marinas@gmail.com> writes:\n>\n> > Thanks again for maintaining these branches.\n> >\n> > On 18/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> > >   git://repo.or.cz/stgit/kha.git safe\n>\n> > >       Remove \"stg resolved\"\n> >\n> > I'd like to keep this command. git-mergetool doesn't support the tool\n> > I use (emacs + ediff and more stgit-specific file extensions like\n> > current, patch etc.). I also don't find 'git add' to be meaningful for\n> > marking a conflict as solved.\n>\n> I also would like to have this command kept (and shown in 'stg help'!).\n> Contrary to 'git add' it can check and add to index / update index\n> only for files with conflict; we have -r (ancestor|current|patched)\n> to choose one side, and we could add --check to check if there are\n> no conflict markers with files (useful with -a/--all).\n\nI'd also like to re-add the stgit.keeporig option and additional\nfunctionality so that the *.{ancestor,current,patched} can be left in\nthe working tree. Some people might use them when manually fixing\nconflicts (I have a look at them from time to time when the emacs +\nediff shows a hard to understand conflict).\n\n-- \nCatalin\n"},{"id":"63733","messageId":"20071219093400.GA4361@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"b0943d9e0712180809l4d2d01b8j32ab2a410885cc5e@mail.gmail.com","subject":"Re: kha/safe and kha/experimental updated","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-19T09:34:00Z","receivedAt":"2007-12-19T09:34:00Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-18 16:09:24 +0000, Catalin Marinas wrote:\n\n> On 18/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n>\n> >       \"stg status --reset\" is not needed anymore\n>\n> I would keep this as an alias for 'git reset --hard' (see below as\n> well).\n>\n> >       Remove \"stg add\"\n> >       Remove \"stg rm\"\n> >       Remove \"stg cp\"\n>\n> I plan to add a generic command for these kind of aliases. The\n> reason is that I don't really like mixing GIT and StGIT commands (I\n> think at some point I'll get confused and try to run stg commands\n> with git).\n\nHow should these aliases be presented in the documentation etc.? I\nsuggest making it very clear that they are only aliases.\n\n> >       Remove \"stg resolved\"\n>\n> I'd like to keep this command. git-mergetool doesn't support the\n> tool I use (emacs + ediff and more stgit-specific file extensions\n> like current, patch etc.).\n\nSo why have a separate command instead of fixing git-mergetool?\n\n> I also don't find 'git add' to be meaningful for marking a conflict\n> as solved.\n\nSo maybe let \"stg resolved\" be an alias for \"git add\"?\n\nThis is all our usual disagreement: You want stg to be a fairly\nstandalone tool, and I want it to be a tool to use side by side with\ngit. The problem I see with your approach is that stg risks ending up\nlike Cogito: it'll provide inspiration for improving git, but will\nitself become obsolete because of the simple fact that git has so much\nmore development manpower. I think it'd be more productive to let stg\ndo one thing -- patch stacks -- and do it well, and rely on git for\neverything else.\n\nOf course, if stuff like \"stg add\" and \"stg resolved\" are really\nimplemented as three-line wrappers around git commands, we don't have\nthat problem.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63735","messageId":"20071219093816.GB4361@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"m3hcigot3h.fsf@roke.D-201","subject":"Re: kha/safe and kha/experimental updated","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-19T09:38:16Z","receivedAt":"2007-12-19T09:38:16Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-18 08:39:52 -0800, Jakub Narebski wrote:\n\n> \"Catalin Marinas\" <catalin.marinas@gmail.com> writes:\n>\n> > On 18/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> >\n> > >       Remove \"stg resolved\"\n> >\n> > I'd like to keep this command. git-mergetool doesn't support the\n> > tool I use (emacs + ediff and more stgit-specific file extensions\n> > like current, patch etc.). I also don't find 'git add' to be\n> > meaningful for marking a conflict as solved.\n>\n> I also would like to have this command kept (and shown in 'stg\n> help'!). Contrary to 'git add' it can check and add to index /\n> update index only for files with conflict; we have -r\n> (ancestor|current|patched) to choose one side, and we could add\n> --check to check if there are no conflict markers with files (useful\n> with -a/--all).\n\nThis too sounds like stuff that could profitably be added to \"git\nadd\". Except for the ancestor/current/patched words, it is not\nspecific to patch stacks, so the implementation should be in git and\nnot in stg.\n\nIMHO, of course. :-)\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63736","messageId":"87bq8nkoma.fsf@lysator.liu.se","threadId":"11288","inReplyTo":"b0943d9e0712180852y62c5bea2x61463b235b26ca04@mail.gmail.com","subject":"Re: kha/safe and kha/experimental updated","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-19T09:41:49Z","receivedAt":"2007-12-19T09:41:49Z","isPatch":false,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"\"Catalin Marinas\" <catalin.marinas@gmail.com> writes:\n\n> On 18/12/2007, Jakub Narebski <jnareb@gmail.com> wrote:\n>> \"Catalin Marinas\" <catalin.marinas@gmail.com> writes:\n>>\n>> > Thanks again for maintaining these branches.\n>> >\n>> > On 18/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n>> > >   git://repo.or.cz/stgit/kha.git safe\n>>\n>> > >       Remove \"stg resolved\"\n>> >\n>> > I'd like to keep this command. git-mergetool doesn't support the tool\n>> > I use (emacs + ediff and more stgit-specific file extensions like\n>> > current, patch etc.). I also don't find 'git add' to be meaningful for\n>> > marking a conflict as solved.\n>>\n>> I also would like to have this command kept (and shown in 'stg help'!).\n>> Contrary to 'git add' it can check and add to index / update index\n>> only for files with conflict; we have -r (ancestor|current|patched)\n>> to choose one side, and we could add --check to check if there are\n>> no conflict markers with files (useful with -a/--all).\n>\n> I'd also like to re-add the stgit.keeporig option and additional\n> functionality so that the *.{ancestor,current,patched} can be left in\n> the working tree. Some people might use them when manually fixing\n> conflicts (I have a look at them from time to time when the emacs +\n> ediff shows a hard to understand conflict).\n\nSince all the information is in git, it is of course easy to recreate\nit. But the important question to ask is: how do you use these extra\nfiles? git.el provides a way to diff against both parent versions, and\nmaybe that is actually what you need.\n\nI don't mind that you want these files, but they are mostly clutter to\nme.\n\n-- \nDavid Kågedal\n"},{"id":"63738","messageId":"878x3rko81.fsf@lysator.liu.se","threadId":"11288","inReplyTo":"87bq8nkoma.fsf@lysator.liu.se","subject":"Re: kha/safe and kha/experimental updated","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-19T09:50:22Z","receivedAt":"2007-12-19T09:50:22Z","isPatch":false,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"David Kågedal <davidk@lysator.liu.se> writes:\n\n> \"Catalin Marinas\" <catalin.marinas@gmail.com> writes:\n>\n>> On 18/12/2007, Jakub Narebski <jnareb@gmail.com> wrote:\n>>> \"Catalin Marinas\" <catalin.marinas@gmail.com> writes:\n>>>\n>>> > Thanks again for maintaining these branches.\n>>> >\n>>> > On 18/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n>>> > >   git://repo.or.cz/stgit/kha.git safe\n>>>\n>>> > >       Remove \"stg resolved\"\n>>> >\n>>> > I'd like to keep this command. git-mergetool doesn't support the tool\n>>> > I use (emacs + ediff and more stgit-specific file extensions like\n>>> > current, patch etc.). I also don't find 'git add' to be meaningful for\n>>> > marking a conflict as solved.\n>>>\n>>> I also would like to have this command kept (and shown in 'stg help'!).\n>>> Contrary to 'git add' it can check and add to index / update index\n>>> only for files with conflict; we have -r (ancestor|current|patched)\n>>> to choose one side, and we could add --check to check if there are\n>>> no conflict markers with files (useful with -a/--all).\n>>\n>> I'd also like to re-add the stgit.keeporig option and additional\n>> functionality so that the *.{ancestor,current,patched} can be left in\n>> the working tree. Some people might use them when manually fixing\n>> conflicts (I have a look at them from time to time when the emacs +\n>> ediff shows a hard to understand conflict).\n>\n> Since all the information is in git, it is of course easy to recreate\n> it. But the important question to ask is: how do you use these extra\n> files? git.el provides a way to diff against both parent versions, and\n> maybe that is actually what you need.\n\nNote that I'm talking about the kha/experimental branch here. The\npoint of my patches there are to make sure that the git index is left\nin the unmerged state so that normal git tools can be used.  This\nmeans that git diff-files -2 and -3 does what you want.\n\n-- \nDavid Kågedal\n"},{"id":"63739","messageId":"b0943d9e0712190209y485bc2f8w806bd2cad309e74b@mail.gmail.com","threadId":"11288","inReplyTo":"20071219093400.GA4361@diana.vm.bytemark.co.uk","subject":"Re: kha/safe and kha/experimental updated","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-12-19T10:09:40Z","receivedAt":"2007-12-19T10:09:40Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 19/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> On 2007-12-18 16:09:24 +0000, Catalin Marinas wrote:\n>\n> > On 18/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> >\n> > >       \"stg status --reset\" is not needed anymore\n> >\n> > I would keep this as an alias for 'git reset --hard' (see below as\n> > well).\n> >\n> > >       Remove \"stg add\"\n> > >       Remove \"stg rm\"\n> > >       Remove \"stg cp\"\n> >\n> > I plan to add a generic command for these kind of aliases. The\n> > reason is that I don't really like mixing GIT and StGIT commands (I\n> > think at some point I'll get confused and try to run stg commands\n> > with git).\n>\n> How should these aliases be presented in the documentation etc.? I\n> suggest making it very clear that they are only aliases.\n\nYes, 'stg help' should clearly mark them as aliases of git commands.\nI'm not sure how I'll do this yet. For the 'status --reset', I'll keep\nit if we have a separate 'resolved' command.\n\n> > >       Remove \"stg resolved\"\n> >\n> > I'd like to keep this command. git-mergetool doesn't support the\n> > tool I use (emacs + ediff and more stgit-specific file extensions\n> > like current, patch etc.).\n>\n> So why have a separate command instead of fixing git-mergetool?\n\nIn the past, StGIT only used the core git functionality and stayed\naway from the porcelain scripts. We now started to use some of the\nbuilt-in commands more and more and I think it is fine but the git\nscripts look more volatile to me than the C code (look at the many\nvariants the git merging went through, from shell scripts to python\nand only now seems to be stabilised with the recursive merge as a\nbuilt-in command).\n\nAdding the functionality I need to git-mergetool would also mean\nalways using the latest GIT with StGIT. Anyway, if you like\ngit-mergetool, I think you can easily change the StGIT configuration\nto\n\n> > I also don't find 'git add' to be meaningful for marking a conflict\n> > as solved.\n>\n> So maybe let \"stg resolved\" be an alias for \"git add\"?\n\nIt's not a simple alias, if you use 'stg resolved -a'. Now, if we\nallow stgit.keeporig, it needs even more functionality.\n\n> This is all our usual disagreement: You want stg to be a fairly\n> standalone tool, and I want it to be a tool to use side by side with\n> git. The problem I see with your approach is that stg risks ending up\n> like Cogito: it'll provide inspiration for improving git, but will\n> itself become obsolete because of the simple fact that git has so much\n> more development manpower.\n\nIf GIT would have all the functionality I need for my workflow, I\nwouldn't mind giving up StGIT (I started StGIT because I needed easier\npatch management on top of GIT and modifying Quilt would've been too\nintrusive).\n\n> I think it'd be more productive to let stg\n> do one thing -- patch stacks -- and do it well, and rely on git for\n> everything else.\n\nIn principle, yes, but I have some minor problems with the UI of GIT\n(like resolved == add). I think there is also a fundamental difference\nbetween 'git commit' and 'stg refresh'. The former requires explicit\nmarking of the files to commit (or use the -a option) while the latter\nalways adds all the local changes to the current patch. Maybe GIT\nusers are more used to running 'git add' after fixing a conflict but I\nuse StGIT almost exclusively.\n\n> Of course, if stuff like \"stg add\" and \"stg resolved\" are really\n> implemented as three-line wrappers around git commands, we don't have\n> that problem.\n\nFor add/rm/cp, they should just be a generic wrapper which doesn't\neven parse the command line options. That's not the case with\n'resolved'.\n\n-- \nCatalin\n"},{"id":"63740","messageId":"b0943d9e0712190219oa6ebe5bk321f090e4fe0469a@mail.gmail.com","threadId":"11288","inReplyTo":"87bq8nkoma.fsf@lysator.liu.se","subject":"Re: kha/safe and kha/experimental updated","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-12-19T10:19:23Z","receivedAt":"2007-12-19T10:19:23Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 19/12/2007, David Kågedal <davidk@lysator.liu.se> wrote:\n> \"Catalin Marinas\" <catalin.marinas@gmail.com> writes:\n> > I'd also like to re-add the stgit.keeporig option and additional\n> > functionality so that the *.{ancestor,current,patched} can be left in\n> > the working tree. Some people might use them when manually fixing\n> > conflicts (I have a look at them from time to time when the emacs +\n> > ediff shows a hard to understand conflict).\n>\n> Since all the information is in git, it is of course easy to recreate\n> it. But the important question to ask is: how do you use these extra\n> files? git.el provides a way to diff against both parent versions, and\n> maybe that is actually what you need.\n>\n> I don't mind that you want these files, but they are mostly clutter to\n> me.\n\nYou can set stgit.keeporig to 'no' if you don't want these files.\n\nFor people not using emacs + git.el, the files might be useful. As you\nsaid, you could use 'git diff -2/-3' but, in various occasions I just\nwanted to copy a block of code from one of the checked-out stages.\nWithout this feature, I would have to use plain git and remember what\nstage corresponds to my patch.\n\nNote that there are other users (apart from me) that use StGIT almost\nexclusively. I really don't like forcing them to use more and more\nplain git commands (at some point, they might even discover 'git\nrebase -i' to be good enough and give up on StGIT :-)).\n\n-- \nCatalin\n"},{"id":"63741","messageId":"200712191144.59747.jnareb@gmail.com","threadId":"11288","inReplyTo":"20071219093816.GB4361@diana.vm.bytemark.co.uk","subject":"Re: kha/safe and kha/experimental updated","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-12-19T10:44:57Z","receivedAt":"2007-12-19T10:44:57Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Wed, 19 Dec 2007, Karl Hasselström wrote:\n> On 2007-12-18 08:39:52 -0800, Jakub Narebski wrote:\n> > \"Catalin Marinas\" <catalin.marinas@gmail.com> writes:\n> >\n> > > On 18/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> > >\n> > > >       Remove \"stg resolved\"\n> > >\n> > > I'd like to keep this command. git-mergetool doesn't support the\n> > > tool I use (emacs + ediff and more stgit-specific file extensions\n> > > like current, patch etc.). I also don't find 'git add' to be\n> > > meaningful for marking a conflict as solved.\n> >\n> > I also would like to have this command kept (and shown in 'stg\n> > help'!). Contrary to 'git add' it can check and add to index /\n> > update index only for files with conflict; we have -r\n> > (ancestor|current|patched) to choose one side, and we could add\n> > --check to check if there are no conflict markers with files (useful\n> > with -a/--all).\n> \n> This too sounds like stuff that could profitably be added to \"git\n> add\". Except for the ancestor/current/patched words, it is not\n> specific to patch stacks, so the implementation should be in git and\n> not in stg.\n\nNo it cannot, at least the '-r (ancestor|current|patched)' part for\nresetting file to given version, even if we change the wording to\nancestor, ours and theirs. The git-add command is about adding contents, \nwhich updates index, which almost as a intended side-effect clears \nmerge state, i.e. stages; and not about resetting to stage.\n\nBesides with \"stg resolved\" you can update index _only_ for files\nwhich were in the conflict, also for -a/--all, and not all the files\nnot only those which were in the conflict like \"git add -u\" does.\n\n\"stg resolved --check\" could happily ignore things that only look\nlike conflict markers, but must have been intended, because they are\nin files not in conflict.\n\n\nUnless you are talking about adding \"resolve\"/\"resolved\" command\nto git-core, as a porcelain wrapper around git-update-index, like\n\"git add\"...\n\n\nP.S. I have just noticed that 'git-checkout' [<tree-ish>] <paths>...\nform of operation is not documented; you can derive what it do\nonly from examples.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"63743","messageId":"20071219112035.GA5565@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"b0943d9e0712190209y485bc2f8w806bd2cad309e74b@mail.gmail.com","subject":"Re: kha/safe and kha/experimental updated","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-19T11:20:35Z","receivedAt":"2007-12-19T11:20:35Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-19 10:09:40 +0000, Catalin Marinas wrote:\n\n> For the 'status --reset', I'll keep it if we have a separate\n> 'resolved' command.\n\n?\n\n> In the past, StGIT only used the core git functionality and stayed\n> away from the porcelain scripts. We now started to use some of the\n> built-in commands more and more and I think it is fine but the git\n> scripts look more volatile to me than the C code (look at the many\n> variants the git merging went through, from shell scripts to python\n> and only now seems to be stabilised with the recursive merge as a\n> built-in command).\n\nHmm? Have we started to use more porcelain lately?\n\n> Adding the functionality I need to git-mergetool would also mean\n> always using the latest GIT with StGIT.\n\nIt wouldn't keep being the latest git version, though.\n\n> Anyway, if you like git-mergetool, I think you can easily change the\n> StGIT configuration to\n\nI don't use interactive merging at all. What I wanted was to get rid\nof StGit's own interactive merging.\n\n> On 19/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n>\n> > On 2007-12-18 16:09:24 +0000, Catalin Marinas wrote:\n> >\n> > > I also don't find 'git add' to be meaningful for marking a\n> > > conflict as solved.\n> >\n> > So maybe let \"stg resolved\" be an alias for \"git add\"?\n>\n> It's not a simple alias, if you use 'stg resolved -a'. Now, if we\n> allow stgit.keeporig, it needs even more functionality.\n\nHmm, yes.\n\n(I still don't quite like it, because I think that if there's anything\nthat \"stg resolved\" does that \"git add\" can't do, then \"git add\"\nshould learn to do it. But until it has learned it, it's a\nhypothetical argument.)\n\n> > I think it'd be more productive to let stg do one thing -- patch\n> > stacks -- and do it well, and rely on git for everything else.\n>\n> In principle, yes, but I have some minor problems with the UI of GIT\n> (like resolved == add). I think there is also a fundamental\n> difference between 'git commit' and 'stg refresh'. The former\n> requires explicit marking of the files to commit (or use the -a\n> option) while the latter always adds all the local changes to the\n> current patch. Maybe GIT users are more used to running 'git add'\n> after fixing a conflict but I use StGIT almost exclusively.\n\nSo you want StGit to do two things: patch stacks, and fix some git UI\nwarts. Hey, I can live with that. :-) But I firmly believe that the\nwart fixing parts of StGit should be (1) optional, so that the same\njob can easily be done with just git; and (2) as thin as possible, to\nmake them easy to explain in terms of git, and cheap to maintain.\n\n> > Of course, if stuff like \"stg add\" and \"stg resolved\" are really\n> > implemented as three-line wrappers around git commands, we don't\n> > have that problem.\n>\n> For add/rm/cp, they should just be a generic wrapper which doesn't\n> even parse the command line options.\n\nOK.\n\n> That's not the case with 'resolved'.\n\nNo, I see.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63750","messageId":"20071219114021.GB5565@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"200712191144.59747.jnareb@gmail.com","subject":"Re: kha/safe and kha/experimental updated","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-19T11:40:21Z","receivedAt":"2007-12-19T11:40:21Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-19 11:44:57 +0100, Jakub Narebski wrote:\n\n> On Wed, 19 Dec 2007, Karl Hasselström wrote:\n>\n> > On 2007-12-18 08:39:52 -0800, Jakub Narebski wrote:\n> >\n> > > I also would like to have this command kept (and shown in 'stg\n> > > help'!). Contrary to 'git add' it can check and add to index /\n> > > update index only for files with conflict; we have -r\n> > > (ancestor|current|patched) to choose one side, and we could add\n> > > --check to check if there are no conflict markers with files\n> > > (useful with -a/--all).\n> >\n> > This too sounds like stuff that could profitably be added to \"git\n> > add\". Except for the ancestor/current/patched words, it is not\n> > specific to patch stacks, so the implementation should be in git\n> > and not in stg.\n>\n> No it cannot, at least the '-r (ancestor|current|patched)' part for\n> resetting file to given version, even if we change the wording to\n> ancestor, ours and theirs. The git-add command is about adding\n> contents, which updates index, which almost as a intended\n> side-effect clears merge state, i.e. stages; and not about resetting\n> to stage.\n\n  git checkout-index --stage=1|2|3 <filename>\n\ndoes what you want. But \"git cat-file\" knows this handy syntax for\ngetting at particular index stages:\n\n  :stage:<filename>\n\nIt would be very convenient to be able to do\n\n  git checkout :stage:<filename>\n\nbut it doesn't seem to work currently. Does anyone know the \"best\" way\nof manually checking out a particular index stage in git?\n\n> Besides with \"stg resolved\" you can update index _only_ for files\n> which were in the conflict, also for -a/--all, and not all the files\n> not only those which were in the conflict like \"git add -u\" does.\n\nThis sounds like a straightforward addition to \"git add\".\n\n> \"stg resolved --check\" could happily ignore things that only look\n> like conflict markers, but must have been intended, because they are\n> in files not in conflict.\n\ngit knows about conflicting files too.\n\n> Unless you are talking about adding \"resolve\"/\"resolved\" command to\n> git-core, as a porcelain wrapper around git-update-index, like \"git\n> add\"...\n\nYes, that's what I want. You and others like what \"stg resolved\" does,\nbut I don't want it in StGit because it's a generic git enhancement\nthat has nothing to with patch stacks. People who don't use StGit\nwould presumably like it as well.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63751","messageId":"b0943d9e0712190340p23341dd8lb9ebbbce9b29cb8e@mail.gmail.com","threadId":"11288","inReplyTo":"20071219112035.GA5565@diana.vm.bytemark.co.uk","subject":"Re: kha/safe and kha/experimental updated","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-12-19T11:40:41Z","receivedAt":"2007-12-19T11:40:41Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 19/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> On 2007-12-19 10:09:40 +0000, Catalin Marinas wrote:\n>\n> > For the 'status --reset', I'll keep it if we have a separate\n> > 'resolved' command.\n>\n> ?\n\nIt needs to call the resolved_all to remove checked-out stages if\nstgit.keeporig == 'yes'. Maybe it could also do some sanity check if\nHEAD != top. With 'git reset --hard', people might easily add an\nargument and break the whole stack.\n\n> > In the past, StGIT only used the core git functionality and stayed\n> > away from the porcelain scripts. We now started to use some of the\n> > built-in commands more and more and I think it is fine but the git\n> > scripts look more volatile to me than the C code (look at the many\n> > variants the git merging went through, from shell scripts to python\n> > and only now seems to be stabilised with the recursive merge as a\n> > built-in command).\n>\n> Hmm? Have we started to use more porcelain lately?\n\nI think Yann was complaining about using git-show since it looks more\nlike a porcelain command.\n\n> > Adding the functionality I need to git-mergetool would also mean\n> > always using the latest GIT with StGIT.\n>\n> It wouldn't keep being the latest git version, though.\n\nYes, but at least initially it should be pretty recent.\n\n> > Anyway, if you like git-mergetool, I think you can easily change the\n> > StGIT configuration to\n>\n> I don't use interactive merging at all. What I wanted was to get rid\n> of StGit's own interactive merging.\n\nI use it quite often and I even invoke it automatically\n(stgit.autoimerge). I'll push some patches tonight together with most\nof your safe branch and we can alter them afterwards.\n\n> So you want StGit to do two things: patch stacks, and fix some git UI\n> warts. Hey, I can live with that. :-) But I firmly believe that the\n> wart fixing parts of StGit should be (1) optional, so that the same\n> job can easily be done with just git; and (2) as thin as possible, to\n> make them easy to explain in terms of git, and cheap to maintain.\n\nUnless you need the keeporig functionality, you can now always use\nplain git for solving merges, add/rm/cp, 'reset --hard' etc. At some\npoint, we could make it safe for 'git rebase' but I think we need the\nDAG patches.\n\n> > That's not the case with 'resolved'.\n>\n> No, I see.\n\nAs I said, if you don't need keeporig, just use git-add (or stg-add\nwhen I'll add the alias).\n\n-- \nCatalin\n"},{"id":"63753","messageId":"b0943d9e0712190347k30971ef1tfd0457589e140542@mail.gmail.com","threadId":"11288","inReplyTo":"20071219114021.GB5565@diana.vm.bytemark.co.uk","subject":"Re: kha/safe and kha/experimental updated","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-12-19T11:47:17Z","receivedAt":"2007-12-19T11:47:17Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 19/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> You and others like what \"stg resolved\" does,\n> but I don't want it in StGit because it's a generic git enhancement\n> that has nothing to with patch stacks. People who don't use StGit\n> would presumably like it as well.\n\nThe --reset option would never be added to git, at least not with the\nsame name for arguments since git doesn't manage patches. As I said, I\nwould have to remember what stage my 'patched' file is in.\n\n-- \nCatalin\n"},{"id":"63760","messageId":"20071219121023.GA6272@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"b0943d9e0712190340p23341dd8lb9ebbbce9b29cb8e@mail.gmail.com","subject":"Re: kha/safe and kha/experimental updated","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-19T12:10:23Z","receivedAt":"2007-12-19T12:10:23Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-19 11:40:41 +0000, Catalin Marinas wrote:\n\n> On 19/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n>\n> > On 2007-12-19 10:09:40 +0000, Catalin Marinas wrote:\n> >\n> > > For the 'status --reset', I'll keep it if we have a separate\n> > > 'resolved' command.\n> >\n> > ?\n>\n> It needs to call the resolved_all to remove checked-out stages if\n> stgit.keeporig == 'yes'.\n\nAh, right.\n\n> Maybe it could also do some sanity check if HEAD != top. With 'git\n> reset --hard', people might easily add an argument and break the\n> whole stack.\n\nTrue.\n\n> > Hmm? Have we started to use more porcelain lately?\n>\n> I think Yann was complaining about using git-show since it looks\n> more like a porcelain command.\n\nWe should probably use cat-file or something instead.\n\n> > It wouldn't keep being the latest git version, though.\n>\n> Yes, but at least initially it should be pretty recent.\n\n:-)\n\n> > I don't use interactive merging at all. What I wanted was to get\n> > rid of StGit's own interactive merging.\n>\n> I use it quite often and I even invoke it automatically\n> (stgit.autoimerge). I'll push some patches tonight together with\n> most of your safe branch and we can alter them afterwards.\n\nJolly good! My stack was getting unwieldy ...\n\n> > So you want StGit to do two things: patch stacks, and fix some git\n> > UI warts. Hey, I can live with that. :-) But I firmly believe that\n> > the wart fixing parts of StGit should be (1) optional, so that the\n> > same job can easily be done with just git; and (2) as thin as\n> > possible, to make them easy to explain in terms of git, and cheap\n> > to maintain.\n>\n> Unless you need the keeporig functionality, you can now always use\n> plain git for solving merges, add/rm/cp, 'reset --hard' etc.\n\nYes, with David's conflict series.\n\n> At some point, we could make it safe for 'git rebase' but I think we\n> need the DAG patches.\n\nI wouldn't resurrect the DAG patches for this; I'd just invoke \"stg\nrepair\" automatically when we detect that top != HEAD.\n\nBut I think that for \"git rebase\", we'd want to teach \"repair\" to\ndetect that the patches' commits have been changed, rather than just\nmarking them unapplied.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63773","messageId":"b0943d9e0712190659p6c4cb557jae5b21aa68de029d@mail.gmail.com","threadId":"11288","inReplyTo":"20071218052115.GA13422@diana.vm.bytemark.co.uk","subject":"Re: kha/safe and kha/experimental updated","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-12-19T14:59:20Z","receivedAt":"2007-12-19T14:59:20Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 18/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n>   git://repo.or.cz/stgit/kha.git safe\n[...]\n>       Ask git about unmerged files\n\nThis patch wrongly assumes that there is a stage 2 entry in the index.\nTest t1202-push-undo.sh fails because a file is added, differently, in\nboth master and patch but it doesn't exist in ancestor (no stage 2).\nUsing stage 3 doesn't fix it either because a patch might remove a\nfile.\n\nI fixed it by using a set to get the unique names.\n\n-- \nCatalin\n"},{"id":"63775","messageId":"b0943d9e0712190738o66005233v1ee908427ae619b8@mail.gmail.com","threadId":"11288","inReplyTo":"b0943d9e0712180809l4d2d01b8j32ab2a410885cc5e@mail.gmail.com","subject":"Re: kha/safe and kha/experimental updated","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-12-19T15:38:28Z","receivedAt":"2007-12-19T15:38:28Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 18/12/2007, Catalin Marinas <catalin.marinas@gmail.com> wrote:\n> On 18/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> >       Fix \"stg resolved\" to work with new conflict representation\n>\n> For some reason, the interactive resolving keeps invoking the merger.\n> I'll have a look.\n\nI found the problem. git.ls_files() now returns all three stages if\nthere was a conflict and the file list got longer. I added a set to\nremove the duplicates.\n\n-- \nCatalin\n"},{"id":"63776","messageId":"87y7bqk82s.fsf@lysator.liu.se","threadId":"11288","inReplyTo":"b0943d9e0712190659p6c4cb557jae5b21aa68de029d@mail.gmail.com","subject":"Re: kha/safe and kha/experimental updated","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-19T15:39:07Z","receivedAt":"2007-12-19T15:39:07Z","isPatch":false,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"\"Catalin Marinas\" <catalin.marinas@gmail.com> writes:\n\n> On 18/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n>>   git://repo.or.cz/stgit/kha.git safe\n> [...]\n>>       Ask git about unmerged files\n>\n> This patch wrongly assumes that there is a stage 2 entry in the index.\n> Test t1202-push-undo.sh fails because a file is added, differently, in\n> both master and patch but it doesn't exist in ancestor (no stage 2).\n> Using stage 3 doesn't fix it either because a patch might remove a\n> file.\n>\n> I fixed it by using a set to get the unique names.\n\nThat sounds reasonable.\n\n-- \nDavid Kågedal\n"},{"id":"63778","messageId":"200712191723.29591.jnareb@gmail.com","threadId":"11288","inReplyTo":"20071219114021.GB5565@diana.vm.bytemark.co.uk","subject":"Re: kha/safe and kha/experimental updated","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-12-19T16:23:27Z","receivedAt":"2007-12-19T16:23:27Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Karl Hasselström wrote:\n> On 2007-12-19 11:44:57 +0100, Jakub Narebski wrote:\n>> On Wed, 19 Dec 2007, Karl Hasselström wrote:\n>>> On 2007-12-18 08:39:52 -0800, Jakub Narebski wrote:\n>>>\n>>>> I also would like to have this command kept (and shown in 'stg\n>>>> help'!). Contrary to 'git add' it can check and add to index /\n>>>> update index only for files with conflict; we have -r\n>>>> (ancestor|current|patched) to choose one side, and we could add\n>>>> --check to check if there are no conflict markers with files\n>>>> (useful with -a/--all).\n>>>\n>>> This too sounds like stuff that could profitably be added to \"git\n>>> add\". Except for the ancestor/current/patched words, it is not\n>>> specific to patch stacks, so the implementation should be in git\n>>> and not in stg.\n>>\n>> No it cannot, at least the '-r (ancestor|current|patched)' part for\n>> resetting file to given version, even if we change the wording to\n>> ancestor, ours and theirs. The git-add command is about adding\n>> contents, which updates index, which almost as a intended\n>> side-effect clears merge state, i.e. stages; and not about resetting\n>> to stage.\n> \n>   git checkout-index --stage=1|2|3 <filename>\n> \n> does what you want. But \"git cat-file\" knows this handy syntax for\n> getting at particular index stages:\n> \n>   :stage:<filename>\n\nI always forget which stage is which. It would be nice if \ngit-checkout-index implemented human-friendly names, just like \ngit-diff-files has --base, --ours, --theirs, i.e. if it would be \npossible to write\n\n  git checkout-index --stage=base|ours|theirs <filename>\n\nand perhaps even\n\n  :base|ours|theirs:<filename>.\n\n(but there is a problem with files containing ':'...).\n\n> It would be very convenient to be able to do\n> \n>   git checkout :stage:<filename>\n> \n> but it doesn't seem to work currently. Does anyone know the \"best\" way\n> of manually checking out a particular index stage in git?\n\nIt's a pity it doesn't work. Or if not this, then perhaps\n\n  git checkout --stage=ours -- <filename>\n\n>> Besides with \"stg resolved\" you can update index _only_ for files\n>> which were in the conflict, also for -a/--all, and not all the files\n>> not only those which were in the conflict like \"git add -u\" does.\n> \n> This sounds like a straightforward addition to \"git add\".\n> \n>> \"stg resolved --check\" could happily ignore things that only look\n>> like conflict markers, but must have been intended, because they are\n>> in files not in conflict.\n> \n> git knows about conflicting files too.\n> \n>> Unless you are talking about adding \"resolve\"/\"resolved\" command to\n>> git-core, as a porcelain wrapper around git-update-index, like \"git\n>> add\"...\n> \n> Yes, that's what I want. You and others like what \"stg resolved\" does,\n> but I don't want it in StGit because it's a generic git enhancement\n> that has nothing to with patch stacks. People who don't use StGit\n> would presumably like it as well.\n\nYou mean adding another option to git-add, similar to '-u' option, but\nupdating only the files which were (are) in merge conflict; \n'-c'/'-r'/'-s' perhaps? This would be replacement for \n\"stg resolved --all\", wouldn't it (and with filename replacement for \n\"stg resolved <filename>\", of course)?\n\n\nP.S. Sidenote: it would be nice if git-mergetool was updated to \nunderstand StGIT style interactive 2-way and 3-way merge configuration,\nand not offer only limited choice of pre-defined interactive merge tools \n(although pre-defined are nice, too).\n\n-- \nJakub Narebski\nPoland\n"},{"id":"63780","messageId":"b0943d9e0712190902r2000c1ebob2303b32d1b948b8@mail.gmail.com","threadId":"11288","inReplyTo":"200712191723.29591.jnareb@gmail.com","subject":"Re: kha/safe and kha/experimental updated","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-12-19T17:02:02Z","receivedAt":"2007-12-19T17:02:02Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 19/12/2007, Jakub Narebski <jnareb@gmail.com> wrote:\n> Karl Hasselström wrote:\n> > On 2007-12-19 11:44:57 +0100, Jakub Narebski wrote:\n> >> On Wed, 19 Dec 2007, Karl Hasselström wrote:\n> >>> On 2007-12-18 08:39:52 -0800, Jakub Narebski wrote:\n> >>>\n> >>>> I also would like to have this command kept (and shown in 'stg\n> >>>> help'!). Contrary to 'git add' it can check and add to index /\n> >>>> update index only for files with conflict; we have -r\n> >>>> (ancestor|current|patched) to choose one side, and we could add\n> >>>> --check to check if there are no conflict markers with files\n> >>>> (useful with -a/--all).\n> >>>\n> >>> This too sounds like stuff that could profitably be added to \"git\n> >>> add\". Except for the ancestor/current/patched words, it is not\n> >>> specific to patch stacks, so the implementation should be in git\n> >>> and not in stg.\n> >>\n> >> No it cannot, at least the '-r (ancestor|current|patched)' part for\n> >> resetting file to given version, even if we change the wording to\n> >> ancestor, ours and theirs. The git-add command is about adding\n> >> contents, which updates index, which almost as a intended\n> >> side-effect clears merge state, i.e. stages; and not about resetting\n> >> to stage.\n> >\n> >   git checkout-index --stage=1|2|3 <filename>\n> >\n> > does what you want. But \"git cat-file\" knows this handy syntax for\n> > getting at particular index stages:\n> >\n> >   :stage:<filename>\n>\n> I always forget which stage is which. It would be nice if\n> git-checkout-index implemented human-friendly names, just like\n> git-diff-files has --base, --ours, --theirs, i.e. if it would be\n> possible to write\n>\n>   git checkout-index --stage=base|ours|theirs <filename>\n\nThis gets even more confusing with StGIT. For plain git, after a git\nmerge or pull conflict, 'theirs' is stage 3. With StGIT, we first\nadvance the base of the stack and merge the patches onto it, in which\ncase the 'patched' (which I would normally call 'ours' rather than\n'theirs') is 3.\n\n-- \nCatalin\n"},{"id":"63781","messageId":"87tzmek3ns.fsf@lysator.liu.se","threadId":"11288","inReplyTo":"b0943d9e0712190902r2000c1ebob2303b32d1b948b8@mail.gmail.com","subject":"Re: kha/safe and kha/experimental updated","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-19T17:14:31Z","receivedAt":"2007-12-19T17:14:31Z","isPatch":false,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"\"Catalin Marinas\" <catalin.marinas@gmail.com> writes:\n\n>> I always forget which stage is which. It would be nice if\n>> git-checkout-index implemented human-friendly names, just like\n>> git-diff-files has --base, --ours, --theirs, i.e. if it would be\n>> possible to write\n>>\n>>   git checkout-index --stage=base|ours|theirs <filename>\n>\n> This gets even more confusing with StGIT. For plain git, after a git\n> merge or pull conflict, 'theirs' is stage 3. With StGIT, we first\n> advance the base of the stack and merge the patches onto it, in which\n> case the 'patched' (which I would normally call 'ours' rather than\n> 'theirs') is 3.\n\nTrue. And the same problem obviously exists for \"git rebase\".\n\n-- \nDavid Kågedal\n"},{"id":"63782","messageId":"20071219171434.GA10652@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"200712191723.29591.jnareb@gmail.com","subject":"Re: kha/safe and kha/experimental updated","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-19T17:14:34Z","receivedAt":"2007-12-19T17:14:34Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-19 17:23:27 +0100, Jakub Narebski wrote:\n\n> Karl Hasselström wrote:\n>\n> >   git checkout-index --stage=1|2|3 <filename>\n> >\n> > does what you want. But \"git cat-file\" knows this handy syntax for\n> > getting at particular index stages:\n> >\n> >   :stage:<filename>\n>\n> I always forget which stage is which. It would be nice if\n> git-checkout-index implemented human-friendly names, just like\n> git-diff-files has --base, --ours, --theirs, i.e. if it would be\n> possible to write\n>\n>   git checkout-index --stage=base|ours|theirs <filename>\n>\n> and perhaps even\n>\n>   :base|ours|theirs:<filename>.\n>\n> (but there is a problem with files containing ':'...).\n\n<ref>:<path> is already accepted, so I don't think this would be much\nworse.\n\nAnd yes, I agree that the base/ours/theirs aliases are nice, and\nshould be accepted by at least the porcelain commands.\n\n> > Yes, that's what I want. You and others like what \"stg resolved\"\n> > does, but I don't want it in StGit because it's a generic git\n> > enhancement that has nothing to with patch stacks. People who\n> > don't use StGit would presumably like it as well.\n>\n> You mean adding another option to git-add, similar to '-u' option,\n> but updating only the files which were (are) in merge conflict;\n> '-c'/'-r'/'-s' perhaps?\n\nYes. That _is_ the operation you want, isn't it?\n\n> This would be replacement for \"stg resolved --all\", wouldn't it (and\n> with filename replacement for \"stg resolved <filename>\", of course)?\n\nYes. Though with a filename argument, you wouldn't need the new flag.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63805","messageId":"20071219221848.29455.50676.stgit@yoghurt","threadId":"11288","inReplyTo":"20071218092419.GA16029@diana.vm.bytemark.co.uk","subject":"[StGit PATCH 0/2] Make new infrastructure subdirectory safe","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-19T22:19:23Z","receivedAt":"2007-12-19T22:19:23Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"---\n\nKarl Hasselström (2):\n      Make \"stg goto\" subdirectory safe\n      Test that \"stg goto\" can be called from a subdirectory\n\n\n stgit/lib/git.py       |    5 ++--\n stgit/run.py           |    9 +++++--\n t/t2800-goto-subdir.sh |   59 ++++++++++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 68 insertions(+), 5 deletions(-)\n create mode 100755 t/t2800-goto-subdir.sh\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63806","messageId":"20071219221936.29455.99513.stgit@yoghurt","threadId":"11288","inReplyTo":"20071219221848.29455.50676.stgit@yoghurt","subject":"[StGit PATCH 1/2] Test that \"stg goto\" can be called from a subdirectory","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-19T22:19:51Z","receivedAt":"2007-12-19T22:19:51Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"It currently can't; therefore, the tests are marked as known failures.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n t/t2800-goto-subdir.sh |   59 ++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 59 insertions(+), 0 deletions(-)\n create mode 100755 t/t2800-goto-subdir.sh\n\n\ndiff --git a/t/t2800-goto-subdir.sh b/t/t2800-goto-subdir.sh\nnew file mode 100755\nindex 0000000..9f3ab26\n--- /dev/null\n+++ b/t/t2800-goto-subdir.sh\n@@ -0,0 +1,59 @@\n+#!/bin/sh\n+\n+test_description='Run \"stg goto\" in a subdirectory'\n+\n+. ./test-lib.sh\n+\n+test_expect_success 'Initialize StGit stack' '\n+    stg init &&\n+    echo expected1.txt >> .git/info/exclude &&\n+    echo expected2.txt >> .git/info/exclude &&\n+    echo actual.txt >> .git/info/exclude &&\n+    mkdir foo &&\n+    for i in 1 2 3; do\n+        echo foo$i >> foo/bar &&\n+        stg new p$i -m p$i &&\n+        git add foo/bar &&\n+        stg refresh\n+    done\n+'\n+\n+cat > expected1.txt <<EOF\n+foo1\n+EOF\n+cat > expected2.txt <<EOF\n+bar\n+EOF\n+test_expect_failure 'Goto in subdirectory (just pop)' '\n+    (cd foo && stg goto p1) &&\n+    cat foo/bar > actual.txt &&\n+    diff -u expected1.txt actual.txt &&\n+    ls foo > actual.txt &&\n+    diff -u expected2.txt actual.txt\n+'\n+\n+test_expect_success 'Prepare conflicting goto' '\n+    stg delete p2\n+'\n+\n+cat > expected1.txt <<EOF\n+foo1\n+<<<<<<< current:foo/bar\n+=======\n+foo2\n+foo3\n+>>>>>>> patched:foo/bar\n+EOF\n+cat > expected2.txt <<EOF\n+bar\n+EOF\n+test_expect_failure 'Goto in subdirectory (conflicting push)' '\n+    (cd foo && stg goto p3) ;\n+    [ $? -eq 3 ] &&\n+    cat foo/bar > actual.txt &&\n+    diff -u expected1.txt actual.txt &&\n+    ls foo > actual.txt &&\n+    diff -u expected2.txt actual.txt\n+'\n+\n+test_done\n"},{"id":"63807","messageId":"20071219221957.29455.27315.stgit@yoghurt","threadId":"11288","inReplyTo":"20071219221848.29455.50676.stgit@yoghurt","subject":"[StGit PATCH 2/2] Make \"stg goto\" subdirectory safe","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-19T22:24:49Z","receivedAt":"2007-12-19T22:24:49Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"This is not specific to \"stg goto\" -- it affects all commands that use\nthe new infrastructure. (But of those, only goto and coalesce were\nsubdirectory unsafe.)\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\nOn 2007-12-18 10:24:19 +0100, Karl Hasselström wrote:\n\n> On 2007-12-18 09:11:00 +0000, Catalin Marinas wrote:\n> \n> > On 17/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> >\n> > > Be careful about merging past the \"goto\" patch -- I'm pretty\n> > > sure it breaks when called from a subdirectory, and I don't have\n> > > time to fix that right now. (It should be a clean fix, though --\n> > > just adjust the cwd for precisely those git subprocesses that\n> > > need it, which is very few. I think.)\n> >\n> > Why not just change the cwd when the command starts and it should\n> > be safe for all the git subprocesses.\n> \n> It doesn't feel very clean to require the caller of some unspecified\n> subset of git calls to remember to set the correct piece of global\n> state.\n> \n> And the correct solution should really be very simple, since it's\n> precisely the worktree operations (specifically, the subset thereof\n> that have to operate on the whole tree) that require setting cwd.\n> And those are very clearly separated out from the rest in the new\n> infrastructure.\n\nAnd here it is! Note that not counting the cwd support in run.py and\nchanging the test to expect success, I had to change just three lines\nto fix this problem for _all_ \"new infrastructure\" commands. And no\nunintended side effects, since the cwd is changed only where it's\nnecessary.\n\n stgit/lib/git.py       |    5 +++--\n stgit/run.py           |    9 ++++++---\n t/t2800-goto-subdir.sh |    4 ++--\n 3 files changed, 11 insertions(+), 7 deletions(-)\n\n\ndiff --git a/stgit/lib/git.py b/stgit/lib/git.py\nindex 6aba966..118c9b2 100644\n--- a/stgit/lib/git.py\n+++ b/stgit/lib/git.py\n@@ -344,6 +344,7 @@ class Worktree(object):\n     def __init__(self, directory):\n         self.__directory = directory\n     env = property(lambda self: { 'GIT_WORK_TREE': self.__directory })\n+    directory = property(lambda self: self.__directory)\n \n class CheckoutException(exception.StgException):\n     pass\n@@ -364,7 +365,7 @@ class IndexAndWorktree(RunWithEnv):\n             self.run(['git', 'read-tree', '-u', '-m',\n                       '--exclude-per-directory=.gitignore',\n                       old_tree.sha1, new_tree.sha1]\n-                     ).discard_output()\n+                     ).cwd(self.__worktree.directory).discard_output()\n         except run.RunException:\n             raise CheckoutException('Index/workdir dirty')\n     def merge(self, base, ours, theirs):\n@@ -377,7 +378,7 @@ class IndexAndWorktree(RunWithEnv):\n                      env = { 'GITHEAD_%s' % base.sha1: 'ancestor',\n                              'GITHEAD_%s' % ours.sha1: 'current',\n                              'GITHEAD_%s' % theirs.sha1: 'patched'}\n-                     ).discard_output()\n+                     ).cwd(self.__worktree.directory).discard_output()\n         except run.RunException, e:\n             raise MergeException('Index/worktree dirty')\n     def changed_files(self):\ndiff --git a/stgit/run.py b/stgit/run.py\nindex 78537db..77f2e65 100644\n--- a/stgit/run.py\n+++ b/stgit/run.py\n@@ -42,7 +42,7 @@ class Run:\n             if type(c) != str:\n                 raise Exception, 'Bad command: %r' % (cmd,)\n         self.__good_retvals = [0]\n-        self.__env = None\n+        self.__env = self.__cwd = None\n         self.__indata = None\n         self.__discard_stderr = False\n     def __log_start(self):\n@@ -67,7 +67,7 @@ class Run:\n         \"\"\"Run with captured IO.\"\"\"\n         self.__log_start()\n         try:\n-            p = subprocess.Popen(self.__cmd, env = self.__env,\n+            p = subprocess.Popen(self.__cmd, env = self.__env, cwd = self.__cwd,\n                                  stdin = subprocess.PIPE,\n                                  stdout = subprocess.PIPE,\n                                  stderr = subprocess.PIPE)\n@@ -85,7 +85,7 @@ class Run:\n         assert self.__indata == None\n         self.__log_start()\n         try:\n-            p = subprocess.Popen(self.__cmd, env = self.__env)\n+            p = subprocess.Popen(self.__cmd, env = self.__env, cwd = self.__cwd)\n             self.exitcode = p.wait()\n         except OSError, e:\n             raise self.exc('%s failed: %s' % (self.__cmd[0], e))\n@@ -104,6 +104,9 @@ class Run:\n         self.__env = dict(os.environ)\n         self.__env.update(env)\n         return self\n+    def cwd(self, cwd):\n+        self.__cwd = cwd\n+        return self\n     def raw_input(self, indata):\n         self.__indata = indata\n         return self\ndiff --git a/t/t2800-goto-subdir.sh b/t/t2800-goto-subdir.sh\nindex 9f3ab26..fcad7da 100755\n--- a/t/t2800-goto-subdir.sh\n+++ b/t/t2800-goto-subdir.sh\n@@ -24,7 +24,7 @@ EOF\n cat > expected2.txt <<EOF\n bar\n EOF\n-test_expect_failure 'Goto in subdirectory (just pop)' '\n+test_expect_success 'Goto in subdirectory (just pop)' '\n     (cd foo && stg goto p1) &&\n     cat foo/bar > actual.txt &&\n     diff -u expected1.txt actual.txt &&\n@@ -47,7 +47,7 @@ EOF\n cat > expected2.txt <<EOF\n bar\n EOF\n-test_expect_failure 'Goto in subdirectory (conflicting push)' '\n+test_expect_success 'Goto in subdirectory (conflicting push)' '\n     (cd foo && stg goto p3) ;\n     [ $? -eq 3 ] &&\n     cat foo/bar > actual.txt &&\n"},{"id":"63808","messageId":"20071219222820.GA15119@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"20071219221848.29455.50676.stgit@yoghurt","subject":"Re: [StGit PATCH 0/2] Make new infrastructure subdirectory safe","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-19T22:28:20Z","receivedAt":"2007-12-19T22:28:20Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-19 23:19:23 +0100, Karl Hasselström wrote:\n\n> Karl Hasselström (2):\n>       Make \"stg goto\" subdirectory safe\n>       Test that \"stg goto\" can be called from a subdirectory\n\nI forgot to say, but this goes on top of kha/experimental. The test\nmakes use of the \"return exit code 3 when there was conflicts\" patch\nto make sure that there was a conflict and not another error.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63810","messageId":"20071219224638.GB15119@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"20071219221957.29455.27315.stgit@yoghurt","subject":"kha/safe updated","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-19T22:46:38Z","receivedAt":"2007-12-19T22:46:38Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-19 23:24:49 +0100, Karl Hasselström wrote:\n\n> And here it is!\n\nAnd with that, I don't see any reason to not recommend that you pull\nevery patch I have. Which is:\n\nThe following changes since commit 5be69cd8d89bd89be31364e9c0fd9e947b6ef644:\n  Karl Hasselström (1):\n        Name the exit codes to improve legibility\n\nare available in the git repository at:\n\n  git://repo.or.cz/stgit/kha.git safe\n\nDavid Kågedal (19):\n      Add an StGit mode for emacs\n      Emacs mode: Improve the output buffer state\n      Emacs mode: Bind n and p\n      Emacs mode: add stgit-repair\n      Emacs mode: added stgit-commit and stgit-uncommit\n      Emacs mode: Add stgit-edit command\n      Emacs mode: added fontification\n      Emacs mode: Added stgit-new\n      Check bottom and invariants\n      Remove the 'bottom' field\n      Remove the 'top' field\n      Split git.merge into two functions\n      Leave working dir and index alone after failed (conflicting) push\n      Added a test case to check what happens when push finds a conflict\n      Simplify merge_recursive\n      Use the output from merge-recursive to list conflicts\n      Ask git about unmerged files\n      Emacs mode: Add mark command\n      Emacs mode: coalesce command\n\nKarl Hasselström (36):\n      Emacs mode: Show keybindings when user presses \"h\" or \"?\"\n      Emacs mode: Add an explanatory header\n      Emacs mode: Makefile for building stgit.el\n      Emacs mode: push/pop next patch, not patch at point\n      Emacs mode: Let \"P\" push or pop patch at point\n      Emacs mode: Bind \"G\" to \"stg goto\"\n      Emacs mode: show patches' short description\n      Write removed fields for backwards compatibility\n      Nicer conflict markers\n      Better error message if merge fails\n      Fix \"stg resolved\" to work with new conflict representation\n      Refactoring: pass more than one file to resolved()\n      We keep the different stages of a conflict in the index now\n      \"stg status --reset\" is not needed anymore\n      Remove \"stg add\"\n      Remove \"stg rm\"\n      Remove \"stg cp\"\n      Remove \"stg resolved\"\n      New StGit core infrastructure: repository operations\n      Write metadata files used by the old infrastructure\n      Upgrade older stacks to newest version\n      Let \"stg clean\" use the new infrastructure\n      Add \"stg coalesce\"\n      Let \"stg applied\" and \"stg unapplied\" use the new infrastructure\n      Teach the new infrastructure about the index and worktree\n      Let \"stg clean\" use the new transaction primitives\n      Let \"stg goto\" use the new infrastructure\n      Convert \"stg uncommit\" to the new infrastructure\n      New infrastructure: Make sure that the branch is initialized\n      Expose transaction abort function\n      stg coalesce: Support --file and --save-template\n      Set exit code to 3 on merge conflict\n      Convert \"stg commit\" to new infrastructure\n      Make \"stg commit\" fancier\n      Test that \"stg goto\" can be called from a subdirectory\n      Make \"stg goto\" subdirectory safe\n\n Documentation/stg-cp.txt      |   63 -------\n Documentation/stg.txt         |    2 -\n Documentation/tutorial.txt    |   31 ++--\n contrib/Makefile              |   19 ++\n contrib/stgit-completion.bash |    4 +-\n contrib/stgit.el              |  377 +++++++++++++++++++++++++++++++++++++++\n examples/gitconfig            |   19 +--\n setup.py                      |    2 +-\n stgit/commands/add.py         |   44 -----\n stgit/commands/applied.py     |   27 ++--\n stgit/commands/clean.py       |   49 ++----\n stgit/commands/coalesce.py    |  122 +++++++++++++\n stgit/commands/commit.py      |  111 ++++++++-----\n stgit/commands/common.py      |   39 ++---\n stgit/commands/copy.py        |   45 -----\n stgit/commands/goto.py        |   52 ++----\n stgit/commands/pick.py        |    2 +-\n stgit/commands/resolved.py    |   94 ----------\n stgit/commands/rm.py          |   48 -----\n stgit/commands/status.py      |   31 ++--\n stgit/commands/sync.py        |    1 -\n stgit/commands/unapplied.py   |   23 ++--\n stgit/commands/uncommit.py    |   81 ++++-----\n stgit/config.py               |    1 -\n stgit/git.py                  |   75 +++++---\n stgit/gitmergeonefile.py      |   97 +----------\n stgit/lib/__init__.py         |   18 ++\n stgit/lib/git.py              |  388 +++++++++++++++++++++++++++++++++++++++++\n stgit/lib/stack.py            |  176 +++++++++++++++++++\n stgit/lib/stackupgrade.py     |   98 +++++++++++\n stgit/lib/transaction.py      |  209 ++++++++++++++++++++++\n stgit/main.py                 |   14 +-\n stgit/run.py                  |   12 +-\n stgit/stack.py                |  156 ++++-------------\n stgit/utils.py                |   25 +++\n t/t0002-status.sh             |   15 +-\n t/t1200-push-modified.sh      |    2 +-\n t/t1202-push-undo.sh          |    6 +-\n t/t1203-push-conflict.sh      |   70 ++++++++\n t/t1204-pop-keep.sh           |    2 +-\n t/t1205-push-subdir.sh        |    8 +-\n t/t1300-uncommit.sh           |   16 +-\n t/t1301-repair.sh             |    2 +-\n t/t1400-patch-history.sh      |    4 +-\n t/t1500-float.sh              |   14 +-\n t/t1600-delete-one.sh         |   12 +-\n t/t1601-delete-many.sh        |    2 +-\n t/t1700-goto-top.sh           |    2 +-\n t/t2000-sync.sh               |   12 +-\n t/t2100-pull-policy-fetch.sh  |    4 +-\n t/t2101-pull-policy-pull.sh   |    4 +-\n t/t2102-pull-policy-rebase.sh |    4 +-\n t/t2300-refresh-subdir.sh     |    2 +-\n t/t2600-coalesce.sh           |   31 ++++\n t/t2800-goto-subdir.sh        |   59 ++++++\n 55 files changed, 1959 insertions(+), 867 deletions(-)\n delete mode 100644 Documentation/stg-cp.txt\n create mode 100644 contrib/Makefile\n create mode 100644 contrib/stgit.el\n delete mode 100644 stgit/commands/add.py\n create mode 100644 stgit/commands/coalesce.py\n delete mode 100644 stgit/commands/copy.py\n delete mode 100644 stgit/commands/resolved.py\n delete mode 100644 stgit/commands/rm.py\n create mode 100644 stgit/lib/__init__.py\n create mode 100644 stgit/lib/git.py\n create mode 100644 stgit/lib/stack.py\n create mode 100644 stgit/lib/stackupgrade.py\n create mode 100644 stgit/lib/transaction.py\n create mode 100755 t/t1203-push-conflict.sh\n create mode 100755 t/t2600-coalesce.sh\n create mode 100755 t/t2800-goto-subdir.sh\n\nkha/experimental points to the same commit as kha/safe, for now.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63813","messageId":"b0943d9e0712191517r6154f6c2g98068c8070275cb3@mail.gmail.com","threadId":"11288","inReplyTo":"20071219224638.GB15119@diana.vm.bytemark.co.uk","subject":"Re: kha/safe updated","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-12-19T23:17:42Z","receivedAt":"2007-12-19T23:17:42Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 19/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> On 2007-12-19 23:24:49 +0100, Karl Hasselström wrote:\n>\n> > And here it is!\n>\n> And with that, I don't see any reason to not recommend that you pull\n> every patch I have. Which is:\n\nPlease rebase again when you have time since I already merged most of\nthis branch and added some patches that might conflict with yours.\n\n-- \nCatalin\n"},{"id":"63816","messageId":"87r6hijmjo.fsf@lysator.liu.se","threadId":"11288","inReplyTo":"20071219224638.GB15119@diana.vm.bytemark.co.uk","subject":"Re: kha/safe updated","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-12-19T23:24:11Z","receivedAt":"2007-12-19T23:24:11Z","isPatch":false,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Karl Hasselström <kha@treskal.com> writes:\n\n> On 2007-12-19 23:24:49 +0100, Karl Hasselström wrote:\n>\n>> And here it is!\n>\n> And with that, I don't see any reason to not recommend that you pull\n> every patch I have. Which is:\n\nThe conflict series of patches from me works for me, but I know that I\ndon't use all the merging features that other users use, so I can't\nguarantee that everything works. But it seems that Catalin has been\nlooking over it, so I guess it's ok.\n\n-- \nDavid Kågedal\n"},{"id":"63818","messageId":"20071219232614.GA16246@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"b0943d9e0712191517r6154f6c2g98068c8070275cb3@mail.gmail.com","subject":"Re: kha/safe updated","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-19T23:26:14Z","receivedAt":"2007-12-19T23:26:14Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-19 23:17:42 +0000, Catalin Marinas wrote:\n\n> On 19/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n>\n> > And with that, I don't see any reason to not recommend that you\n> > pull every patch I have. Which is:\n>\n> Please rebase again when you have time since I already merged most\n> of this branch and added some patches that might conflict with\n> yours.\n\nYou hadn't pushed any of it out when I last checked about two hours\nago ...\n\nWill do, but not tonight. In fact, it may be a few days, I'm afraid.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63819","messageId":"b0943d9e0712191529u5e54eca4rd0ab4ecd73217a7e@mail.gmail.com","threadId":"11288","inReplyTo":"20071219232614.GA16246@diana.vm.bytemark.co.uk","subject":"Re: kha/safe updated","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2007-12-19T23:29:13Z","receivedAt":"2007-12-19T23:29:13Z","isPatch":false,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 19/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> On 2007-12-19 23:17:42 +0000, Catalin Marinas wrote:\n>\n> > On 19/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n> >\n> > > And with that, I don't see any reason to not recommend that you\n> > > pull every patch I have. Which is:\n> >\n> > Please rebase again when you have time since I already merged most\n> > of this branch and added some patches that might conflict with\n> > yours.\n>\n> You hadn't pushed any of it out when I last checked about two hours\n> ago ...\n\nI just pushed the changes a few minutes ago.\n\n> Will do, but not tonight. In fact, it may be a few days, I'm afraid.\n\nNo problem. Anyway, if I don't here from you in the meantime, have a\ngood Christmas :-).\n\n-- \nCatalin\n"},{"id":"63834","messageId":"20071220063812.GA24503@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"87r6hijmjo.fsf@lysator.liu.se","subject":"Re: kha/safe updated","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-20T06:38:12Z","receivedAt":"2007-12-20T06:38:12Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-20 00:24:11 +0100, David Kågedal wrote:\n\n> Karl Hasselström <kha@treskal.com> writes:\n>\n> > And with that, I don't see any reason to not recommend that you\n> > pull every patch I have. Which is:\n>\n> The conflict series of patches from me works for me, but I know that\n> I don't use all the merging features that other users use, so I\n> can't guarantee that everything works. But it seems that Catalin has\n> been looking over it, so I guess it's ok.\n\nI've been running it for quite some time too. And the criteria for\ngetting into kha/stable aren't _that_ onerous: I don't guarantee that\nthere are no bugs, just that the patches seem to be ready for\nwidespread testing.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"63835","messageId":"20071220063955.GB24503@diana.vm.bytemark.co.uk","threadId":"11288","inReplyTo":"b0943d9e0712191529u5e54eca4rd0ab4ecd73217a7e@mail.gmail.com","subject":"Re: kha/safe updated","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-12-20T06:39:55Z","receivedAt":"2007-12-20T06:39:55Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-12-19 23:29:13 +0000, Catalin Marinas wrote:\n\n> On 19/12/2007, Karl Hasselström <kha@treskal.com> wrote:\n>\n> > You hadn't pushed any of it out when I last checked about two\n> > hours ago ...\n>\n> I just pushed the changes a few minutes ago.\n\nSo I guessed. :-)\n\n> > Will do, but not tonight. In fact, it may be a few days, I'm\n> > afraid.\n>\n> No problem. Anyway, if I don't here from you in the meantime, have a\n> good Christmas :-).\n\nYou too! (Or anything else you may prefer to celebrate this time of\nyear.)\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}