<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/commit.h, 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>[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>[PATCH] Add a topological sort procedure to commit.c</title>
<updated>2005-07-06T17:19:04Z</updated>
<author>
<name>Jon Seymour</name>
<email>jon.seymour@gmail.com</email>
</author>
<published>2005-07-06T16:39:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=ab580acea4b1b79daaca0c8727b810073a610e2a'/>
<id>urn:sha1:ab580acea4b1b79daaca0c8727b810073a610e2a</id>
<content type='text'>
This introduces an in-place topological sort procedure to commit.c.

Given a list of commits, sort_in_topological_order() will perform an in-place
topological sort of that list.

The invariant that applies to the resulting list is:

       a reachable from b =&gt; ord(b) &lt; ord(a)

This invariant is weaker than the --merge-order invariant, but is cheaper
to calculate (assuming the list has been identified) and will serve any
purpose where only a minimal topological order guarantee is required.

Signed-off-by: Jon Seymour &lt;jon.seymour@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>Make "insert_by_date()" match "commit_list_insert()"</title>
<updated>2005-07-06T16:31:17Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@g5.osdl.org</email>
</author>
<published>2005-07-06T16:31:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=f755494cec27fed8c9693bb91c26762061518b0b'/>
<id>urn:sha1:f755494cec27fed8c9693bb91c26762061518b0b</id>
<content type='text'>
Same argument order, same return type.  This allows us to use a function
pointer to choose one over the other.
</content>
</entry>
<entry>
<title>Add "--pretty=full" format that also shows committer.</title>
<updated>2005-06-27T00:50:46Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@ppc970.osdl.org</email>
</author>
<published>2005-06-27T00:50:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=9b66ec04741b4030e7654dcb7b978a29a8214b31'/>
<id>urn:sha1:9b66ec04741b4030e7654dcb7b978a29a8214b31</id>
<content type='text'>
Also move the common implementation of parsing the --pretty argument
format into commit.c rather than having duplicates in diff-tree.c and
rev-list.c.
</content>
</entry>
<entry>
<title>[PATCH] Anal retentive 'const unsigned char *sha1'</title>
<updated>2005-06-08T20:04:53Z</updated>
<author>
<name>Jason McMullan</name>
<email>jason.mcmullan@timesys.com</email>
</author>
<published>2005-06-03T15:05:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=5d6ccf5ce7f28e576a87f6c6f4f99fae90e06db6'/>
<id>urn:sha1:5d6ccf5ce7f28e576a87f6c6f4f99fae90e06db6</id>
<content type='text'>
Make 'sha1' parameters const where possible

Signed-off-by: Jason McMullan &lt;jason.mcmullan@timesys.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] Modify git-rev-list to linearise the commit history in merge order.</title>
<updated>2005-06-06T16:07:26Z</updated>
<author>
<name>jon@blackcubes.dyndns.org</name>
<email>jon@blackcubes.dyndns.org</email>
</author>
<published>2005-06-06T15:39:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=a3437b8c26a63d971437c8b6ac6f6d4f632be548'/>
<id>urn:sha1:a3437b8c26a63d971437c8b6ac6f6d4f632be548</id>
<content type='text'>
This patch linearises the GIT commit history graph into merge order
which is defined by invariants specified in Documentation/git-rev-list.txt.

The linearisation produced by this patch is superior in an objective sense
to that produced by the existing git-rev-list implementation in that
the linearisation produced is guaranteed to have the minimum number of
discontinuities, where a discontinuity is defined as an adjacent pair of
commits in the output list which are not related in a direct child-parent
relationship.

With this patch a graph like this:

	a4 ---
	| \   \
	|  b4 |
	|/ |  |
	a3 |  |
	|  |  |
	a2 |  |
	|  |  c3
	|  |  |
	|  |  c2
	|  b3 |
	|  | /|
	|  b2 |
	|  |  c1
	|  | /
	|  b1
	a1 |
	|  |
	a0 |
	| /
	root

Sorts like this:

	= a4
	| c3
	| c2
	| c1
	^ b4
	| b3
	| b2
	| b1
	^ a3
	| a2
	| a1
	| a0
	= root

Instead of this:

	= a4
	| c3
	^ b4
	| a3
	^ c2
	^ b3
	^ a2
	^ b2
	^ c1
	^ a1
	^ b1
	^ a0
	= root

A test script, t/t6000-rev-list.sh, includes a test which demonstrates
that the linearisation produced by --merge-order has less discontinuities
than the linearisation produced by git-rev-list without the --merge-order
flag specified. To see this, do the following:

	cd t
	./t6000-rev-list.sh
	cd trash
	cat actual-default-order
	cat actual-merge-order

The existing behaviour of git-rev-list is preserved, by default. To obtain
the modified behaviour, specify --merge-order or --merge-order --show-breaks
on the command line.

This version of the patch has been tested on the git repository and also on the linux-2.6
repository and has reasonable performance on both - ~50-100% slower than the original algorithm.

This version of the patch has incorporated a functional equivalent of the Linus' output limiting
algorithm into the merge-order algorithm itself. This operates per the notes associated
with Linus' commit 337cb3fb8da45f10fe9a0c3cf571600f55ead2ce.

This version has incorporated Linus' feedback regarding proposed changes to rev-list.c.
(see: [PATCH] Factor out filtering in rev-list.c)

This version has improved the way sort_first_epoch marks commits as uninteresting.

For more details about this change, refer to Documentation/git-rev-list.txt
and http://blackcubes.dyndns.org/epoch/.

Signed-off-by: Jon Seymour &lt;jon.seymour@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>pretty_print_commit: add different formats</title>
<updated>2005-06-05T16:02:03Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@ppc970.osdl.org</email>
</author>
<published>2005-06-05T16:02:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=000182eacf99cde27d5916aa415921924b82972c'/>
<id>urn:sha1:000182eacf99cde27d5916aa415921924b82972c</id>
<content type='text'>
You can ask to print out "raw" format (full headers, full body),
"medium" format (author and date, full body) or "short" format
(author only, condensed body).

Use "git-rev-list --pretty=short HEAD | less -S" for an example.
</content>
</entry>
<entry>
<title>Add generic commit "pretty print" function.</title>
<updated>2005-06-01T15:34:23Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@ppc970.osdl.org</email>
</author>
<published>2005-06-01T15:34:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=e3bc7a3bc7b77f44d686003f5a9346a135529f73'/>
<id>urn:sha1:e3bc7a3bc7b77f44d686003f5a9346a135529f73</id>
<content type='text'>
It's really just the header printign function from diff-tree.c,
and it's usable for other things too.
</content>
</entry>
</feed>
