summaryrefslogtreecommitdiff
path: root/name-rev.c
AgeCommit message (Collapse)Author
2006-02-12Use a hashtable for objects instead of a sorted listJohannes Schindelin
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-01-11name-rev: do not omit leading components of ref name.Junio C Hamano
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>
2005-11-29name-rev: fix parent counting.Junio C Hamano
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-26name-rev: fix off-by-one error in --stdin.Junio C Hamano
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-21Fix sparse warningsTimo Hirvonen
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-03Be careful when dereferencing tags.Junio C Hamano
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-10-26Add git-name-revJohannes Schindelin
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>