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: Phil Sainty
Subject: Re: On the adoption of transient.el
Date: Fri, 06 Aug 2021 14:13:28 +1200
User-agent: Orcon Webmail

On 2021-08-06 04:17, Eli Zaretskii wrote:
I'm afraid I'm not following.  If I find by searching the net the
sequence of Git commands to do some job, I just copy/paste them into
the shell window, and that's it.  And no need to memorize those
commands: the next time I need to do the same job, I do the net search
again.  Since the search hits the right answers very quickly, this is
very adequate for jobs I need to do rarely (which is why I don't
remember the commands in the first place).

What am I missing?

Maybe nothing?  It's hard to say.  On occasion I'll revert to the same
search-online process (an example I can think of being finding the
reference for a deleted-but-not-yet-garbage-collected commit; that's
not something I'd look to Magit to resolve).

Here's a description of Magit that I once wrote.  It wasn't aimed at
Emacs users, so some of the benefits apply equally to vc, and your
definition of "complex" might not align with mine.  The most complex
things I do on a regular basis are probably all related to rebasing,
and you've said you rarely do any of that, whereas I do it a great
deal, partly because Magit makes it so easy.  E.g. If I realise there
is a bug in a commit somewhere in my unmerged work-in-progress branch,
then I will squash the fix into the original commit 99% of the time,
because doing so takes me about 5 seconds.

FWIW...



Magit provides highly interactive views of your repository, with
simple and efficient key bindings to perform actions (which are often
contextual), such that even complex tasks become remarkably quick and
easy to do. A help buffer displays the available keys at any given
time, so it's always easy to see what the options are.

The main status buffer has collapsible sections for the repo as a
whole, so you not only see which files are staged and unstaged (or
untracked, stashed, unpushed, etc), but you can interactively expand
and collapse the entries to see some/all the diffs; stage or unstage
things with at a keystroke (where "things" can be all changes, or a
single file, or a single hunk of the diff for that file, or a
user-selected region!). Grooming your commits is ludicrously easy and
intuitive when you can just eye-ball the current state and then point
at things to add to (or remove from) that state.

Naturally committing and writing (or amending) commit messages inside
the editor is very streamlined.

Logs are interactive, as each line of the log buffer represents a
commit, so any command which accepts a reference (commit hash, branch
name, tag, etc) can be performed by typing the keys for that action
with the cursor on the log entry for that reference, and Magit will
contextually use that reference (or offer it as a default) for the
command (e.g. viewing, branching, merging, rebasing, etc...)

Diffs are interactive, so you can jump to the relevant file in the
editor (in either its 'before' or 'after' state for that diff), or
apply (or revert) the changes for a file/hunk/region of the diff at a
keystroke. e.g. You could display the diff for a stash (or for a
commit from another branch) and then interactively apply only part of
it.

History rewriting becomes trivial when you can stage some changes and
then point at any commit and say "amend this commit", and it just
happens. Or reword an earlier commit message at any time in the same
manner. Or rebase a range of commits onto a different base by visually
choosing the relevant log entries. Or make a series of fixup commits
(again simply choosing the target log entry each time without needing
to care what the hashes are), and then autosquash them all in a couple
of keystrokes.

Magit interacts with existing conflict resolution tools in Emacs, so
you can smoothly deal with conflicts without leaving the editor.

There's plenty more, but hopefully that gives an idea of what Magit is
about.

It doesn't try to provide any unfamiliar abstractions -- it just makes
things fast and easy. Complex things become simple, and simple things
become trivial. There are very few times that I ever find myself
needing a command line to do something with git, as everything which
Magit supports (which more than covers my day-to-day needs) is just
nicer to do inside Magit, without ever leaving the editor.




reply via email to

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