From mboxrd@z Thu Jan 1 00:00:00 1970 From: john at keeping.me.uk (John Keeping) Date: Tue, 17 Jul 2018 17:57:58 +0100 Subject: [PATCH] Record repo.snapshot-prefix in the per-repo config In-Reply-To: <20180717163822.GA17152@work> References: <457baa6b-3bc5-0f7e-1b79-f8c9b05b9c54@linuxfoundation.org> <20180717163822.GA17152@work> Message-ID: <20180717165758.GB6584@john.keeping.me.uk> On Tue, Jul 17, 2018 at 12:38:22PM -0400, Konstantin Ryabitsev wrote: > Even if we find snapshot-prefix in the repo configuration, we are not > writing it out into the rc- file, so setting the value does not have any > effect. > > Signed-off-by: Konstantin Ryabitsev Reviewed-by: John Keeping To clarify why this is a problem, the repo list is cached using our normal caching mechanism so that we don't scan for repositories on every (uncached) request. Without this patch, only the initial request which generates a new repo list will work and any subsequent requests using the cached list will ignore the setting. Of course, if caching is disabled then everything works even without this change (guess how my test environment is set up...!). > --- > cgit.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/cgit.c b/cgit.c > index e2d7891..a39d83a 100644 > --- a/cgit.c > +++ b/cgit.c > @@ -830,6 +830,8 @@ static void print_repo(FILE *f, struct cgit_repo *repo) > fprintf(f, "repo.snapshots=%s\n", tmp ? tmp : ""); > free(tmp); > } > + if (repo->snapshot_prefix) > + fprintf(f, "repo.snapshot-prefix=%s\n", repo->snapshot_prefix); > if (repo->max_stats != ctx.cfg.max_stats) > fprintf(f, "repo.max-stats=%s\n", > cgit_find_stats_periodname(repo->max_stats)); > -- > 2.17.1