git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Steven <redalert.commander@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git revert ignore whitespace
Date: Fri, 10 Sep 2010 10:21:14 -0400	[thread overview]
Message-ID: <20100910142114.GB6936@sigill.intra.peff.net> (raw)
In-Reply-To: <14756.91.183.48.98.1284105472.squirrel@stevenleeuw.kwik.to>

On Fri, Sep 10, 2010 at 09:57:52AM +0200, Steven wrote:

> I want to revert a specific commit using 'git revert',
> however in the meantime there were some whitespace changes.
> Is it still possible to do this? The manual doesn't mention a -w or
> --ignore-whitespace option for git revert.

In theory there is no reason we couldn't support "-w", but I don't think
there is a way to do it currently.

You could just manually do the revert. Something like:

  git diff-tree -p $commit | git apply --ignore-whitespace
  git commit -m "revert '`git log -1 --format=%s $commit`'"

which is more or less what revert will do (actually, I think it will do
more with 3-way merges during the application, but the point is that a
revert in git is nothing more than achieving a tree state that pulls out
the reverted content, and then making a commit. It has no special status
in the history graph).

-Peff

  reply	other threads:[~2010-09-10 14:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-10  7:57 git revert ignore whitespace Steven
2010-09-10 14:21 ` Jeff King [this message]
2010-09-10 14:54   ` Steven
2010-09-10 15:24     ` Jeff King
2010-09-10 16:34       ` Junio C Hamano

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=20100910142114.GB6936@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=redalert.commander@gmail.com \
    /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).