git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH] cherry-pick/revert: add support for -X/--strategy-option

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Dec 11, 2010, 02:35 UTC
Message-ID
<20101211023537.GA12161@burratino>
In-Reply-To
<7vvd319h50.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> 	$ git revert -Xrenormalize old-problematic-commit
[...]
> I guess this can also take "ignore whitespace", which might be a better
> option for this particular use case?

Suppose in olden days you checked in files with \r\n line endings and now you have switched to \n (attribute "crlf" or "text"), and in between there was a day in which the line endings were switched.

Now you notice that old-problematic-commit is broken. If that commit removed lines (which had \r\n line endings), then even with -Xignore-space-at-eol, "git revert" will add them back verbatim. By contrast, "git revert -Xrenormalize" would add them back in such a way as to follow the current line ending style.

Previous: Junio C HamanoNext: Jonathan Nieder
Message 3 of 8 in “cherry-pick/revert: add support for -X/--strategy-option”
  1. cherry-pick/revert: add support for -X/--strategy-optionJonathan Nieder, Dec 11, 2010
  2. Junio C HamanoDec 11, 2010
  3. Jonathan NiederDec 11, 2010
  4. Jonathan NiederDec 27, 2010
  5. Martin von ZweigbergkDec 27, 2010
  6. Justin FrankelDec 27, 2010
  7. Junio C HamanoDec 28, 2010
  8. Jonathan NiederDec 28, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.