<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/ws.c, branch v1.6.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.6.3</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.6.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2008-10-12T19:36:19Z</updated>
<entry>
<title>Replace calls to strbuf_init(&amp;foo, 0) with STRBUF_INIT initializer</title>
<updated>2008-10-12T19:36:19Z</updated>
<author>
<name>Brandon Casey</name>
<email>casey@nrlssc.navy.mil</email>
</author>
<published>2008-10-09T19:12:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f285a2d7ed6548666989406de8f0e7233eb84368'/>
<id>urn:sha1:f285a2d7ed6548666989406de8f0e7233eb84368</id>
<content type='text'>
Many call sites use strbuf_init(&amp;foo, 0) to initialize local
strbuf variable "foo" which has not been accessed since its
declaration. These can be replaced with a static initialization
using the STRBUF_INIT macro which is just as readable, saves a
function call, and takes up fewer lines.

Signed-off-by: Brandon Casey &lt;casey@nrlssc.navy.mil&gt;
Signed-off-by: Shawn O. Pearce &lt;spearce@spearce.org&gt;
</content>
</entry>
<entry>
<title>Teach "diff --check" about new blank lines at end</title>
<updated>2008-06-27T05:07:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-06-26T22:36:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=877f23ccb88227203f2576abdfb5d1c15925fcb3'/>
<id>urn:sha1:877f23ccb88227203f2576abdfb5d1c15925fcb3</id>
<content type='text'>
When a patch adds new blank lines at the end, "git apply --whitespace"
warns.  This teaches "diff --check" to do the same.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>check_and_emit_line(): rename and refactor</title>
<updated>2008-06-27T01:13:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-06-26T22:35:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8f8841e9c8e6a26153b0cf9417c7540cf65ef09f'/>
<id>urn:sha1:8f8841e9c8e6a26153b0cf9417c7540cf65ef09f</id>
<content type='text'>
The function name was too bland and not explicit enough as to what it is
checking.  Split it into two, and call the one that checks if there is a
whitespace breakage "ws_check()", and call the other one that checks and
emits the line after color coding "ws_check_emit()".

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-apply --whitespace=fix: fix off by one thinko</title>
<updated>2008-02-26T20:24:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-02-26T20:24:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c6fabfafbcebca13cee0047b337b7c7a87e3515e'/>
<id>urn:sha1:c6fabfafbcebca13cee0047b337b7c7a87e3515e</id>
<content type='text'>
When a patch adds a whitespace followed by end-of-line, the
trailing whitespace error was detected correctly but was not
fixed, due to misconversion in 42ab241 (builtin-apply.c: do not
feed copy_wsfix() leading '+').

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>ws_fix_copy(): move the whitespace fixing function to ws.c</title>
<updated>2008-02-24T00:59:16Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-02-24T00:59:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fe3403c3205de44faa926a086b4b99f157fc63fe'/>
<id>urn:sha1:fe3403c3205de44faa926a086b4b99f157fc63fe</id>
<content type='text'>
This is used by git-apply but we can use it elsewhere by slightly
generalizing it.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>core.whitespace: cr-at-eol</title>
<updated>2008-02-05T08:38:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-01-15T08:59:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b2979ff599a6bcf9dbf5e2ef1e32b81a1b88e115'/>
<id>urn:sha1:b2979ff599a6bcf9dbf5e2ef1e32b81a1b88e115</id>
<content type='text'>
This new error mode allows a line to have a carriage return at the
end of the line when checking and fixing trailing whitespace errors.

Some people like to keep CRLF line ending recorded in the repository,
and still want to take advantage of the automated trailing whitespace
stripping.  We still show ^M in the diff output piped to "less" to
remind them that they do have the CR at the end, but these carriage
return characters at the end are no longer flagged as errors.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>whitespace: more accurate initial-indent highlighting</title>
<updated>2007-12-16T21:07:58Z</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@citi.umich.edu</email>
</author>
<published>2007-12-16T16:31:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ffe568859ba89b4283afc36251561a9be3173bf8'/>
<id>urn:sha1:ffe568859ba89b4283afc36251561a9be3173bf8</id>
<content type='text'>
Instead of highlighting the entire initial indent, highlight only the
problematic spaces.

In the case of an indent like ' \t \t' there may be multiple problematic
ranges, so it's easiest to emit the highlighting as we go instead of
trying rember disjoint ranges and do it all at the end.

Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>whitespace: fix initial-indent checking</title>
<updated>2007-12-16T21:07:49Z</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@citi.umich.edu</email>
</author>
<published>2007-12-16T16:31:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9afa2d4aa9423ab594c7281cc2360df55498a407'/>
<id>urn:sha1:9afa2d4aa9423ab594c7281cc2360df55498a407</id>
<content type='text'>
After this patch, "written" counts the number of bytes up to and
including the most recently seen tab.  This allows us to detect (and
count) spaces by comparing to "i".

This allows catching initial indents like '\t        ' (a tab followed
by 8 spaces), while previously indent-with-non-tab caught only indents
that consisted entirely of spaces.

This also allows fixing an indent-with-non-tab regression, so we can
again detect indents like '\t \t'.

Also update tests to catch these cases.

Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>whitespace: minor cleanup</title>
<updated>2007-12-16T21:07:41Z</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@citi.umich.edu</email>
</author>
<published>2007-12-16T16:31:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=954ecd435389916643efeb5b1ade82250170c071'/>
<id>urn:sha1:954ecd435389916643efeb5b1ade82250170c071</id>
<content type='text'>
The variable leading_space is initially used to represent the index of
the last space seen before a non-space.  Then later it represents the
index of the first non-indent character.

It will prove simpler to replace it by a variable representing a number
of bytes.  Eventually it will represent the number of bytes written so
far (in the stream != NULL case).

Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>whitespace: reorganize initial-indent check</title>
<updated>2007-12-16T21:07:20Z</updated>
<author>
<name>J. Bruce Fields</name>
<email>bfields@citi.umich.edu</email>
</author>
<published>2007-12-16T16:31:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1020999a981e0dadedc475c41e33e20fd7832019'/>
<id>urn:sha1:1020999a981e0dadedc475c41e33e20fd7832019</id>
<content type='text'>
Reorganize to emphasize the most complicated part of the code (the tab
case).

Signed-off-by: J. Bruce Fields &lt;bfields@citi.umich.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
