gitweb $export_ok question
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?
Quoted 5 lines · Thomas Amsler
Hello,
I am trying to get the gitweb $export_ok to work. According the installation instructions:
Quoted 8 lines
Alternatively, you can configure gitweb to only list and allow viewing of the explicitly exported repositories, via the
GITWEB_EXPORT_OKbuild 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.conffile.
[...]
$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".
Signature · 3 lines
Jakub Narebski Poland ShadeHawk on #git
Quoted 2 lines · Jakub Narebski
in the
GITWEB_CONFIGfile (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).
Signature · 3 lines
Jakub Narebski Poland ShadeHawk on #git
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · Thomas Amsler
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
Quoted 6 lines
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)?
Signature · 2 lines
Jakub Narebski Poland
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
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.
Quoted 10 lines · Thomas Amsler
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.
Signature · 2 lines
Jakub Narebski Poland
PATCH 1/1 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.
---
Quoted 7 lines · Jakub Narebski
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(-)
gitweb/INSTALL +14 -0
@@ -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
gitweb/README +7 -5
@@ -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
Signature · 1 line
1.6.0.4
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
Quoted 47 lines · Thomas Amsler
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,
-- ThomasQuoted 34 lines · Jakub Narebski
Quoted 9 lines · Thomas Amsler
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-okQuoted 7 lines
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html