unofficial mirror of emacs-tangents@gnu.org
 help / color / mirror / Atom feed
From: James Thomas via Emacs news and miscellaneous discussions outside the scope of other Emacs mailing lists <emacs-tangents@gnu.org>
To: emacs-tangents@gnu.org
Subject: Re: 2024-08-19 Emacs news
Date: Sun, 01 Sep 2024 04:58:12 +0530	[thread overview]
Message-ID: <86le0c8e7n.fsf@gmx.net> (raw)
In-Reply-To: <87y14sf5dq.fsf@sachachua.com> (Sacha Chua's message of "Mon, 19 Aug 2024 19:40:49 -0400")

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	other threads:[~2024-08-31 23:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19 23:40 2024-08-19 Emacs news Sacha Chua
2024-08-31 23:28 ` James Thomas via Emacs news and miscellaneous discussions outside the scope of other Emacs mailing lists [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86le0c8e7n.fsf@gmx.net \
    --to=emacs-tangents@gnu.org \
    --cc=jimjoe@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).