[Top][All Lists]

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

Re: vc.el support for staging hunks/files

From: Dan Nicolaescu
Subject: Re: vc.el support for staging hunks/files
Date: Thu, 09 Jan 2014 12:49:18 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

address@hidden (João Távora) writes:

>> On Fri, Jan 3, 2014 at 3:57 PM, Eli Zaretskii <address@hidden> wrote:
>>> I've managed to grasp all that, I've made an alias for "commit -a",
>>> because that's what I almost always want.  (And why isn't that the
>>> default, dammit?)
> Yuri Khan <address@hidden> writes:
>> Because staging is a key concept in git and it enables a whole lot of
>> useful workflows. E.g. you can work all day and half the next day on a
>> feature, making small formatting changes and fix coding style
>> violations on your way as you spot them, then fire up a commit tool
>> and make three commits, one for trivial formatting changes, another
>> for coding style fixes, and a third one with the feature you actually
>> worked on.
>> Without staging, you would have to look at the diff, back up and
>> revert some changes so that the working directory looks the way you
>> want for one commit, then the other, then the next one. Or you would
>> hold off fixing small things until you have committed the feature, and
>> risk forgetting to do them.
> +1 for git and +1 for this technique in particular. This has to be the
> most useful thing that git brought to the table for me.
> I also thought git commit -a would be always what I wanted, but I was
> obviously wrong. Now my favourite workflow is to prototype a change with
> some initial commits, semantically independent, sometimes even
> empty. Then hack away at everything at once like in pre-VCS days. Then
> use git add -p (or git gui) to make many "fixup" commits that can be
> squashed onto the initial ones first set using `git rebase
> --interactive`. Finally, when the stage is set, `git push`.
> I admit I also had trouble with the git docs at first, but the "stage""
> metaphor couldn't be cleverer.
> My question is, since we're on emacs-devel: could vc.el support this
> workflow?
> * git-add --edit seems to indicate so;
> * diff-mode apparently has diff-marker calculation logic built in;
> * magit supports it apparently and its git-rebase-mode.el could be used
>   independently.

IMHO there would be quite a bit of interest if such a feature was
properly integrated in vc.
You might want to first post the design here before doing any
implementation work..


reply via email to

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