List for cgit developers and users
 help / color / mirror / Atom feed
* Have scan-path only pull in unlisted repositories
@ 2015-07-23 23:35 matt.hevern
  2015-07-24  9:21 ` john
  0 siblings, 1 reply; 4+ messages in thread
From: matt.hevern @ 2015-07-23 23:35 UTC (permalink / raw)


Hi All,

I'd like to be able to specify a number of existing git repositories, and
associated descriptions, sections etc, so that they show up orderly via the
web interface - but I'd also like to set up scan-path so that if anyone
pushes new repositories up, then they will be listed as well. This is
because those
pushing up new repositories may not have access (or inclination) to update
the "/etc/cgitrepos" file, but want to be able to access the new repository
via cgit.
Currently when I do this, I get duplicates of the static configured
repositories I have listed via "include=/etc/cgitrepos", and the
repositories scanned via "scan-path=/home/git/repositories".

Is there any way to do something like - tell scan-path to only pull in
repositories which are not already listed - or something similar ?

Thanks,

Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20150724/2226353f/attachment.html>


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

* Have scan-path only pull in unlisted repositories
  2015-07-23 23:35 Have scan-path only pull in unlisted repositories matt.hevern
@ 2015-07-24  9:21 ` john
  2015-07-24 13:42   ` matt.hevern
  0 siblings, 1 reply; 4+ messages in thread
From: john @ 2015-07-24  9:21 UTC (permalink / raw)


On Fri, Jul 24, 2015 at 09:35:05AM +1000, Matt Hevern wrote:
> I'd like to be able to specify a number of existing git repositories, and
> associated descriptions, sections etc, so that they show up orderly via the
> web interface - but I'd also like to set up scan-path so that if anyone
> pushes new repositories up, then they will be listed as well. This is
> because those
> pushing up new repositories may not have access (or inclination) to update
> the "/etc/cgitrepos" file, but want to be able to access the new repository
> via cgit.
> Currently when I do this, I get duplicates of the static configured
> repositories I have listed via "include=/etc/cgitrepos", and the
> repositories scanned via "scan-path=/home/git/repositories".
> 
> Is there any way to do something like - tell scan-path to only pull in
> repositories which are not already listed - or something similar ?

You would need to change shared.c::cgit_add_repo() to check whether the
repository already exists, but I worry that it could be a bit expensive
with a large number of repositories.

Have you considered just using scan-path and storing the configuration
in the individual repositories?  CGit will read extra configuration for
each repository from a "cgitrc" file in the repository or from the Git
config file (if "enable-git-config" is set).


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

* Have scan-path only pull in unlisted repositories
  2015-07-24  9:21 ` john
@ 2015-07-24 13:42   ` matt.hevern
  2015-07-24 13:47     ` john
  0 siblings, 1 reply; 4+ messages in thread
From: matt.hevern @ 2015-07-24 13:42 UTC (permalink / raw)


On Fri, Jul 24, 2015 at 7:21 PM, John Keeping <john at keeping.me.uk> wrote:

> On Fri, Jul 24, 2015 at 09:35:05AM +1000, Matt Hevern wrote:
> > I'd like to be able to specify a number of existing git repositories, and
> > associated descriptions, sections etc, so that they show up orderly via
> the
> > web interface - but I'd also like to set up scan-path so that if anyone
> > pushes new repositories up, then they will be listed as well. This is
> > because those
> > pushing up new repositories may not have access (or inclination) to
> update
> > the "/etc/cgitrepos" file, but want to be able to access the new
> repository
> > via cgit.
> > Currently when I do this, I get duplicates of the static configured
> > repositories I have listed via "include=/etc/cgitrepos", and the
> > repositories scanned via "scan-path=/home/git/repositories".
> >
> > Is there any way to do something like - tell scan-path to only pull in
> > repositories which are not already listed - or something similar ?
>
> You would need to change shared.c::cgit_add_repo() to check whether the
> repository already exists, but I worry that it could be a bit expensive
> with a large number of repositories.
>
> Have you considered just using scan-path and storing the configuration
> in the individual repositories?  CGit will read extra configuration for
> each repository from a "cgitrc" file in the repository or from the Git
> config file (if "enable-git-config" is set).
>

Thanks - I'll try this. As long as I can pull in new repositories after any
existing described ones, that should be fine.

Cheers,
Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20150724/ce6af361/attachment.html>


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

* Have scan-path only pull in unlisted repositories
  2015-07-24 13:42   ` matt.hevern
@ 2015-07-24 13:47     ` john
  0 siblings, 0 replies; 4+ messages in thread
From: john @ 2015-07-24 13:47 UTC (permalink / raw)


On Fri, Jul 24, 2015 at 11:42:00PM +1000, Matt Hevern wrote:
> On Fri, Jul 24, 2015 at 7:21 PM, John Keeping <john at keeping.me.uk> wrote:
> 
> > On Fri, Jul 24, 2015 at 09:35:05AM +1000, Matt Hevern wrote:
> > > I'd like to be able to specify a number of existing git repositories, and
> > > associated descriptions, sections etc, so that they show up orderly via
> > the
> > > web interface - but I'd also like to set up scan-path so that if anyone
> > > pushes new repositories up, then they will be listed as well. This is
> > > because those
> > > pushing up new repositories may not have access (or inclination) to
> > update
> > > the "/etc/cgitrepos" file, but want to be able to access the new
> > repository
> > > via cgit.
> > > Currently when I do this, I get duplicates of the static configured
> > > repositories I have listed via "include=/etc/cgitrepos", and the
> > > repositories scanned via "scan-path=/home/git/repositories".
> > >
> > > Is there any way to do something like - tell scan-path to only pull in
> > > repositories which are not already listed - or something similar ?
> >
> > You would need to change shared.c::cgit_add_repo() to check whether the
> > repository already exists, but I worry that it could be a bit expensive
> > with a large number of repositories.
> >
> > Have you considered just using scan-path and storing the configuration
> > in the individual repositories?  CGit will read extra configuration for
> > each repository from a "cgitrc" file in the repository or from the Git
> > config file (if "enable-git-config" is set).
> >
> 
> Thanks - I'll try this. As long as I can pull in new repositories after any
> existing described ones, that should be fine.

Do you mean that you need described ones sorted prior to the new ones?
I don't think that will work trivially, but if you put the repositories
into separate sections then it should be possible.

I *think* (but have not tested) that something like this will work:

	section-sort=0
	section=Described
	section=New

	scan-path=/path/to/repos

with described repositories setting "section=Described" (the new ones
should pick up the last "section" before the "scan-path" in the global
cgitrc).


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

end of thread, other threads:[~2015-07-24 13:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-23 23:35 Have scan-path only pull in unlisted repositories matt.hevern
2015-07-24  9:21 ` john
2015-07-24 13:42   ` matt.hevern
2015-07-24 13:47     ` john

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).