List for cgit developers and users
 help / color / mirror / Atom feed
* repo.snapshot-prefix not working
@ 2018-07-17 16:24 konstantin
  2018-07-17 16:38 ` [PATCH] Record repo.snapshot-prefix in the per-repo config konstantin
  0 siblings, 1 reply; 4+ messages in thread
From: konstantin @ 2018-07-17 16:24 UTC (permalink / raw)


Hi, all:

Sorry that I didn't catch this earlier, but it looks like
repo.snapshot-prefix is not working, at least when I add it to the
repo-specific location in repo.git/cgitrc. I would guess this is because
the corresponding 'repo.snapshot-prefix' is missing from print_repo() in
cgit.c, so this setting is never added to the rc- file.

Best,
-- 
Konstantin Ryabitsev
Director, IT Infrastructure Security
The Linux Foundation

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20180717/bc2bef0b/attachment.asc>


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

* [PATCH] Record repo.snapshot-prefix in the per-repo config
  2018-07-17 16:24 repo.snapshot-prefix not working konstantin
@ 2018-07-17 16:38 ` konstantin
  2018-07-17 16:57   ` john
  2018-07-17 17:12   ` Jason
  0 siblings, 2 replies; 4+ messages in thread
From: konstantin @ 2018-07-17 16:38 UTC (permalink / raw)


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 <konstantin at linuxfoundation.org>
---
 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/cgit/attachments/20180717/a1c66f10/attachment.asc>


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

* [PATCH] Record repo.snapshot-prefix in the per-repo config
  2018-07-17 16:38 ` [PATCH] Record repo.snapshot-prefix in the per-repo config konstantin
@ 2018-07-17 16:57   ` john
  2018-07-17 17:12   ` Jason
  1 sibling, 0 replies; 4+ messages in thread
From: john @ 2018-07-17 16:57 UTC (permalink / raw)


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 <konstantin at linuxfoundation.org>

Reviewed-by: John Keeping <john at keeping.me.uk>

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


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

* [PATCH] Record repo.snapshot-prefix in the per-repo config
  2018-07-17 16:38 ` [PATCH] Record repo.snapshot-prefix in the per-repo config konstantin
  2018-07-17 16:57   ` john
@ 2018-07-17 17:12   ` Jason
  1 sibling, 0 replies; 4+ messages in thread
From: Jason @ 2018-07-17 17:12 UTC (permalink / raw)


Thanks! Applied.

Jason


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

end of thread, other threads:[~2018-07-17 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-17 16:24 repo.snapshot-prefix not working konstantin
2018-07-17 16:38 ` [PATCH] Record repo.snapshot-prefix in the per-repo config konstantin
2018-07-17 16:57   ` john
2018-07-17 17:12   ` Jason

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