* [PATCH] gitweb: Support hiding of chosen repositories from project list
@ 2006-10-06 18:28 Petr Baudis
2006-10-07 9:33 ` Junio C Hamano
0 siblings, 1 reply; 5+ messages in thread
From: Petr Baudis @ 2006-10-06 18:28 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
This makes it possible to hide certain repository from project list
(while still keeping it accessible, so it's not just an inverse of
export-ok). By default the file that needs to be created in the
repository is '.hide'.
Signed-off-by: Petr Baudis <pasky@suse.cz>
---
Makefile | 2 ++
gitweb/gitweb.perl | 11 +++++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index a151029..afb29e9 100644
--- a/Makefile
+++ b/Makefile
@@ -125,6 +125,7 @@ GITWEB_HOME_LINK_STR = projects
GITWEB_SITENAME =
GITWEB_PROJECTROOT = /srv/git
GITWEB_EXPORT_OK =
+GITWEB_HIDE_REPO = .hide
GITWEB_STRICT_EXPORT =
GITWEB_BASE_URL =
GITWEB_LIST =
@@ -673,6 +674,7 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl
-e 's|++GITWEB_SITENAME++|$(GITWEB_SITENAME)|g' \
-e 's|++GITWEB_PROJECTROOT++|$(GITWEB_PROJECTROOT)|g' \
-e 's|++GITWEB_EXPORT_OK++|$(GITWEB_EXPORT_OK)|g' \
+ -e 's|++GITWEB_HIDE_REPO++|$(GITWEB_HIDE_REPO)|g' \
-e 's|++GITWEB_STRICT_EXPORT++|$(GITWEB_STRICT_EXPORT)|g' \
-e 's|++GITWEB_BASE_URL++|$(GITWEB_BASE_URL)|g' \
-e 's|++GITWEB_LIST++|$(GITWEB_LIST)|g' \
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 3a10124..b06e96a 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -66,6 +66,11 @@ # show repository only if this file exis
# (only effective if this variable evaluates to true)
our $export_ok = "++GITWEB_EXPORT_OK++";
+# hide repository from the list if this file exists
+# (the repository is still accessible, just not shown in the project list)
+# (only effective if this variable evaulates to true)
+our $hide_repo = "++GITWEB_HIDE_REPO++";
+
# only allow viewing of repositories also shown on the overview page
our $strict_export = "++GITWEB_STRICT_EXPORT++";
@@ -864,7 +869,8 @@ sub git_get_projects_list {
my $subdir = substr($File::Find::name, $pfxlen + 1);
# we check related file in $projectroot
- if (check_export_ok("$projectroot/$subdir")) {
+ if ((!$hide_repo or ! -e "$projectroot/$subdir/$hide_repo")
+ and check_export_ok("$projectroot/$subdir")) {
push @list, { path => $subdir };
$File::Find::prune = 1;
}
@@ -885,7 +891,8 @@ sub git_get_projects_list {
if (!defined $path) {
next;
}
- if (check_export_ok("$projectroot/$path")) {
+ if ((!$hide_repo or ! -e "$projectroot/$path/$hide_repo")
+ and check_export_ok("$projectroot/$path")) {
my $pr = {
path => $path,
owner => decode("utf8", $owner, Encode::FB_DEFAULT),
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] gitweb: Support hiding of chosen repositories from project list
2006-10-06 18:28 [PATCH] gitweb: Support hiding of chosen repositories from project list Petr Baudis
@ 2006-10-07 9:33 ` Junio C Hamano
2006-10-07 12:32 ` Petr Baudis
0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2006-10-07 9:33 UTC (permalink / raw)
To: Petr Baudis; +Cc: git
Petr Baudis <pasky@suse.cz> writes:
> @@ -125,6 +125,7 @@ GITWEB_HOME_LINK_STR = projects
> GITWEB_SITENAME =
> GITWEB_PROJECTROOT = /srv/git
What code base are you working on?
> GITWEB_EXPORT_OK =
> +GITWEB_HIDE_REPO = .hide
> GITWEB_STRICT_EXPORT =
> GITWEB_BASE_URL =
> GITWEB_LIST =
I see how this feature would be useful, but I am not happy to
add random new files under $GIT_DIR/.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gitweb: Support hiding of chosen repositories from project list
2006-10-07 9:33 ` Junio C Hamano
@ 2006-10-07 12:32 ` Petr Baudis
2006-10-07 18:48 ` Martin Waitz
2006-10-07 19:50 ` Junio C Hamano
0 siblings, 2 replies; 5+ messages in thread
From: Petr Baudis @ 2006-10-07 12:32 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Dear diary, on Sat, Oct 07, 2006 at 11:33:30AM CEST, I got a letter
where Junio C Hamano <junkio@cox.net> said that...
> Petr Baudis <pasky@suse.cz> writes:
>
> > @@ -125,6 +125,7 @@ GITWEB_HOME_LINK_STR = projects
> > GITWEB_SITENAME =
> > GITWEB_PROJECTROOT = /srv/git
>
> What code base are you working on?
Oops. This is the only custom Makefile change I use at repo.or.cz, it
kind of slipped through. Yes, I should throw it to Makefile.config or
something.
(BTW, I privately consider /pub/git as completely specific to kernel.org
setup and pure evil to have as default; I would much prefer to have the
default something more standard and LHS-compliant like /srv/git (almost)
is. Though I can see the possible pitfalls of changing the default at
this point (though Google says that only tipc.cslab.ericsson.net uses
the same path), this default leads to people inventing own random paths
and chaos reigns: /var/git in Gentoo, /srv/git in SUSE, abomination like
/var/cache/git (!) in Debian, others don't seem to bother with gitweb.)
> > GITWEB_EXPORT_OK =
> > +GITWEB_HIDE_REPO = .hide
> > GITWEB_STRICT_EXPORT =
> > GITWEB_BASE_URL =
> > GITWEB_LIST =
>
> I see how this feature would be useful, but I am not happy to
> add random new files under $GIT_DIR/.
Ok, so it's another thing in the conffile-parser queue.
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gitweb: Support hiding of chosen repositories from project list
2006-10-07 12:32 ` Petr Baudis
@ 2006-10-07 18:48 ` Martin Waitz
2006-10-07 19:50 ` Junio C Hamano
1 sibling, 0 replies; 5+ messages in thread
From: Martin Waitz @ 2006-10-07 18:48 UTC (permalink / raw)
To: Petr Baudis; +Cc: Junio C Hamano, git
[-- Attachment #1: Type: text/plain, Size: 571 bytes --]
hoi :)
On Sat, Oct 07, 2006 at 02:32:00PM +0200, Petr Baudis wrote:
> (BTW, I privately consider /pub/git as completely specific to kernel.org
> setup and pure evil to have as default; I would much prefer to have the
> default something more standard and LHS-compliant like /srv/git (almost)
> is. Though I can see the possible pitfalls of changing the default at
> this point (though Google says that only tipc.cslab.ericsson.net uses
> the same path)
Well, Google is not always right.
I know at least one more site with this path ;-)
--
Martin Waitz
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gitweb: Support hiding of chosen repositories from project list
2006-10-07 12:32 ` Petr Baudis
2006-10-07 18:48 ` Martin Waitz
@ 2006-10-07 19:50 ` Junio C Hamano
1 sibling, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2006-10-07 19:50 UTC (permalink / raw)
To: Petr Baudis; +Cc: git
Petr Baudis <pasky@suse.cz> writes:
> (BTW, I privately consider /pub/git as completely specific to kernel.org
> setup and pure evil to have as default; I would much prefer to have the
> default something more standard and LHS-compliant like /srv/git (almost)
> is. Though I can see the possible pitfalls of changing the default at
> this point (though Google says that only tipc.cslab.ericsson.net uses
> the same path), this default leads to people inventing own random paths
> and chaos reigns: /var/git in Gentoo, /srv/git in SUSE, abomination like
> /var/cache/git (!) in Debian, others don't seem to bother with gitweb.)
While I share the same concern to some degree, distro's usually
use whatever path they want to be consistent with their layout
(which I hope to converge to LHS or something). As long as we
have it easily overridable from their build system (which we do)
it should not matter too much for them. For people who build
and install their own, I suspect most of them do so because they
do not either like the version installed by the sysadmin or they
cannot write into system-wide directories, so to them the path
needs to be redefined to point at elsewhere anyway and would not
be an issue either. But my guess might be grossly wrong.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-10-07 19:50 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-06 18:28 [PATCH] gitweb: Support hiding of chosen repositories from project list Petr Baudis
2006-10-07 9:33 ` Junio C Hamano
2006-10-07 12:32 ` Petr Baudis
2006-10-07 18:48 ` Martin Waitz
2006-10-07 19:50 ` Junio C Hamano
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).