[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/add-vdiff c31755a 220/258: vdiff-magit: Port show stash
From: |
Justin Burkett |
Subject: |
[elpa] scratch/add-vdiff c31755a 220/258: vdiff-magit: Port show stash |
Date: |
Wed, 17 May 2017 08:13:57 -0400 (EDT) |
branch: scratch/add-vdiff
commit c31755a6160b643ef93f3517a8adc43280691dca
Author: Justin Burkett <address@hidden>
Commit: Justin Burkett <address@hidden>
vdiff-magit: Port show stash
---
vdiff-magit.el | 106 +++++++++++++++++++++++++--------------------------------
1 file changed, 47 insertions(+), 59 deletions(-)
diff --git a/vdiff-magit.el b/vdiff-magit.el
index 8d8265d..88f562b 100644
--- a/vdiff-magit.el
+++ b/vdiff-magit.el
@@ -62,37 +62,37 @@
;; :group 'magit-ediff
;; :type 'boolean)
-;; (defcustom magit-ediff-show-stash-with-index t
-;; "Whether `magit-ediff-show-stash' shows the state of the index.
+(defcustom vdiff-magit-show-stash-with-index t
+ "Whether `vdiff-magit-show-stash' shows the state of the index.
-;; If non-nil, use a third Ediff buffer to distinguish which changes
-;; in the stash were staged. In cases where the stash contains no
-;; staged changes, fall back to a two-buffer Ediff.
+If non-nil, use a third vdiff buffer to distinguish which changes
+in the stash were staged. In cases where the stash contains no
+staged changes, fall back to a two-buffer vdiff.
-;; More specificaly, a stash is a merge commit, address@hidden, with
-;; potentially three parents.
+More specificaly, a stash is a merge commit, address@hidden, with
+potentially three parents.
-;; * address@hidden represents the HEAD commit at the time the stash
-;; was created.
+* address@hidden represents the HEAD commit at the time the stash
+ was created.
-;; * address@hidden records any changes that were staged when the stash
-;; was made.
+* address@hidden records any changes that were staged when the stash
+ was made.
-;; * address@hidden, if it exists, contains files that were untracked
-;; when stashing.
+* address@hidden, if it exists, contains files that were untracked
+ when stashing.
-;; If this option is non-nil, `magit-ediff-show-stash' will run
-;; Ediff on a file using three buffers: one for address@hidden, another
-;; for address@hidden, and a third for address@hidden
+If this option is non-nil, `vdiff-magit-show-stash' will run
+vdiff on a file using three buffers: one for address@hidden, another
+for address@hidden, and a third for address@hidden
-;; Otherwise, Ediff uses two buffers, comparing
-;; address@hidden@{N}. Along with any unstaged changes, changes
-;; in the index commit, address@hidden, will be shown in this
-;; comparison unless they conflicted with changes in the working
-;; tree at the time of stashing."
-;; :package-version '(magit . "2.6.0")
-;; :group 'magit-ediff
-;; :type 'boolean)
+Otherwise, vdiff uses two buffers, comparing
address@hidden@{N}. Along with any unstaged changes, changes
+in the index commit, address@hidden, will be shown in this
+comparison unless they conflicted with changes in the working
+tree at the time of stashing."
+ :package-version '(magit . "2.6.0")
+ :group 'vdiff-magit
+ :type 'boolean)
;; (defvar magit-ediff-previous-winconf nil)
@@ -429,41 +429,29 @@ FILE must be relative to the top directory of the
repository."
(magit-ediff-read-files revA revB (magit-current-file)))))
;; ;;;###autoload
-;; (defun magit-ediff-show-stash (stash)
-;; "Show changes introduced by STASH using Ediff.
-;; `magit-ediff-show-stash-with-index' controls whether a
-;; three-buffer Ediff is used in order to distinguish changes in the
-;; stash that were staged."
-;; (interactive (list (magit-read-stash "Stash")))
-;; (-let* ((revA (concat stash "^1"))
-;; (revB (concat stash "^2"))
-;; (revC stash)
-;; ((fileA fileC) (magit-ediff-read-files revA revC))
-;; (fileB fileC))
-;; (if (and magit-ediff-show-stash-with-index
-;; (member fileA (magit-changed-files revB revA)))
-;; (let ((conf (current-window-configuration))
-;; (bufA (magit-get-revision-buffer revA fileA))
-;; (bufB (magit-get-revision-buffer revB fileB))
-;; (bufC (magit-get-revision-buffer revC fileC)))
-;; (ediff-buffers3
-;; (or bufA (magit-find-file-noselect revA fileA))
-;; (or bufB (magit-find-file-noselect revB fileB))
-;; (or bufC (magit-find-file-noselect revC fileC))
-;; `((lambda ()
-;; (setq-local
-;; ediff-quit-hook
-;; (lambda ()
-;; ,@(unless bufA
-;; '((ediff-kill-buffer-carefully ediff-buffer-A)))
-;; ,@(unless bufB
-;; '((ediff-kill-buffer-carefully ediff-buffer-B)))
-;; ,@(unless bufC
-;; '((ediff-kill-buffer-carefully ediff-buffer-C)))
-;; (let ((magit-ediff-previous-winconf ,conf))
-;; (run-hooks 'magit-ediff-quit-hook))))))
-;; 'ediff-buffers3))
-;; (vdiff-magit-compare revA revC fileA fileC))))
+(defun vdiff-magit-show-stash (stash)
+ "Show changes introduced by STASH using Ediff.
+`vdiff-magit-show-stash-with-index' controls whether a
+three-buffer Ediff is used in order to distinguish changes in the
+stash that were staged."
+ (interactive (list (magit-read-stash "Stash")))
+ (-let* ((revA (concat stash "^1"))
+ (revB (concat stash "^2"))
+ (revC stash)
+ ((fileA fileC) (magit-ediff-read-files revA revC))
+ (fileB fileC))
+ (if (and vdiff-magit-show-stash-with-index
+ (member fileA (magit-changed-files revB revA)))
+ (let ((conf (current-window-configuration))
+ (bufA (magit-get-revision-buffer revA fileA))
+ (bufB (magit-get-revision-buffer revB fileB))
+ (bufC (magit-get-revision-buffer revC fileC)))
+ (vdiff-buffers3
+ (or bufA (magit-find-file-noselect revA fileA))
+ (or bufB (magit-find-file-noselect revB fileB))
+ (or bufC (magit-find-file-noselect revC fileC))
+ nil t t))
+ (vdiff-magit-compare revA revC fileA fileC))))
;; Don't think this is necessary
;; (defun magit-vdiff-cleanup-auxiliary-buffers ()
- [elpa] scratch/add-vdiff 001ae43 152/258: Fix modification of buffer list, (continued)
- [elpa] scratch/add-vdiff 001ae43 152/258: Fix modification of buffer list, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 477eb88 161/258: Fix refinement bug, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff f1eca80 165/258: Disable refine-all-hunks for diff3, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 30b85fe 164/258: Fix sending changes with diff3, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 816fe2a 182/258: Fix subtraction string width, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 582d13d 180/258: Fix compiler warnings, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff cd9dad4 191/258: Fix refresh function call sequence, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 2847cd6 183/258: Add callback support on quit, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 90f81f0 175/258: Make sure hook functions execute in vdiff bufs, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 2d48cb5 229/258: vdiff-magit: Simplify resolve, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff c31755a 220/258: vdiff-magit: Port show stash,
Justin Burkett <=
- [elpa] scratch/add-vdiff cfb90d7 233/258: vdiff-magit: Add note to README, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff f5fdcaa 241/258: vdiff-magit: Simplify exit from stage, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff e8d3d26 236/258: vdiff-magit: Try to switch resolve functions gracefully, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 7c87360 244/258: vdiff: Add vdiff-current-file, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 8b32329 245/258: vdiff: Filter out killed buffers better, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 8aa5c45 250/258: vdiff-magit: Fix paren, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 466b852 173/258: Fix subtraction overlay addition, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff f3b6cec 179/258: Center on start, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 667a7e4 144/258: Generalize data structures to prepare for diff3, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 059d288 208/258: Update gitignore, Justin Burkett, 2017/05/17