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

Re: git add without whitespace

From
Junio C Hamano <gitster@pobox.com>
Date
May 31, 2016, 16:16 UTC
Message-ID
<xmqqvb1u5hka.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAHd499AreoaqfCVGi6XiatiWQMzf+KqL=a+f3D8u53dNkg0tiQ@mail.gmail.com>
Robert Dailey <rcdailey.lists@gmail.com> writes:
> - Splitting whitespace & real changes to two commits is probably
> superfluous; my original goal was to make diffing the actual changes
> easier, but since 'git diff -w' exists this is moot.

Doing "whitespace clean-up" in a separate preparatory patch _is_ a good practice. I do not think either approach makes it harder to do. After all, if you had a real change on the same line that you dropped a broken whitespace, e.g. (end-of-line shown with '$')

    -	if  (i==1) {  $
    +   if (j == 2) {$
both approaches would add the updated line.

The wsadd is about protecting _me_ from introducing new whitespace breakages, not about helping me when fixing existing whitespace breakages. So from that point of view, that may not fit well to what you are trying to do.

Previous: Robert DaileyNext: Christian Neukirchen
Message 6 of 8 in “git add without whitespace”
  1. Robert DaileyMay 30, 2016
  2. Junio C HamanoMay 30, 2016
  3. Robert DaileyMay 30, 2016
  4. Junio C HamanoMay 30, 2016
  5. Robert DaileyMay 31, 2016
  6. Junio C HamanoMay 31, 2016
  7. Christian NeukirchenMay 31, 2016
  8. demerphqMay 31, 2016

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.