git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gitweb $export_ok question
@ 2008-12-29 20:26 Thomas Amsler
  2008-12-30 22:37 ` Jakub Narebski
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Amsler @ 2008-12-29 20:26 UTC (permalink / raw)
  To: git@vger.kernel.org

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?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gitweb $export_ok question
  2008-12-29 20:26 gitweb $export_ok question Thomas Amsler
@ 2008-12-30 22:37 ` Jakub Narebski
  2008-12-30 23:02   ` Jakub Narebski
       [not found]   ` <6db6bed70812302037w54fe5640of234cd611f5ab45e@mail.gmail.com>
  0 siblings, 2 replies; 7+ messages in thread
From: Jakub Narebski @ 2008-12-30 22:37 UTC (permalink / raw)
  To: Thomas Amsler; +Cc: git@vger.kernel.org

Thomas Amsler <tpamsler@ucdavis.edu> writes:

> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gitweb $export_ok question
  2008-12-30 22:37 ` Jakub Narebski
@ 2008-12-30 23:02   ` Jakub Narebski
       [not found]   ` <6db6bed70812302037w54fe5640of234cd611f5ab45e@mail.gmail.com>
  1 sibling, 0 replies; 7+ messages in thread
From: Jakub Narebski @ 2008-12-30 23:02 UTC (permalink / raw)
  To: Thomas Amsler; +Cc: git@vger.kernel.org

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gitweb $export_ok question
       [not found]   ` <6db6bed70812302037w54fe5640of234cd611f5ab45e@mail.gmail.com>
@ 2008-12-31  9:00     ` Jakub Narebski
       [not found]       ` <6db6bed70812311013l3cf575c1y874e71e70d1dde57@mail.gmail.com>
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Narebski @ 2008-12-31  9:00 UTC (permalink / raw)
  To: Thomas Amsler; +Cc: git@vger.kernel.org

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gitweb $export_ok question
       [not found]       ` <6db6bed70812311013l3cf575c1y874e71e70d1dde57@mail.gmail.com>
@ 2008-12-31 18:56         ` Thomas Amsler
       [not found]         ` <6db6bed70812311027g3be1cfbei35c014243237fd59@mail.gmail.com>
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Amsler @ 2008-12-31 18:56 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: git@vger.kernel.org

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:
> 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
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: gitweb $export_ok question
       [not found]         ` <6db6bed70812311027g3be1cfbei35c014243237fd59@mail.gmail.com>
@ 2009-01-01 22:51           ` Jakub Narebski
  2009-01-03 13:23             ` [PATCH] gitweb: Document that gitweb deals with bare repositories Jakub Narebski
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Narebski @ 2009-01-01 22:51 UTC (permalink / raw)
  To: Thomas Amsler; +Cc: git@vger.kernel.org

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:

> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] gitweb: Document that gitweb deals with bare repositories
  2009-01-01 22:51           ` Jakub Narebski
@ 2009-01-03 13:23             ` Jakub Narebski
  0 siblings, 0 replies; 7+ messages in thread
From: Jakub Narebski @ 2009-01-03 13:23 UTC (permalink / raw)
  To: Thomas Amsler; +Cc: git@vger.kernel.org

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:

> 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-01-03 13:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-29 20:26 gitweb $export_ok question Thomas Amsler
2008-12-30 22:37 ` Jakub Narebski
2008-12-30 23:02   ` Jakub Narebski
     [not found]   ` <6db6bed70812302037w54fe5640of234cd611f5ab45e@mail.gmail.com>
2008-12-31  9:00     ` Jakub Narebski
     [not found]       ` <6db6bed70812311013l3cf575c1y874e71e70d1dde57@mail.gmail.com>
2008-12-31 18:56         ` Thomas Amsler
     [not found]         ` <6db6bed70812311027g3be1cfbei35c014243237fd59@mail.gmail.com>
2009-01-01 22:51           ` Jakub Narebski
2009-01-03 13:23             ` [PATCH] gitweb: Document that gitweb deals with bare repositories Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).