<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/attr.c, branch v1.6.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.6.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.6.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2009-06-30T23:12:24Z</updated>
<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.shady.money/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.shady.money/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.shady.money/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.shady.money/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>
<entry>
<title>Read attributes from the index that is being checked out</title>
<updated>2009-03-14T05:51:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2009-03-14T04:24:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=06f33c1735bf76e02f3e2601cde5161e969872a7'/>
<id>urn:sha1:06f33c1735bf76e02f3e2601cde5161e969872a7</id>
<content type='text'>
Traditionally we used .gitattributes file from the work tree if exists,
and otherwise read from the index as a fallback.  When switching to a
branch that has an updated .gitattributes file, and entries in it give
different attributes to other paths being checked out, we should instead
read from the .gitattributes in the index.

This breaks a use case of fixing incorrect entries in the .gitattributes
in the work tree (without adding it to the index) and checking other paths
out, though.

    $ edit .gitattributes ;# mark foo.dat as binary
    $ rm foo.dat
    $ git checkout foo.dat

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix buffer overflow in prepare_attr_stack</title>
<updated>2008-07-16T21:05:50Z</updated>
<author>
<name>Dmitry Potapov</name>
<email>dpotapov@gmail.com</email>
</author>
<published>2008-07-16T15:39:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f66cf96d7c613a8129436a5d76ef7b74ee302436'/>
<id>urn:sha1:f66cf96d7c613a8129436a5d76ef7b74ee302436</id>
<content type='text'>
If PATH_MAX on your system is smaller than a path stored in the git repo,
it may cause the buffer overflow in prepare_attr_stack.

Signed-off-by: Dmitry Potapov &lt;dpotapov@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Ignore .gitattributes in bare repositories</title>
<updated>2008-06-09T22:08:26Z</updated>
<author>
<name>René Scharfe</name>
<email>rene.scharfe@lsrfire.ath.cx</email>
</author>
<published>2008-06-08T15:16:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2d35d556e27cd3e7f3d2eea04a7f0d7ee8513f8e'/>
<id>urn:sha1:2d35d556e27cd3e7f3d2eea04a7f0d7ee8513f8e</id>
<content type='text'>
Attributes can be specified at three different places: the internal
table of default values, the file $GIT_DIR/info/attributes and files
named .gitattributes in the work tree.  Since bare repositories don't
have a work tree, git should ignore any .gitattributes files there.

This patch makes git do that, so the only way left for a user to specify
attributes in a bare repository is the file info/attributes (in addition
to changing the defaults and recompiling).

In addition, git-check-attr is now allowed to run without a work tree.
Like any user of the code in attr.c, it ignores the .gitattributes files
when run in a bare repository.  It can still read from info/attributes.

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>gitattributes: Fix subdirectory attributes specified from root directory</title>
<updated>2008-04-23T04:12:37Z</updated>
<author>
<name>Matthew Ogilvie</name>
<email>mmogilvi_git@miniinfo.net</email>
</author>
<published>2008-04-22T18:19:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=82881b38235d0a46a4486dc5dc819c5d0ee3f2c1'/>
<id>urn:sha1:82881b38235d0a46a4486dc5dc819c5d0ee3f2c1</id>
<content type='text'>
Signed-off-by: Matthew Ogilvie &lt;mmogilvi_git@miniinfo.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>gitattributes: fix relative path matching</title>
<updated>2008-02-07T08:04:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-02-07T08:02:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cf94ccda356cc732a883f16342440330d3f644ec'/>
<id>urn:sha1:cf94ccda356cc732a883f16342440330d3f644ec</id>
<content type='text'>
There was an embarrassing pair of off-by-one miscounting that
failed to match path "a/b/c" when "a/.gitattributes" tried to
name it with relative path "b/c".

This fixes it.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'maint'</title>
<updated>2007-10-19T05:18:55Z</updated>
<author>
<name>Shawn O. Pearce</name>
<email>spearce@spearce.org</email>
</author>
<published>2007-10-19T05:18:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f5bf6feb05b8c89c448ded6e6fad0eb58ef35463'/>
<id>urn:sha1:f5bf6feb05b8c89c448ded6e6fad0eb58ef35463</id>
<content type='text'>
* maint:
  Further 1.5.3.5 fixes described in release notes
  Avoid invoking diff drivers during git-stash
  attr: fix segfault in gitattributes parsing code
  Define NI_MAXSERV if not defined by operating system
  Ensure we add directories in the correct order
  Avoid scary errors about tagged trees/blobs during git-fetch
</content>
</entry>
</feed>
