summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2007-05-24 12:20:42 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2007-05-24 13:36:54 -0700
commitc075aea5da6c35edfe86da7d3edced67cdb009c8 (patch)
tree1a24063c545e5dc27ca31f6a91b3fe02b60788b5 /object.c
parentDocumentation: fix git-config.xml generation (diff)
downloadtgif-c075aea5da6c35edfe86da7d3edced67cdb009c8.tar.xz
name-rev: tolerate clock skew in committer dates
In git.git repository, "git-name-rev v1.3.0~158" cannot name the rev, while adjacent revs can be named. This was because it gives up traversal from the tips of existing refs as soon as it sees a commit that has older commit timestamp than what is being named. This is usually a good heuristics, but v1.3.0~158 has a slightly older commit timestamp than v1.3.0~157 (i.e. it's child), as these two were made in a separate repostiory (in fact, in a different continent). This adds a hardcoded slop value (1 day) to the cut-off heuristics to work this kind of problem around. The current algorithm essentially runs around from the available tips down to ancient commits and names every single rev available that are newer than cut-off date, so a single day slop would not add that much overhead in repositories with long enough history where the performance of name-rev matters. I think the algorithm could be made a bit smarter by deepening the graph on demand as a new commit is asked to be named (this would require rewriting of name_rev() function not to recurse itself but use a traversal list like revision.c traverser does), but that would be a separate issue. Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'object.c')
0 files changed, 0 insertions, 0 deletions