[Lxr-general] [PATCH 10/10] Some examples to get all tags of a GIT repo as versions.
Brought to you by:
ajlittoz
From: Jan-Benedict G. <jb...@lu...> - 2006-12-07 10:17:54
|
--- templates/lxr.conf | 39 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 39 insertions(+), 0 deletions(-) diff --git a/templates/lxr.conf b/templates/lxr.conf index 06b7011..08a35ab 100644 --- a/templates/lxr.conf +++ b/templates/lxr.conf @@ -60,6 +60,45 @@ # ($files->allreleases($LXR::Common::pathname), # $files->allrevisions($LXR::Common::pathname)) # }, # deferred function call. + # + # When using a GIT repo, you can use its tags + # to create a list of versions. As an extra + # bonus, with the Linux::KernelSort Perl module, + # you can properly sort kernel versions. Just + # leave it off for generic projects. + # + # Simple example for any GIT repo: + # 'range' => sub { + # my $some_dir = "/path/to/project/.git/refs/tags"; + # opendir (DIR, $some_dir) || die "cannot opendir $some_dir: $!"; + # my @files = grep { -f "$some_dir/$_" } readdir (DIR); + # closedir DIR; + # return sort @files; + # }, + # + # Advanced example for Linus's upstream + # linux-2.6 kernel repository: + # 'range' => sub { + # use Linux::KernelSort; + # my $kernel = new Linux::KernelSort; + # + # my $some_dir = "/path/to/linux-2.6/.git/refs/tags"; + # opendir (DIR, $some_dir) || die "cannot opendir $some_dir: $!"; + # my @files = grep { -f "$some_dir/$_" } readdir (DIR); + # closedir DIR; + # # Linus's tags all have a leading "v" + # # which we must cut off for sorting + # # add again afterwards. + # for (my $i = 0; $i < scalar (@files); $i++) { + # $files[$i] =~ s/^v//; + # } + # @files = $kernel->sort (@files); + # for (my $i = 0; $i < scalar (@files); $i++) { + # $files[$i] =~ s/^/v/; + # } + # + # return @files; + # }, # The default version to display 'default' => '1.0.6' -- 1.4.4.1 |