git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Andreas Ericsson <ae@op5.se>
Cc: Pascal Obry <pascal.obry@wanadoo.fr>, git@vger.kernel.org
Subject: Re: How to remove a specific hunk
Date: Fri, 26 Oct 2007 12:49:26 -0400	[thread overview]
Message-ID: <20071026164926.GA21160@coredump.intra.peff.net> (raw)
In-Reply-To: <20071026164207.GB19673@coredump.intra.peff.net>

On Fri, Oct 26, 2007 at 12:42:08PM -0400, Jeff King wrote:

> That has the side effect of changing the index state. My preferred
> method would be to just excise the hunk from the diff using an editor
> (and this actually has nothing to do with git; you could be using
> diff/patch):
> 
> git-diff file >patch
> # remove every hunk except what you want to cut out
> $EDITOR patch
> git-apply -R patch

BTW, since this is inherently a non-git operation, there are other tools
that some may find friendlier than an editor. Kompare will let you
unapply differences, for example, and I would be shocked if emacs didn't
have some tool for this.

-Peff

  reply	other threads:[~2007-10-26 16:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-26 15:10 How to remove a specific hunk Pascal Obry
2007-10-26 15:28 ` Andreas Ericsson
2007-10-26 15:38   ` Pascal Obry
2007-10-26 17:03     ` Benoit SIGOURE
2007-10-26 18:19       ` Johannes Schindelin
2007-10-26 21:59     ` Olivier Ramonat
2007-10-26 16:42   ` Jeff King
2007-10-26 16:49     ` Jeff King [this message]
2007-10-29  7:03       ` Miles Bader
2007-10-26 19:20 ` Alex Riesen
2007-10-31 10:10   ` Benoit SIGOURE
2007-10-31 11:06     ` Johannes Schindelin
2007-10-31 11:56       ` Florian Weimer
2007-10-31 12:24         ` Pascal Obry
2007-10-31 12:00       ` Peter Baumann

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

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

  git send-email \
    --in-reply-to=20071026164926.GA21160@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=ae@op5.se \
    --cc=git@vger.kernel.org \
    --cc=pascal.obry@wanadoo.fr \
    /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 NNTP newsgroup(s).