gitweb: Use git-for-each-ref to generate list of heads and/or tagsgitweb/for-each-ref
commit4d86b34d49dd1f18da465952be8306348fef5150
authorJakub Narebski <jnareb@gmail.com>
Thu, 2 Nov 2006 19:14:15 +0000 (2 20:14 +0100)
committerJakub Narebski <jnareb@gmail.com>
Thu, 2 Nov 2006 19:14:15 +0000 (2 20:14 +0100)
tree05a5f4e4b1bdad6bd9396c9a7d507418d92b26ca
parentfa1a32c9a7c8a31b122df7d07f4a8885cbe120d0
gitweb: Use git-for-each-ref to generate list of heads and/or tags

Add two subroutines: git_get_heads_list and git_get_refs_list, which
fill out needed parts of refs info (heads and tags respectively) info
using single call to git-for-each-ref, instead of using
git-peek-remote to get list of references and using parse_ref for each
ref to get ref info, which in turn uses at least one call of git
command.

Replace call to git_get_refs_list in git_summary by call to
git_get_references, git_get_heads_list and git_get_tags_list
(simplifying this subroutine a bit). Use git_get_heads_list in
git_heads and git_get_tags_list in git_tags. Modify git_tags_body
slightly to accept output from git_get_tags_list.

Remove no longer used, and a bit hackish, git_get_refs_list.
parse_ref is no longer used, but is left for now.

Generating "summary" and "tags" views should be much faster for
projects which have large number of tags.

CHANGES IN OUTPUT: Before, if ref in refs/tags was tag pointing to
commit we used committer epoch as epoch for ref, and used tagger epoch
as epoch only for tag pointing to object of other type. If ref in
refs/tags was commit, we used committer epoch as epoch for ref (see
parse_ref; we sorted in gitweb by 'epoch' field).

Currently we use committer epoch for refs pointing to commit objects,
and tagger epoch for refs pointing to tag object, even if tag points
to commit. Going back to old behavior needs additional changes to
git-for-each-ref sorting (sort by given field and use other if first
is not available, --sort=<key>|<key>).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
gitweb/gitweb.perl