unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: Committing only specific hunks in VC
Date: Tue, 11 Jan 2011 12:28:58 -0500	[thread overview]
Message-ID: <jwvwrmb9wy0.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: mailman.5.1294724484.29161.help-gnu-emacs@gnu.org

> I have a bunch of files that have been modified and I'd like to commit
> all of these changes except for one hunk in one of the files.
> How would I do this from Emacs?

For many years, I've had a local patch to do that in VC, but I recently
threw it out, deciding that it deserves to be rewritten based on the
"new" tools available currently, i.e. stash/shelve.

> I've heard that it's possible to stage
> only specific hunks in magit, but I'm using Mercurial.

I haven't used Mercurial enough, but I'd do a "hg shelve" (or "hg
stash" or whatever it's called and if hg doesn't have such
a functionality, I'd do it by hand: "hg diff >shelve1.diff");
Then I'd use C-x v, diff-mode and friends to add/remove changes to get
just the changes I want to commit;
Then "hg commit";
Then "hg unshelve" or "hg unstash" or "patch -p0 <shelve1.diff";
And resolve the potential conflicts, if any.


        Stefan


       reply	other threads:[~2011-01-11 17:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.5.1294724484.29161.help-gnu-emacs@gnu.org>
2011-01-11 17:28 ` Stefan Monnier [this message]
2011-01-11  5:40 Committing only specific hunks in VC Deniz Dogan
2011-01-11 22:57 ` suvayu ali
2011-01-12  8:53   ` Alberto Luaces
2011-01-12  9:03     ` Deniz Dogan
2011-01-12  9:40 ` Oleksandr Gavenko
     [not found] ` <mailman.33.1294825218.12535.help-gnu-emacs@gnu.org>
2011-01-12 21:06   ` Colin S. Miller
2011-02-18 19:08     ` jpkotta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvwrmb9wy0.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).