Commit graph

7 commits

Author SHA1 Message Date
Johannes Schindelin 070879ca93 Use a hashtable for objects instead of a sorted list
In a simple test, this brings down the CPU time from 47 sec to 22 sec.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-02-12 05:12:39 -08:00
Junio C Hamano 2c817df25d name-rev: do not omit leading components of ref name.
In a repository with mainto/1.0 (to keep maintaining the 1.0.X
series) and fixo/1.0 (to keep fixes that apply to both 1.0.X
series and upwards) branches, "git-name-rev mainto/1.0" answered
just "1.0" making things ambiguous.  Show refnames unambiguously
like show-branch does.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-01-11 14:47:20 -08:00
Junio C Hamano f2e6f1c976 name-rev: fix parent counting.
Noticed by linux@horizon.com.  The first merge parent (typically
"our branch") is ^1, not ^0, and the first other branch is ^2.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-28 20:51:44 -08:00
Junio C Hamano 2d76d0d151 name-rev: fix off-by-one error in --stdin.
It dropped the last hexdigit in the object name.

[jc: Noticed and patch supplied by ALASCM, reworked to apply at
the right place by me]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-25 23:36:58 -08:00
Timo Hirvonen bd22c904a0 Fix sparse warnings
Make some functions static and convert func() function prototypes to to
func(void).  Fix declaration after statement, missing declaration and
redundant declaration warnings.

Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-20 22:14:16 -08:00
Junio C Hamano 9534f40bc4 Be careful when dereferencing tags.
One caller of deref_tag() was not careful enough to make sure
what deref_tag() returned was not NULL (i.e. we found a tag
object that points at an object we do not have).  Fix it, and
warn about refs that point at such an incomplete tag where
needed.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-02 16:50:58 -08:00
Johannes Schindelin bd321bcc51 Add git-name-rev
git-name-rev tries to find nice symbolic names for commits. It does so by
walking the commits from the refs. When the symbolic name is ambiguous, the
following heuristic is applied: Try to avoid too many ~'s, and if two ambiguous
names have the same count of ~'s, take the one whose last number is smaller.

With "--tags", the names are derived only from tags.

With "--stdin", the stdin is parsed, and after every sha1 for which a name
could be found, the name is appended. (Try "git log | git name-rev --stdin".)

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-10-26 16:31:58 -07:00