emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/vc-got 9e01941 078/145: improve vc-dir presentation & d


From: ELPA Syncer
Subject: [elpa] externals/vc-got 9e01941 078/145: improve vc-dir presentation & document vc-got-stage in README
Date: Thu, 9 Sep 2021 15:58:37 -0400 (EDT)

branch: externals/vc-got
commit 9e0194139b3ace5c3cf3802cc38230ae9e9f38f1
Author: Omar Polo <op@omarpolo.com>
Commit: Omar Polo <op@omarpolo.com>

    improve vc-dir presentation & document vc-got-stage in README
---
 README.md                     |  27 +++++++++++++++++++++++++--
 images/vc-dir.png             | Bin 0 -> 35724 bytes
 images/vc-got-stage-files.png | Bin 0 -> 59967 bytes
 vc-got.el                     |  20 ++++++++++----------
 4 files changed, 35 insertions(+), 12 deletions(-)

diff --git a/README.md b/README.md
index d872ab2..9fddaad 100644
--- a/README.md
+++ b/README.md
@@ -3,8 +3,6 @@
 This is an **experimental** Emacs VC back-end for the [Game of
 Tree](http://gameoftrees.org/) version control system.
 
-Use it at your own risk.
-
 ------
 
 To start using it, you need to add `Got` to `vc-handled-backends` and
@@ -32,3 +30,28 @@ With `use-package` something like this should be enough:
   (add-to-list 'vc-handled-backends 'Got)
   (add-to-list 'vc-directory-exclusion-list ".got"))
 ```
+
+
+## Stage hunks
+
+Unlike other VC backends, `vc-got` is able to stage and commit
+individual changes.  It's still WIP, but usable.
+
+ - `vc-got-stage-files` guides the user through the stage process,
+   like `got stage -p` (or `git add -p`).  It operates on the current
+   file or on the marked ones in `*vc-dir*`
+ - `vc-got-stage-unstage` is similar, except that it un-stages the
+   changes.
+ - `vc-got-stage-diff` show the staged diff
+ - `vc-got-stage-commit` commits the staged changes
+
+Here's an example of the `*vc-dir*` buffer when some edits were staged
+on a file
+
+![vc-dir buffer with a staged file](images/vc-dir.png "vc-dir buffer with a 
staged file")
+
+and an example of the interactive stage operation with
+`vc-got-stage-files`
+
+![interactive stage operation](images/vc-got-stage-files.png
+"interactive stage operation")
diff --git a/images/vc-dir.png b/images/vc-dir.png
new file mode 100644
index 0000000..8754124
Binary files /dev/null and b/images/vc-dir.png differ
diff --git a/images/vc-got-stage-files.png b/images/vc-got-stage-files.png
new file mode 100644
index 0000000..826c716
Binary files /dev/null and b/images/vc-got-stage-files.png differ
diff --git a/vc-got.el b/vc-got.el
index 3133c9f..50e516d 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -443,7 +443,15 @@ FILES is nil, consider all the files in DIR."
      (propertize
       (format "%c" (if (vc-dir-fileinfo->marked info) ?* ? ))
       'face 'font-lock-type-face)
-     "   "
+     " "
+     (propertize
+      (if stage-state
+         (format "staged:%-6s" stage-state)
+       (format "%-13s" ""))
+      'face (cond ((memq stage-state '(add edit)) 'font-lock-constant-face)
+                 ((eq stage-state 'remove) 'font-lock-warning-face)
+                 (t 'font-lock-variable-name-face)))
+     " "
      (propertize
       (format "%-14s" state)
       'face (cond ((eq state 'up-to-date) 'font-lock-builtin-face)
@@ -453,14 +461,6 @@ FILES is nil, consider all the files in DIR."
       'mouse-face 'highlight)
      " "
      (propertize
-      (if stage-state
-         (format "staged:%-7s" stage-state)
-       (format "%-14s" ""))
-      'face (cond ((memq stage-state '(add edit)) 'font-lock-constant-face)
-                 ((eq stage-state 'remove) 'font-lock-warning-face)
-                 (t 'font-lock-variable-name-face)))
-     " "
-     (propertize
       (format "%s" filename)
       'face
       (if isdir 'font-lock-comment-delimiter-face 
'font-lock-function-name-face)
@@ -750,7 +750,7 @@ Adviced around vc-dir-move-to-goal-column because it 
hardcodes column 25."
       (funcall fn)
     (beginning-of-line)
     (unless (eolp)
-      (forward-char 34))))
+      (forward-char 31))))
 (advice-add 'vc-dir-move-to-goal-column :around 
#'vc-got-fix-dir-move-to-goal-column)
 
 (provide 'vc-got)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]