summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.h2
-rw-r--r--cgitrc7
-rw-r--r--shared.c5
-rw-r--r--ui-shared.c17
4 files changed, 31 insertions, 0 deletions
diff --git a/cgit.h b/cgit.h
index ab0efeb..f223dbc 100644
--- a/cgit.h
+++ b/cgit.h
@@ -77,2 +77,3 @@ struct repoinfo {
77 char *readme; 77 char *readme;
78 char *clone_url;
78 int snapshots; 79 int snapshots;
@@ -142,2 +143,3 @@ extern char *cgit_repo_group;
142extern char *cgit_robots; 143extern char *cgit_robots;
144extern char *cgit_clone_prefix;
143 145
diff --git a/cgitrc b/cgitrc
index 8c616e0..ce0c01b 100644
--- a/cgitrc
+++ b/cgitrc
@@ -118,2 +118,7 @@
118 118
119## Shared prefix which, when combined with repo url, becomes the url used
120## to clone the repo
121#clone-prefix=
122
123
119## Number of chars shown of repo description (in repolist view) 124## Number of chars shown of repo description (in repolist view)
@@ -169,2 +174,3 @@
169 #repo.readme=info/web/readme ## specify a file to include on summary page 174 #repo.readme=info/web/readme ## specify a file to include on summary page
175#repo.clone-url=git://hjemli.net/pub/git/cgit
170 176
@@ -175,2 +181,3 @@
175#repo.path=/pub/git/git 181#repo.path=/pub/git/git
182#repo.clone-url=git://hjemli.net/pub/git/git
176# 183#
diff --git a/shared.c b/shared.c
index fd8b1e3..2c309f5 100644
--- a/shared.c
+++ b/shared.c
@@ -29,2 +29,3 @@ char *cgit_repo_group = NULL;
29char *cgit_robots = "index, nofollow"; 29char *cgit_robots = "index, nofollow";
30char *cgit_clone_prefix = NULL;
30 31
@@ -202,2 +203,4 @@ void cgit_global_config_cb(const char *name, const char *value)
202 cgit_robots = xstrdup(value); 203 cgit_robots = xstrdup(value);
204 else if (!strcmp(name, "clone-prefix"))
205 cgit_clone_prefix = xstrdup(value);
203 else if (!strcmp(name, "repo.group")) 206 else if (!strcmp(name, "repo.group"))
@@ -210,2 +213,4 @@ void cgit_global_config_cb(const char *name, const char *value)
210 cgit_repo->path = trim_end(value, '/'); 213 cgit_repo->path = trim_end(value, '/');
214 else if (cgit_repo && !strcmp(name, "repo.clone-url"))
215 cgit_repo->clone_url = xstrdup(value);
211 else if (cgit_repo && !strcmp(name, "repo.desc")) 216 else if (cgit_repo && !strcmp(name, "repo.desc"))
diff --git a/ui-shared.c b/ui-shared.c
index 3e13c86..ece041c 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -462,2 +462,3 @@ void cgit_print_pageheader(char *title, int show_search)
462 int header = 0; 462 int header = 0;
463 char *url;
463 464
@@ -494,2 +495,18 @@ void cgit_print_pageheader(char *title, int show_search)
494 495
496 if (cgit_repo->clone_url || cgit_clone_prefix) {
497 html("<h1>clone</h1>\n");
498 if (cgit_repo->clone_url)
499 url = cgit_repo->clone_url;
500 else
501 url = fmt("%s%s", cgit_clone_prefix,
502 cgit_repo->url);
503 html("<a class='menu' href='");
504 html_attr(url);
505 html("' title='");
506 html_attr(url);
507 html("'>\n");
508 html_txt(strrpart(url, 20));
509 html("</a>\n");
510 }
511
495 html("<h1>branch</h1>\n"); 512 html("<h1>branch</h1>\n");