[Top][All Lists]

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

Re: How to commit hunks using VC?

From: Yuri Khan
Subject: Re: How to commit hunks using VC?
Date: Sat, 27 Oct 2018 02:57:09 +0700

On Sat, Oct 27, 2018 at 2:47 AM Stefan Monnier <> wrote:

> > If I need to commit a change that is finer than a single line, I can
> > press ‘RET’ on the relevant line in the diff, which takes me to the
> > buffer of the file at point, with point on the corresponding line. I
> > can edit the line, save the file, switch to the status buffer, stage
> > the line, switch back to the file, and undo the changes so that I
> > could put them in the next commit.
> > Stash never enters the picture.
> Whether you use "do ... undo" as above, or "cp foo foo.bak ... cp
> foo.bak foo" or "stash ... unstash" is up to you.  To me these are just
> minor variants of the same approach.

Essentially, yes, but do/undo operates on line level, cp on file
level, and stash/unstash on the whole working copy.

Also, the situation where you have one version of the line on the
branch, a different one in the working copy, and need to stage a third
one that differs from both of the above, is rare.

reply via email to

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