List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH] make "Owner" column on index configurable
@ 2012-03-18 12:39 bluewind
  2012-03-18 20:52 ` larsh
  0 siblings, 1 reply; 7+ messages in thread
From: bluewind @ 2012-03-18 12:39 UTC (permalink / raw)


This is not really needed for personal sites where all repos belong to
the same person. Since it is pretty useful for shared sites however, it
should be configurable.

Signed-off-by: Florian Pritz <bluewind at xinu.at>
---
 cgit.c        |    3 +++
 cgit.h        |    1 +
 cgitrc.5.txt  |    4 ++++
 ui-repolist.c |    9 ++++++---
 4 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/cgit.c b/cgit.c
index 1d50129..475a7f0 100644
--- a/cgit.c
+++ b/cgit.c
@@ -164,6 +164,8 @@ void config_cb(const char *name, const char *value)
 		ctx.cfg.enable_http_clone = atoi(value);
 	else if (!strcmp(name, "enable-index-links"))
 		ctx.cfg.enable_index_links = atoi(value);
+	else if (!strcmp(name, "enable-index-owner"))
+		ctx.cfg.enable_index_owner = atoi(value);
 	else if (!strcmp(name, "enable-commit-graph"))
 		ctx.cfg.enable_commit_graph = atoi(value);
 	else if (!strcmp(name, "enable-log-filecount"))
@@ -331,6 +333,7 @@ static void prepare_context(struct cgit_context *ctx)
 	ctx->cfg.local_time = 0;
 	ctx->cfg.enable_gitweb_owner = 1;
 	ctx->cfg.enable_http_clone = 1;
+	ctx->cfg.enable_index_owner = 1;
 	ctx->cfg.enable_tree_linenumbers = 1;
 	ctx->cfg.max_repo_count = 50;
 	ctx->cfg.max_commit_count = 50;
diff --git a/cgit.h b/cgit.h
index c7ab5c6..44f6238 100644
--- a/cgit.h
+++ b/cgit.h
@@ -199,6 +199,7 @@ struct cgit_config {
 	int enable_gitweb_owner;
 	int enable_http_clone;
 	int enable_index_links;
+	int enable_index_owner;
 	int enable_commit_graph;
 	int enable_log_filecount;
 	int enable_log_linecount;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index a22423b..fd092ad 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -121,6 +121,10 @@ enable-index-links::
 	each repo in the repository index (specifically, to the "summary",
 	"commit" and "tree" pages). Default value: "0".
 
+enable-index-owner::
+	Flag which, when set to "1", will make cgit display the owner of
+	each repo in the repository index. Default value: "1".
+
 enable-log-filecount::
 	Flag which, when set to "1", will make cgit print the number of
 	modified files for each commit on the repository log page. Default
diff --git a/ui-repolist.c b/ui-repolist.c
index a09a689..d57d9f6 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -110,7 +110,8 @@ void print_header(int columns)
 	html("<tr class='nohover'>");
 	print_sort_header("Name", "name");
 	print_sort_header("Description", "desc");
-	print_sort_header("Owner", "owner");
+	if (ctx.cfg.enable_index_owner)
+		print_sort_header("Owner", "owner");
 	print_sort_header("Idle", "idle");
 	if (ctx.cfg.enable_index_links)
 		html("<th class='left'>Links</th>");
@@ -273,8 +274,10 @@ void cgit_print_repolist()
 		html_ntxt(ctx.cfg.max_repodesc_len, ctx.repo->desc);
 		html_link_close();
 		html("</td><td>");
-		html_txt(ctx.repo->owner);
-		html("</td><td>");
+		if (ctx.cfg.enable_index_owner) {
+			html_txt(ctx.repo->owner);
+			html("</td><td>");
+		}
 		print_modtime(ctx.repo);
 		html("</td>");
 		if (ctx.cfg.enable_index_links) {
-- 
1.7.9.4




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

* [PATCH] make "Owner" column on index configurable
  2012-03-18 12:39 [PATCH] make "Owner" column on index configurable bluewind
@ 2012-03-18 20:52 ` larsh
  0 siblings, 0 replies; 7+ messages in thread
From: larsh @ 2012-03-18 20:52 UTC (permalink / raw)


On Sun, Mar 18, 2012 at 01:39:19PM +0100, Florian Pritz wrote:
> This is not really needed for personal sites where all repos belong to
> the same person. Since it is pretty useful for shared sites however, it
> should be configurable.

Thanks, applied to the wip-branch for testing.

--
larsh




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

* [PATCH] make "Owner" column on index configurable
  2013-02-01 11:05   ` cgit
@ 2013-02-01 11:31     ` Jason
  0 siblings, 0 replies; 7+ messages in thread
From: Jason @ 2013-02-01 11:31 UTC (permalink / raw)


On Fri, Feb 1, 2013 at 12:05 PM, Lukas Fleischer <cgit at cryptocrack.de> wrote:
> +1 from me. Note that Lars already applied Florian's patch to his "wip"
> branch back in March 2012 [1] but it never got merged into master for
> some reason.

Great memory, thanks. Merged to master here:

http://git.zx2c4.com/cgit/commit/?id=e2863ca31fdb446f9449941baa71bc2f4c62ca62




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

* [PATCH] make "Owner" column on index configurable
  2013-02-01 10:52 ` Jason
@ 2013-02-01 11:05   ` cgit
  2013-02-01 11:31     ` Jason
  0 siblings, 1 reply; 7+ messages in thread
From: cgit @ 2013-02-01 11:05 UTC (permalink / raw)


On Fri, Feb 01, 2013 at 11:52:32AM +0100, Jason A. Donenfeld wrote:
> On Fri, Feb 1, 2013 at 10:59 AM, Florian Pritz <bluewind at xinu.at> wrote:
> > This is not really needed for personal sites where all repos belong to
> > the same person. Since it is pretty useful for shared sites however, it
> > should be configurable.
> 
> 
> There have been various similar patches floating around for a while
> now. Florian - I think you posted this back in November as well, and
> I've seen other variants.
> 
> I think it'd be a nice thing to have. Anyone have any objections to me
> merging [something similar to] it?

+1 from me. Note that Lars already applied Florian's patch to his "wip"
branch back in March 2012 [1] but it never got merged into master for
some reason.

> 
> _______________________________________________
> cgit mailing list
> cgit at hjemli.net
> http://hjemli.net/mailman/listinfo/cgit

[1] http://www.mail-archive.com/cgit at hjemli.net/msg00506.html




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

* [PATCH] make "Owner" column on index configurable
  2013-02-01  9:59 bluewind
@ 2013-02-01 10:52 ` Jason
  2013-02-01 11:05   ` cgit
  0 siblings, 1 reply; 7+ messages in thread
From: Jason @ 2013-02-01 10:52 UTC (permalink / raw)


On Fri, Feb 1, 2013 at 10:59 AM, Florian Pritz <bluewind at xinu.at> wrote:
> This is not really needed for personal sites where all repos belong to
> the same person. Since it is pretty useful for shared sites however, it
> should be configurable.


There have been various similar patches floating around for a while
now. Florian - I think you posted this back in November as well, and
I've seen other variants.

I think it'd be a nice thing to have. Anyone have any objections to me
merging [something similar to] it?




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

* [PATCH] make "Owner" column on index configurable
@ 2013-02-01  9:59 bluewind
  2013-02-01 10:52 ` Jason
  0 siblings, 1 reply; 7+ messages in thread
From: bluewind @ 2013-02-01  9:59 UTC (permalink / raw)


This is not really needed for personal sites where all repos belong to
the same person. Since it is pretty useful for shared sites however, it
should be configurable.

Signed-off-by: Florian Pritz <bluewind at xinu.at>
---
 cgit.c        | 3 +++
 cgit.h        | 1 +
 cgitrc.5.txt  | 4 ++++
 ui-repolist.c | 9 ++++++---
 4 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/cgit.c b/cgit.c
index a97ed69..11edd81 100644
--- a/cgit.c
+++ b/cgit.c
@@ -172,6 +172,8 @@ void config_cb(const char *name, const char *value)
 		ctx.cfg.enable_http_clone = atoi(value);
 	else if (!strcmp(name, "enable-index-links"))
 		ctx.cfg.enable_index_links = atoi(value);
+	else if (!strcmp(name, "enable-index-owner"))
+		ctx.cfg.enable_index_owner = atoi(value);
 	else if (!strcmp(name, "enable-commit-graph"))
 		ctx.cfg.enable_commit_graph = atoi(value);
 	else if (!strcmp(name, "enable-log-filecount"))
@@ -354,6 +356,7 @@ static void prepare_context(struct cgit_context *ctx)
 	ctx->cfg.logo = "/cgit.png";
 	ctx->cfg.local_time = 0;
 	ctx->cfg.enable_http_clone = 1;
+	ctx->cfg.enable_index_owner = 1;
 	ctx->cfg.enable_tree_linenumbers = 1;
 	ctx->cfg.enable_git_config = 0;
 	ctx->cfg.max_repo_count = 50;
diff --git a/cgit.h b/cgit.h
index 7a99135..f3d2556 100644
--- a/cgit.h
+++ b/cgit.h
@@ -203,6 +203,7 @@ struct cgit_config {
 	int enable_filter_overrides;
 	int enable_http_clone;
 	int enable_index_links;
+	int enable_index_owner;
 	int enable_commit_graph;
 	int enable_log_filecount;
 	int enable_log_linecount;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index c1038d7..4d27d9f 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -120,6 +120,10 @@ enable-index-links::
 	each repo in the repository index (specifically, to the "summary",
 	"commit" and "tree" pages). Default value: "0".
 
+enable-index-owner::
+	Flag which, when set to "1", will make cgit display the owner of
+	each repo in the repository index. Default value: "1".
+
 enable-log-filecount::
 	Flag which, when set to "1", will make cgit print the number of
 	modified files for each commit on the repository log page. Default
diff --git a/ui-repolist.c b/ui-repolist.c
index dead1bf..bbcaa1d 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -115,7 +115,8 @@ void print_header(int columns)
 	html("<tr class='nohover'>");
 	print_sort_header("Name", "name");
 	print_sort_header("Description", "desc");
-	print_sort_header("Owner", "owner");
+	if (ctx.cfg.enable_index_owner)
+		print_sort_header("Owner", "owner");
 	print_sort_header("Idle", "idle");
 	if (ctx.cfg.enable_index_links)
 		html("<th class='left'>Links</th>");
@@ -294,8 +295,10 @@ void cgit_print_repolist()
 		html_ntxt(ctx.cfg.max_repodesc_len, ctx.repo->desc);
 		html_link_close();
 		html("</td><td>");
-		html_txt(ctx.repo->owner);
-		html("</td><td>");
+		if (ctx.cfg.enable_index_owner) {
+			html_txt(ctx.repo->owner);
+			html("</td><td>");
+		}
 		print_modtime(ctx.repo);
 		html("</td>");
 		if (ctx.cfg.enable_index_links) {
-- 
1.8.1.1




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

* [PATCH] make "Owner" column on index configurable
@ 2012-11-15  9:31 bluewind
  0 siblings, 0 replies; 7+ messages in thread
From: bluewind @ 2012-11-15  9:31 UTC (permalink / raw)


This is not really needed for personal sites where all repos belong to
the same person. Since it is pretty useful for shared sites however, it
should be configurable.

Signed-off-by: Florian Pritz <bluewind at xinu.at>
---
Lars said he put this on his wip-branch for testing, but
I think it didn't make it into the new upstream.
 cgit.c        | 3 +++
 cgit.h        | 1 +
 cgitrc.5.txt  | 4 ++++
 ui-repolist.c | 9 ++++++---
 4 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/cgit.c b/cgit.c
index a97ed69..11edd81 100644
--- a/cgit.c
+++ b/cgit.c
@@ -172,6 +172,8 @@ void config_cb(const char *name, const char *value)
 		ctx.cfg.enable_http_clone = atoi(value);
 	else if (!strcmp(name, "enable-index-links"))
 		ctx.cfg.enable_index_links = atoi(value);
+	else if (!strcmp(name, "enable-index-owner"))
+		ctx.cfg.enable_index_owner = atoi(value);
 	else if (!strcmp(name, "enable-commit-graph"))
 		ctx.cfg.enable_commit_graph = atoi(value);
 	else if (!strcmp(name, "enable-log-filecount"))
@@ -354,6 +356,7 @@ static void prepare_context(struct cgit_context *ctx)
 	ctx->cfg.logo = "/cgit.png";
 	ctx->cfg.local_time = 0;
 	ctx->cfg.enable_http_clone = 1;
+	ctx->cfg.enable_index_owner = 1;
 	ctx->cfg.enable_tree_linenumbers = 1;
 	ctx->cfg.enable_git_config = 0;
 	ctx->cfg.max_repo_count = 50;
diff --git a/cgit.h b/cgit.h
index 7a99135..f3d2556 100644
--- a/cgit.h
+++ b/cgit.h
@@ -203,6 +203,7 @@ struct cgit_config {
 	int enable_filter_overrides;
 	int enable_http_clone;
 	int enable_index_links;
+	int enable_index_owner;
 	int enable_commit_graph;
 	int enable_log_filecount;
 	int enable_log_linecount;
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 95a1049..64bbf7f 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -120,6 +120,10 @@ enable-index-links::
 	each repo in the repository index (specifically, to the "summary",
 	"commit" and "tree" pages). Default value: "0".
 
+enable-index-owner::
+	Flag which, when set to "1", will make cgit display the owner of
+	each repo in the repository index. Default value: "1".
+
 enable-log-filecount::
 	Flag which, when set to "1", will make cgit print the number of
 	modified files for each commit on the repository log page. Default
diff --git a/ui-repolist.c b/ui-repolist.c
index dead1bf..bbcaa1d 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -115,7 +115,8 @@ void print_header(int columns)
 	html("<tr class='nohover'>");
 	print_sort_header("Name", "name");
 	print_sort_header("Description", "desc");
-	print_sort_header("Owner", "owner");
+	if (ctx.cfg.enable_index_owner)
+		print_sort_header("Owner", "owner");
 	print_sort_header("Idle", "idle");
 	if (ctx.cfg.enable_index_links)
 		html("<th class='left'>Links</th>");
@@ -294,8 +295,10 @@ void cgit_print_repolist()
 		html_ntxt(ctx.cfg.max_repodesc_len, ctx.repo->desc);
 		html_link_close();
 		html("</td><td>");
-		html_txt(ctx.repo->owner);
-		html("</td><td>");
+		if (ctx.cfg.enable_index_owner) {
+			html_txt(ctx.repo->owner);
+			html("</td><td>");
+		}
 		print_modtime(ctx.repo);
 		html("</td>");
 		if (ctx.cfg.enable_index_links) {
-- 
1.8.0




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

end of thread, other threads:[~2013-02-01 11:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-18 12:39 [PATCH] make "Owner" column on index configurable bluewind
2012-03-18 20:52 ` larsh
2012-11-15  9:31 bluewind
2013-02-01  9:59 bluewind
2013-02-01 10:52 ` Jason
2013-02-01 11:05   ` cgit
2013-02-01 11:31     ` 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).