Re: git revert ignore whitespace

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

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]