threads / discuss / 16916

gitweb $export_ok question

Subject: gitweb $export_ok question

## tl;dr

7 messages between Dec 29, 2008 and Jan 3, 2009.

replies: 6people: 2as markdown or json

Thomas Amsler· Dec 29, 2008, 20:26 UTC · lore
Hello,
I am trying to get the gitweb $export_ok to  work. According the installation instructions:

Alternatively, you can configure gitweb to only list and allow viewing of the explicitly exported repositories, via the

GITWEB_EXPORT_OK build configuration variable (or the $export_ok variable in gitweb config file). If it evaluates to true, gitweb shows repositories only if this file exists in its object database (if directory has the magic file named $export_ok).

... I set $export_ok = "true" in my /etc/gitweb.conf file. I don't know what "file" needs to be added to a repository in order for it to show up again in gitweb. I have tried several things, like specifying the file name in /etc/gitweb.con:
$export_ok ="magic-file-name"
etc. but that doesn't seem to work.
What am I doing wrong here?
Jakub Narebski· Dec 30, 2008, 22:37 UTC · re: Thomas Amsler · lore

Re: gitweb $export_ok question

Thomas Amsler <tpamsler@ucdavis.edu> writes:
Show 13 quoted lines
> Hello,
> 
> I am trying to get the gitweb $export_ok to work. According the
> installation instructions:
> 
>   Alternatively, you can configure gitweb to only list and allow
>   viewing of the explicitly exported repositories, via the
>   GITWEB_EXPORT_OK build configuration variable (or the $export_ok
>   variable in gitweb config file). If it evaluates to true, gitweb
>   shows repositories only if this file exists in its object database
>   (if directory has the magic file named $export_ok).
> 
> ... I set $export_ok = "true" in my /etc/gitweb.conf file.
[...]
$export_ok is not a boolean, is the _name_ of a file, which if it
is present, then repository is exported to gitweb, and if it is not,
it is invisible to gitweb. It means that if for example we have
  $export_ok = "gitweb-export-ok";
in the GITWEB_CONFIG file (usually gitweb_config.perl, installed
in the same place as gitweb.cgi), the repo.git is exported only
if it has file gitweb-export-ok in it.

This mechanism is similar to git-daemon and its magic file "git-daemon-export-ok".

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Jakub Narebski· Dec 30, 2008, 23:02 UTC · re: Jakub Narebski · lore

Re: gitweb $export_ok question

Jakub Narebski <jnareb@gmail.com> writes:
> in the GITWEB_CONFIG file (usually gitweb_config.perl, installed
> in the same place as gitweb.cgi) [...]

I'm sorry, I forgot about GITWEB_CONFIG_SYSTEM which as you wrote is by default /etc/gitweb.conf (and is also Perl).

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Jakub Narebski· Dec 31, 2008, 09:00 UTC · lore

Re: gitweb $export_ok question

Thomas Amsler wrote:
Show 15 quoted lines
> Thank you for your information.
> 
> I have just tried that but the repository doesn't show up in gitweb
> 
> - added to /etc/gitweb.conf
> -- $export_ok = "gitweb-export-ok"
> - touched the "gitweb-export-ok" file in the repository
> -- touch /path-to-repo/repository/authz.git/gitweb-export-ok
> 
> Then gitweb reports:
> 
> 404 - No projects found
> 
> Does the gitweb-export-ok file need to be part of  the repo so that it is
> tracked?

No, gitweb-export-ok file has to be in $GIT_DIR (like description file), not part of repo.

As to "No projects found" error: what is your $projectroot? Is it either "/path-to-repo/repository" or "/path-to-repo"? Is repository readable and searchable for the web server user (does it have correct permissions)?

-- 
Jakub Narebski
Poland
Thomas Amsler· Dec 31, 2008, 18:56 UTC · lore

Re: gitweb $export_ok question

One more question. Now, on the gitweb home page, the project name hyper link shows up as:

authz.git/.git
where it used to be just:
authz.git/
is there a way to configure this so that it doesn't show the trailing .git?

Best, -- Thomas

On Wed, Dec 31, 2008 at 10:13 AM, Thomas Amsler <tpamsler@ucdavis.edu> wrote:
Show 47 quoted lines
> That did the trick. It wasn't quite clear from the documentation that the
> file defined by $export_ok has to be located in repository/.git/
>
> Thank you for your help.
>
> Best,
> -- Thomas
>
>
>
> On Wed, Dec 31, 2008 at 1:00 AM, Jakub Narebski <jnareb@gmail.com> wrote:
>>
>> Thomas Amsler wrote:
>>
>> > Thank you for your information.
>> >
>> > I have just tried that but the repository doesn't show up in gitweb
>> >
>> > - added to /etc/gitweb.conf
>> > -- $export_ok = "gitweb-export-ok"
>> > - touched the "gitweb-export-ok" file in the repository
>> > -- touch /path-to-repo/repository/authz.git/gitweb-export-ok
>> >
>> > Then gitweb reports:
>> >
>> > 404 - No projects found
>> >
>> > Does the gitweb-export-ok file need to be part of  the repo so that it
>> > is
>> > tracked?
>>
>> No, gitweb-export-ok file has to be in $GIT_DIR (like description file),
>> not part of repo.
>>
>> As to "No projects found" error: what is your $projectroot? Is it
>> either "/path-to-repo/repository" or "/path-to-repo"? Is repository
>> readable and searchable for the web server user (does it have correct
>> permissions)?
>> --
>> Jakub Narebski
>> Poland
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
Jakub Narebski· Jan 1, 2009, 22:51 UTC · lore

Re: gitweb $export_ok question

Two requests: could you please do not toppost, as it goes against natural flow of discussion and reading, but rather quote relevant parts and respond below? It would be good to not try to send HTML mail, as it is forbidden by VGER anti-SPAM filter, so you trying to send HTML-formatted email result in me getting two copies: one with and one without HTML version.

On Wed, 31 Dec 2008, Thomas Amsler wrote:
Show 10 quoted lines
> One more question. Now, on the gitweb home page, the project name hyper link
> shows up as:
> 
> authz.git/.git
> 
> where it used to be just:
> 
> authz.git/
> 
> is there a way to configure this so that it doesn't show the trailing .git?

I'm afraid it is not possible without modifying gitweb, unless you use symlinks in place of real repositories, i.e. if you have authz.git in $projectroot being symlink to authz.git/.git or even authz/.git (which might be somewhere else).

For example I have /home/local/scm/git.git be symlink to ~/git/.git

The longer explanation (which probably should made into gitweb/README or gitweb/INSTALL) is that gitweb is meant to deal with _bare_ repositories; gitweb doesn't touch and doesn't examine working area of "live" (non-bare) repository. If you host git repositories (like kernel.org, freedesktop.org or repo.or.cz) you usually host them bare (public repositories should be bare); but you might want to have gitweb for your own repository too.

-- 
Jakub Narebski
Poland
Jakub Narebski· Jan 3, 2009, 13:23 UTC · re: Jakub Narebski · lore

[PATCH] gitweb: Document that gitweb deals with bare repositories

Add reminders to gitweb/README and gitweb/INSTALL that gitweb works with bare repositories. While it might be obvious to us, it is not apparently as evident for newcomers.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
On Thu, 1 Jan 2009, Jakub Narebski wrote:
Show 7 quoted lines
> The longer explanation (which probably should made into gitweb/README
> or gitweb/INSTALL) is that gitweb is meant to deal with _bare_ 
> repositories; gitweb doesn't touch and doesn't examine working area
> of "live" (non-bare) repository. If you host git repositories (like
> kernel.org, freedesktop.org or repo.or.cz) you usually host them bare
> (public repositories should be bare); but you might want to have
> gitweb for your own repository too.
And here it is.

By the way, I was wondering if to mark this patch as an RFC, because I am not completely sure about the wording I used...

 gitweb/INSTALL |   14 ++++++++++++++
 gitweb/README  |   12 +++++++-----
 2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/gitweb/INSTALL b/gitweb/INSTALL
index 18c9ce3..f43e233 100644
--- a/gitweb/INSTALL
+++ b/gitweb/INSTALL
@@ -127,6 +127,20 @@ GITWEB_CONFIG file:
 Gitweb repositories
 -------------------
 
+- Gitweb deals with bare repositories, which means that gitweb scans for
+  (in the case where $projects_list is a directory to search for
+  repositories) or has to be provided with list of (in the case where
+  $projects_list is a text file) bare repositories, i.e. $GIT_DIR for
+  each repository. The consequence of that is the fact that if you use
+  gitweb to view non-bare repository named 'repo' then gitweb would show
+  (or would have to be provided with) 'repo/.git'.
+
+  If you want to view a buch of non-bare repositories in gitweb but want
+  them named 'repo.git' as is the standard for bare repositories, you
+  can as a workaround populare $projectroot / $project_list with
+  symbolic links to $GIT_DIR of each project you want to publish (have
+  shown) in gitweb.
+
 - By default all git repositories under projectroot are visible and
   available to gitweb. The list of projects is generated by default by
   scanning the projectroot directory for git repositories (for object
diff --git a/gitweb/README b/gitweb/README
index 825162a..6dbfcd5 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -34,10 +34,11 @@ You can specify the following configuration variables when building GIT:
  * GITWEB_LIST
    Points to a directory to scan for projects (defaults to project root
    if not set / if empty) or to a file with explicit listing of projects
-   (together with projects' ownership). See "Generating projects list
-   using gitweb" in INSTALL file for gitweb to find out how to generate
-   such file from scan of a directory. [No default, which means use root
-   directory for projects]
+   (together with projects' ownership). Note that gitweb deals with bare
+   repositories; it shows/uses $GIT_DIR for each repository. See also
+   "Generating projects list using gitweb" in INSTALL file for gitweb to
+   find out how to generate such file from scan of a directory. 
+   [No default, which means use root directory for projects]
  * GITWEB_EXPORT_OK
    Show repository only if this file exists (in repository).  Only
    effective if this variable evaluates to true.  [No default / Not set]
@@ -153,7 +154,8 @@ not include variables usually directly set during build):
    Absolute filesystem path which will be prepended to project path;
    the path to repository is $projectroot/$project.  Set to
    $GITWEB_PROJECTROOT during installation.  This variable have to be
-   set correctly for gitweb to find repositories.
+   set correctly for gitweb to find repositories.  (Note that gitweb deals
+   with bare repositories.)
  * $projects_list
    Source of projects list, either directory to scan, or text file
    with list of repositories (in the "<URI-encoded repository path> SP
-- 
1.6.0.4

← back to recent threads