help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How to commit hunks using VC?


From: Stefan Monnier
Subject: Re: How to commit hunks using VC?
Date: Fri, 26 Oct 2018 14:48:13 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> Thank you.  So, if I understand it correctly, I can commit hunks in VC,
> with the git backend, by abusing stash, right?

Of course.  And I don't think it's an abuse.
You can also do:

    cp file file.bak
    ...edit file...
    commit the file with VC
    cp file.bak file

which is basically doing the same but using `cp` instead of `git stash`.

> Can I commit only parts of a hunk?

The commit is not linked to the stash, so you can commit anything
you like by adding/'removing the corresponding changes any way you
like, yes [ tho if you make those changes outside of Emacs, you'll
lose karma points, obviously.  ]


        Stefan




reply via email to

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