commit 9e0194139b3ace5c3cf3802cc38230ae9e9f38f1 from: Omar Polo date: Tue Jan 05 10:25:51 2021 UTC improve vc-dir presentation & document vc-got-stage in README commit - c819459405eb9febdb67b19d08bfa50c5ec83017 commit + 9e0194139b3ace5c3cf3802cc38230ae9e9f38f1 blob - d872ab2cc1eb30f16053257239bb042dee72517a blob + 9fddaadadcb564ce1e5273cf28673e9fb4b3c98a --- README.md +++ 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 enoug (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") blob - /dev/null blob + 875412491f29d17937da9da4bc9a2906d8e78cc3 (mode 644) Binary files /dev/null and images/vc-dir.png differ blob - /dev/null blob + 826c7163c2e969139666c96a95d3e7cc54c7fd27 (mode 644) Binary files /dev/null and images/vc-got-stage-files.png differ blob - 3133c9fcbad226020009184ecc05e15f405be627 blob + 50e516dd2ecf251a2eeb8382fed0044a813f4a31 --- vc-got.el +++ 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) @@ -451,14 +459,6 @@ FILES is nil, consider all the files in DIR." ((eq state 'edited) 'font-lock-constant-face) (t 'font-lock-variable-name-face)) '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) @@ -750,7 +750,7 @@ Adviced around vc-dir-move-to-goal-column because it h (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)