emacs-devel
[Top][All Lists]
Advanced

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

Re: On the adoption of transient.el


From: Juri Linkov
Subject: Re: On the adoption of transient.el
Date: Fri, 06 Aug 2021 02:20:06 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> AFAIK Magit is not advertised as a tool for doing exotic jobs without
> prior knowledge. Magit is great at discoverability, ergonomics, and
> user-friendliness. This means that the capabilities of the tool are
> explicit, you operate the tool with a simple interface and the state you
> are operating on is obvious. Compare this with writing commands on the
> console (that you previously need to memorize)

While I think Magit is a great package for discoverability etc.
I found that it's completely sufficient to use just the shell-command.
With the persistent history of the previously constructed git commands
using a flex-style completion on previous commands will even reduce
the need in some vc commands, e.g.

'M-! chm TAB' runs `git checkout master` (instead of C-x v r)
'M-! pur TAB' runs `git pull --rebase`   (instead of C-x v P)
...

> But I'll try answering your request with two examples. First one: as you
> work on some feature you find and fix some typos here and there, or do
> some other quick change not directly related to your initial task. You
> end with those quick changes mixed with your main task. With Magit, it
> is trivial to separately commit the changes: on the Magit status buffer
> navigate to the fixed typos, select them as you select a region on
> Emacs, press `s' and the selected change goes to the staging area. Do
> the same for the rest and commit.

Currently I'm finishing implementation of a new vc command that
will allow committing from a diff buffer.  So for example, after
displaying all changes with e.g. 'C-x v D' you can remove
some unneeded hunks (with e.g. 'M-k' 'diff-hunk-kill'),
then on the remaining hunks type 'C-c C-c' in the diff buffer.
It will create a usual *vc-log* buffer where typing 'C-c C-c'
will commit only changes from the diff buffer.  Internally
it works by running three git commands:

`git stash push -m stash_name -- list_of_file_names_from_diff`
`cat diff_buffer.patch | git am` # should also handle return code
`git stash pop -q`



reply via email to

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