Sacha Chua wrote:

>  * I wrote a short vc-mode tutorial (Reddit)

Some of my tricks (about which i've mailed the author) are listed:

1.

> you can drop a hunk using k, or split it using C-c C-s.

Complicated partial commits are also possible. Consider such a diff:

 context1
 context2
-deletion1
-deletion2
-deletion3
+addition1
+addition2
+addition3
 context3
 context4

If you want to commit only the, say, upper part, you can change it to:

 context1
 context2
-deletion1
-deletion2
+addition1
+addition2
 deletion3
 context3
 context4

Apart from the normal editing commands, C-x r t may be used to change
the 1st character of the lines between +/-/space instantaneously: this
makes sure the header counts are not turned off (btw you can undo if
that happens), which is good as an indicator of an invalid diff .

2. C-x v g a a a... (Historical line-by-line git blame)

Of course, ICYDK, you can use C-x x u before the 'a', to keep that
buffer around.

3. C-x v ! C-x v L, add: -G"search term", RET (commit search)

4. C-x v ! in general, for slight modifications. For e.g. to compare a
stash with the worktree, stash the latter (z s) and use this prefix
before '=' on the former and change the command to "git diff ..." etc.

Bonus: I've C-h RET (actually <F1> RET) bound to a lambda (man
(Man-default-man-entry)) for quick look up in the command-editing
minibuffer (because "minibuffer within a minibuffer" is impossible).

--

---
via emacs-tangents mailing list 
(https://lists.gnu.org/mailman/listinfo/emacs-tangents)

Reply via email to