<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/attr.c, branch v1.7.3.5</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.7.3.5</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v1.7.3.5'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2010-06-21T13:02:49Z</updated>
<entry>
<title>Merge branch 'eb/core-eol'</title>
<updated>2010-06-21T13:02:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-06-21T13:02:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d5cff17edaf438bbf45a2130e9cadc0c938291d6'/>
<id>urn:sha1:d5cff17edaf438bbf45a2130e9cadc0c938291d6</id>
<content type='text'>
* eb/core-eol:
  Add "core.eol" config variable
  Rename the "crlf" attribute "text"
  Add per-repository eol normalization
  Add tests for per-repository eol normalization

Conflicts:
	Documentation/config.txt
	Makefile
</content>
</entry>
<entry>
<title>Rename the "crlf" attribute "text"</title>
<updated>2010-05-20T03:42:34Z</updated>
<author>
<name>Eyvind Bernhardsen</name>
<email>eyvind.bernhardsen@gmail.com</email>
</author>
<published>2010-05-19T20:43:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=5ec3e67052289217c84e53d2cda90d939ac5725b'/>
<id>urn:sha1:5ec3e67052289217c84e53d2cda90d939ac5725b</id>
<content type='text'>
As discussed on the list, "crlf" is not an optimal name.  Linus
suggested "text", which is much better.

Signed-off-by: Eyvind Bernhardsen &lt;eyvind.bernhardsen@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: Expand macros immediately when encountered.</title>
<updated>2010-04-11T01:36:00Z</updated>
<author>
<name>Henrik Grubbström</name>
<email>grubba@grubba.org</email>
</author>
<published>2010-04-06T12:46:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=ec775c41dc4bb7382ebbbb61ede59e63846b3644'/>
<id>urn:sha1:ec775c41dc4bb7382ebbbb61ede59e63846b3644</id>
<content type='text'>
When using macros it is otherwise hard to know whether an
attribute set by the macro should override an already set
attribute. Consider the following .gitattributes file:

[attr]mybinary	binary -ident
*		ident
foo.bin		mybinary
bar.bin		mybinary ident

Without this patch both foo.bin and bar.bin will have
the ident attribute set, which is probably not what
the user expects. With this patch foo.bin will have an
unset ident attribute, while bar.bin will have it set.

Signed-off-by: Henrik Grubbström &lt;grubba@grubba.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: Allow multiple changes to an attribute on the same line.</title>
<updated>2010-04-11T01:36:00Z</updated>
<author>
<name>Henrik Grubbström</name>
<email>grubba@grubba.org</email>
</author>
<published>2010-04-06T12:46:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=969f9d73228f233aff071a0d07ba28afdb79dbc4'/>
<id>urn:sha1:969f9d73228f233aff071a0d07ba28afdb79dbc4</id>
<content type='text'>
When using macros it isn't inconceivable to have an attribute
being set by a macro, and then being reset explicitly.

Signed-off-by: Henrik Grubbström &lt;grubba@grubba.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: Fixed debug output for macro expansion.</title>
<updated>2010-04-11T01:35:59Z</updated>
<author>
<name>Henrik Grubbström</name>
<email>grubba@grubba.org</email>
</author>
<published>2010-04-06T12:46:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=426c27b7c0a415cec451d8fd369ecd5a86adf85e'/>
<id>urn:sha1:426c27b7c0a415cec451d8fd369ecd5a86adf85e</id>
<content type='text'>
When debug_set() was called during macro expansion, it
received a pointer to a struct git_attr rather than a
string.

Signed-off-by: Henrik Grubbström &lt;grubba@grubba.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git_attr(): fix function signature</title>
<updated>2010-01-17T04:39:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2010-01-17T04:39:59Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=7fb0eaa289576a1dcd7751015ba791f1bce778a9'/>
<id>urn:sha1:7fb0eaa289576a1dcd7751015ba791f1bce778a9</id>
<content type='text'>
The function took (name, namelen) as its arguments, but all the public
callers wanted to pass a full string.

Demote the counted-string interface to an internal API status, and allow
public callers to just pass the string to the function.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: plug minor memory leak</title>
<updated>2009-06-30T23:12:24Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2009-06-30T22:30:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d4c985653a580e78db94c549bdcd71669067b8a9'/>
<id>urn:sha1:d4c985653a580e78db94c549bdcd71669067b8a9</id>
<content type='text'>
Free the memory allocated for struct strbuf pathbuf when we're done.

Signed-off-by: Rene Scharfe &lt;rene.scharfe@lsrfire.ath.cx&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix big left-shifts of unsigned char</title>
<updated>2009-06-18T16:22:46Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-06-18T00:22:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=48fb7deb5bbd87933e7d314b73d7c1b52667f80f'/>
<id>urn:sha1:48fb7deb5bbd87933e7d314b73d7c1b52667f80f</id>
<content type='text'>
Shifting 'unsigned char' or 'unsigned short' left can result in sign
extension errors, since the C integer promotion rules means that the
unsigned char/short will get implicitly promoted to a signed 'int' due to
the shift (or due to other operations).

This normally doesn't matter, but if you shift things up sufficiently, it
will now set the sign bit in 'int', and a subsequent cast to a bigger type
(eg 'long' or 'unsigned long') will now sign-extend the value despite the
original expression being unsigned.

One example of this would be something like

	unsigned long size;
	unsigned char c;

	size += c &lt;&lt; 24;

where despite all the variables being unsigned, 'c &lt;&lt; 24' ends up being a
signed entity, and will get sign-extended when then doing the addition in
an 'unsigned long' type.

Since git uses 'unsigned char' pointers extensively, we actually have this
bug in a couple of places.

I may have missed some, but this is the result of looking at

	git grep '[^0-9 	][ 	]*&lt;&lt;[ 	][a-z]' -- '*.c' '*.h'
	git grep '&lt;&lt;[   ]*24'

which catches at least the common byte cases (shifting variables by a
variable amount, and shifting by 24 bits).

I also grepped for just 'unsigned char' variables in general, and
converted the ones that most obviously ended up getting implicitly cast
immediately anyway (eg hash_name(), encode_85()).

In addition to just avoiding 'unsigned char', this patch also tries to use
a common idiom for the delta header size thing. We had three different
variations on it: "&amp; 0x7fUL" in one place (getting the sign extension
right), and "&amp; ~0x80" and "&amp; 0x7f" in two other places (not getting it
right). Apart from making them all just avoid using "unsigned char" at
all, I also unified them to then use a simple "&amp; 0x7f".

I considered making a sparse extension which warns about doing implicit
casts from unsigned types to signed types, but it gets rather complex very
quickly, so this is just a hack.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix a bunch of pointer declarations (codestyle)</title>
<updated>2009-05-01T22:17:31Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2009-05-01T09:06:36Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=4b25d091ba53c758fae0096b8c0662371857b9d9'/>
<id>urn:sha1:4b25d091ba53c758fae0096b8c0662371857b9d9</id>
<content type='text'>
Essentially; s/type* /type */ as per the coding guidelines.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>attr: add GIT_ATTR_INDEX "direction"</title>
<updated>2009-04-18T04:05:49Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2009-04-17T22:17:58Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=4191e80a3e8ee0fa0b8f97f9fba81c3549813fd5'/>
<id>urn:sha1:4191e80a3e8ee0fa0b8f97f9fba81c3549813fd5</id>
<content type='text'>
This instructs attr mechanism, not to look into working .gitattributes
at all. Needed by tools that does not handle working directory, such
as "git archive".

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
