<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/commit.c, branch v0.99.8e</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v0.99.8e</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v0.99.8e'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2005-09-15T21:57:52Z</updated>
<entry>
<title>[PATCH] Avoid wasting memory in git-rev-list</title>
<updated>2005-09-15T21:57:52Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@osdl.org</email>
</author>
<published>2005-09-15T21:43:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=60ab26de9970ce829c95eb11ebb407fe95780148'/>
<id>urn:sha1:60ab26de9970ce829c95eb11ebb407fe95780148</id>
<content type='text'>
As pointed out on the list, git-rev-list can use a lot of memory.

One low-hanging fruit is to free the commit buffer for commits that we
parse. By default, parse_commit() will save away the buffer, since a lot
of cases do want it, and re-reading it continually would be unnecessary.
However, in many cases the buffer isn't actually necessary and saving it
just wastes memory.

We could just free the buffer ourselves, but especially in git-rev-list,
we actually end up using the helper functions that automatically add
parent commits to the commit lists, so we don't actually control the
commit parsing directly.

Instead, just make this behaviour of "parse_commit()" a global flag.
Maybe this is a bit tasteless, but it's very simple, and it makes a
noticable difference in memory usage.

Before the change:

	[torvalds@g5 linux]$ /usr/bin/time git-rev-list v2.6.12..HEAD &gt; /dev/null
	0.26user 0.02system 0:00.28elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
	0inputs+0outputs (0major+3714minor)pagefaults 0swaps

after the change:

	[torvalds@g5 linux]$ /usr/bin/time git-rev-list v2.6.12..HEAD &gt; /dev/null
	0.26user 0.00system 0:00.27elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
	0inputs+0outputs (0major+2433minor)pagefaults 0swaps

note how the minor faults have decreased from 3714 pages to 2433 pages.
That's all due to the fewer anonymous pages allocated to hold the comment
buffers and their metadata.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Fix compilation warnings.</title>
<updated>2005-08-30T04:17:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-08-30T04:17:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=5de36bfec9beb65f8d0328b367dcf0e7d74d30bb'/>
<id>urn:sha1:5de36bfec9beb65f8d0328b367dcf0e7d74d30bb</id>
<content type='text'>
... found by compiling them with gcc 2.95.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Revert "Replace zero-length array decls with []."</title>
<updated>2005-08-29T19:41:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-08-29T19:41:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=2c04662d89eaa55cecb6effd743c17051d1458ec'/>
<id>urn:sha1:2c04662d89eaa55cecb6effd743c17051d1458ec</id>
<content type='text'>
This reverts 6c5f9baa3bc0d63e141e0afc23110205379905a4 commit, whose
change breaks gcc-2.95.

Not that I ignore portability to compilers that are properly C99, but
keeping compilation with GCC working is more important, at least for
now.  We would probably end up declaring with "name[1]" and teach the
allocator to subtract one if we really aimed for portability, but that
is left for later rounds.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Replace zero-length array decls with [].</title>
<updated>2005-08-24T03:41:11Z</updated>
<author>
<name>Jason Riedy</name>
<email>ejr@cs.berkeley.edu</email>
</author>
<published>2005-08-23T20:31:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=6c5f9baa3bc0d63e141e0afc23110205379905a4'/>
<id>urn:sha1:6c5f9baa3bc0d63e141e0afc23110205379905a4</id>
<content type='text'>
C99 denotes variable-sized members with [], not [0].

Signed-off-by: Jason Riedy &lt;ejr@cs.berkeley.edu&gt;
</content>
</entry>
<entry>
<title>[PATCH] Add 'git show-branch'.</title>
<updated>2005-08-23T01:34:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-08-21T09:51:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f76412ed6dbf2f9863115ee38f4198368dbaf7b1'/>
<id>urn:sha1:f76412ed6dbf2f9863115ee38f4198368dbaf7b1</id>
<content type='text'>
The 'git show-branches' command turns out to be reasonably useful,
but painfully slow.  So rewrite it in C, using ideas from merge-base
while enhancing it a bit more.

 - Unlike show-branches, it can take --heads (show me all my
   heads), --tags (show me all my tags), or --all (both).

 - It can take --more=&lt;number&gt; to show beyond the merge-base.

 - It shows the short name for each commit in the extended SHA1
   syntax.

 - It can find merge-base for more than two heads.

Examples:

    $ git show-branch --more=6 HEAD

    is almost the same as "git log --pretty=oneline --max-count=6".

    $ git show-branch --merge-base master mhf misc

    finds the merge base of the three given heads.

    $ git show-branch master mhf misc

    shows logs from the top of these three branch heads, up to their
    common ancestor commit is shown.

    $ git show-branch --all --more=10

    is poor-man's gitk, showing all the tags and heads, and
    going back 10 commits beyond the merge base of those refs.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Introduce --pretty=oneline format.</title>
<updated>2005-08-10T05:28:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-08-09T05:15:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=d87449c553262a24df26648633c7c73b2db7dcc6'/>
<id>urn:sha1:d87449c553262a24df26648633c7c73b2db7dcc6</id>
<content type='text'>
This introduces --pretty=oneline to git-rev-tree and
git-rev-list commands to show only the first line of the commit
message, without frills. 

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Fix send-pack for non-commitish tags.</title>
<updated>2005-08-05T07:47:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-08-05T07:47:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=37fde874c2448ae2cd98abe24df2bd2a50aa2cda'/>
<id>urn:sha1:37fde874c2448ae2cd98abe24df2bd2a50aa2cda</id>
<content type='text'>
Again I left the v2.6.11-tree tag behind.  My bad.

This commit makes sure that we do not barf when pushing a ref
that is a non-commitish tag.  You can update a remote ref under
the following conditions:

 * You can always use --force.
 * Creating a brand new ref is OK.
 * If the remote ref is exactly the same as what you are
   pushing, it is OK (nothing is pushed).
 * You can replace a commitish with another commitish which is a
   descendant of it, if you can verify the ancestry between them;
   this and the above means you have to have what you are replacing.
 * Otherwise you cannot update; you need to use --force.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Teach parse_commit_buffer about grafting.</title>
<updated>2005-07-31T18:58:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-07-30T07:58:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=5da5c8f4cf4fb4e1cbccca4e7cebe70b77cf0b00'/>
<id>urn:sha1:5da5c8f4cf4fb4e1cbccca4e7cebe70b77cf0b00</id>
<content type='text'>
Introduce a new file $GIT_DIR/info/grafts (or $GIT_GRAFT_FILE)
which is a list of "fake commit parent records".  Each line of
this file is a commit ID, followed by parent commit IDs, all
40-byte hex SHA1 separated by a single SP in between.  The
records override the parent information we would normally read
from the commit objects, allowing both adding "fake" parents
(i.e. grafting), and pretending as if a commit is not a child of
some of its real parents (i.e. cauterizing).

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Make "parse_commit()" be a lot more careful</title>
<updated>2005-07-28T01:56:29Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@g5.osdl.org</email>
</author>
<published>2005-07-27T22:12:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f7cc77d78b9ee59dce162a50815ac6c1918a4397'/>
<id>urn:sha1:f7cc77d78b9ee59dce162a50815ac6c1918a4397</id>
<content type='text'>
This was brought on by a bad tree of Thomas Gleixner, where some bogus
commit objects weren't warned about properly

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Dereference tag repeatedly until we get a non-tag.</title>
<updated>2005-07-11T17:13:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>junkio@cox.net</email>
</author>
<published>2005-07-11T06:55:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=013aab8265a806c8d3c9b040485839091bca30f4'/>
<id>urn:sha1:013aab8265a806c8d3c9b040485839091bca30f4</id>
<content type='text'>
When we allow a tag object in place of a commit object, we only
dereferenced the given tag once, which causes a tag that points at a tag
that points at a commit to be rejected.  Instead, dereference tag
repeatedly until we get a non-tag.

This patch makes change to two functions:

 - commit.c::lookup_commit_reference() is used by merge-base,
   rev-tree and rev-parse to convert user supplied SHA1 to that of
   a commit.
 - rev-list uses its own get_commit_reference() to do the same.

Dereferencing tags this way helps both of these uses.

Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
</feed>
