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

Re: [PATCH 2/3] apply --whitespace: configuration option.

From
Andreas Ericsson <ae@op5.se>
Date
Feb 28, 2006, 09:46 UTC
Message-ID
<44041C05.3030103@op5.se>
In-Reply-To
<7vzmkbn7qx.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 37 quoted lines
> Andreas Ericsson <ae@op5.se> writes:
> 
> 
>>Junio C Hamano wrote:
>>
>>>The new configuration option apply.whitespace can take one of
>>>"warn", "error", "error-all", or "strip".  When git-apply is run
>>>to apply the patch to the index, they are used as the default
>>>value if there is no command line --whitespace option.
>>
>>I would think "warn-all" would be the logical thing, since "error"
>>either breaks out early or prints all warnings before denying the
>>patch anyway.
> 
> 
> Actually there is some thinking behind why I did not do warn-all.
> I did consider it at first but rejected.
> 
>  * If you are a busy top echelon person but cares about tree
>    cleanliness, --whitespace=error is good enough.  The patch is
>    rejected on WS basis whether it introduces one such trailing
>    WS or hundreds.  The patch is returned to the submitter and
>    the tree remains clean.
> 
>  * --whitespace=warn-all, if existed, would apply the patch
>    _anyway_, so if you notice you got warnings, and if that
>    bothers you enough that you would want to do something about
>    it, you will have to rewind the HEAD, fix up .dotest/patch
>    and reapply.  This means you are willing to clean up other
>    peoples' patches.
> 
>  * But if you are that kind of person, --whitespace=error-all is
>    a better choice for you.  Your tree stays clean and you do
>    not have to rewind.  Instead, you get all the errors you can
>    go through with your editor (e.g. Emacs users can use C-x `;
>    I hope vim users have similar macros) and fix things.
> 
Good Thinking. Thanks for explaining.
Show 6 quoted lines
> 
> The last one is somewhat risky, and the output may need to be
> examined carefully depending on the contents (e.g. programming
> language) the project is dealing with.
> 
> 

echo Makefile >> .git/no-ws-strip echo '*.[ch]' >> .git/ws-strip

Perhaps not viable, and probably stupid as well. Mixed content repos would likely just keep the 'warn' policy.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Junio C HamanoNext: Junio C Hamano
Message 21 of 40 in “the war on trailing whitespace”
  1. Andrew MortonFeb 26, 2006
  2. Junio C HamanoFeb 26, 2006
  3. Andrew MortonFeb 26, 2006
  4. Linus TorvaldsFeb 26, 2006
  5. Andrew MortonFeb 26, 2006
  6. Linus TorvaldsFeb 26, 2006
  7. Dave JonesFeb 26, 2006
  8. Dave JonesFeb 26, 2006
  9. MIke GalbraithFeb 27, 2006
  10. Johannes SchindelinFeb 27, 2006
  11. Andrew MortonFeb 27, 2006
  12. Junio C HamanoFeb 27, 2006
  13. Peter WilliamsFeb 27, 2006
  14. Junio C HamanoFeb 28, 2006
  15. Andrew MortonFeb 27, 2006
  16. git-apply: war on whitespace -- finishing touches.Junio C Hamano, Feb 28, 2006
  17. 1/3 apply: squelch excessive errors and --whitespace=error-allJunio C Hamano, Feb 28, 2006
  18. 2/3 apply --whitespace: configuration option.Junio C Hamano, Feb 28, 2006
  19. Andreas EricssonFeb 28, 2006
  20. Junio C HamanoFeb 28, 2006
  21. Andreas EricssonFeb 28, 2006
  22. 3/3 git-apply --whitespace=nowarnJunio C Hamano, Feb 28, 2006
  23. A Large Angry SCMFeb 28, 2006
  24. Junio C HamanoFeb 28, 2006
  25. Adrien BeauFeb 27, 2006
  26. Andreas EricssonFeb 27, 2006
  27. Uwe ZeisbergerFeb 27, 2006
  28. Andreas EricssonFeb 27, 2006
  29. Peter HagervallFeb 27, 2006
  30. Johannes SchindelinFeb 27, 2006
  31. Randal L. SchwartzFeb 27, 2006
  32. Josef WeidendorferFeb 27, 2006
  33. Adrien BeauFeb 27, 2006
  34. Uwe ZeisbergerFeb 27, 2006
  35. Andreas EricssonFeb 27, 2006
  36. Johannes SchindelinFeb 27, 2006
  37. Junio C HamanoFeb 27, 2006
  38. apply --whitespace fixes and enhancements.Junio C Hamano, Feb 27, 2006
  39. Junio C HamanoFeb 26, 2006
  40. Sam RavnborgFeb 26, 2006

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.