<div dir="ltr">Hey Tobias,<div><br></div><div>Sorry for the delay on this. Would you mind rebasing it on master, and resubmitting? I'll merge it ASAP.</div><div><br></div><div>Thanks,</div><div>Jason<br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 19, 2014 at 6:05 PM, Tobias Dreher <span dir="ltr"><<a href="mailto:tobiasdreher@outlook.com" target="_blank">tobiasdreher@outlook.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello everyone,<br>
<br>
Currently cgit only outputs the line "Repository seems to be empty" if a repository is empty. However, this is often the case when you just created a bare new repository, and want to make your first commit, and for that you want to know the URL of your repository! This patch adds that output.<br>
<br>
<br>
<br>
cgit.c | 5 +++--<br>
ui-summary.c | 20 ++++++++++++++++----<br>
ui-summary.h | 1 +<br>
3 files changed, 20 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/cgit.c b/cgit.c<br>
index f488ebf..93a77a1 100644<br>
--- a/cgit.c<br>
+++ b/cgit.c<br>
@@ -574,12 +574,15 @@ static int prepare_repo_cmd(void)<br>
ctx.qry.nohead = 1;<br>
ctx.qry.head = find_default_branch(ctx.repo);<br>
}<br>
+ sort_string_list(&ctx.repo-><u></u>submodules);<br>
+ cgit_prepare_repo_env(ctx.<u></u>repo);<br>
<br>
if (!ctx.qry.head) {<br>
cgit_print_http_headers();<br>
cgit_print_docstart();<br>
cgit_print_pageheader();<br>
cgit_print_error("Repository seems to be empty");<br>
+ cgit_print_repository_urls_as_<u></u>table();<br>
cgit_print_docend();<br>
return 1;<br>
}<br>
@@ -597,8 +600,6 @@ static int prepare_repo_cmd(void)<br>
free(tmp);<br>
return 1;<br>
}<br>
- sort_string_list(&ctx.repo-><u></u>submodules);<br>
- cgit_prepare_repo_env(ctx.<u></u>repo);<br>
choose_readme(ctx.repo);<br>
return 0;<br>
}<br>
diff --git a/ui-summary.c b/ui-summary.c<br>
index df99ce1..c55ad62 100644<br>
--- a/ui-summary.c<br>
+++ b/ui-summary.c<br>
@@ -70,6 +70,21 @@ static void print_urls(char *txt, char *suffix)<br>
}<br>
}<br>
<br>
+void cgit_print_repository_urls()<br>
+{<br>
+ if (ctx.repo->clone_url)<br>
+ print_urls(expand_macros(ctx.<u></u>repo->clone_url), NULL);<br>
+ else if (ctx.cfg.clone_prefix)<br>
+ print_urls(ctx.cfg.clone_<u></u>prefix, ctx.repo->url);<br>
+}<br>
+<br>
+void cgit_print_repository_urls_as_<u></u>table()<br>
+{<br>
+ html("<table summary='repository info' class='list nowrap'>");<br>
+ cgit_print_repository_urls();<br>
+ html("</table>");<br>
+}<br>
+<br>
void cgit_print_summary()<br>
{<br>
int columns = 3;<br>
@@ -88,10 +103,7 @@ void cgit_print_summary()<br>
cgit_print_log(ctx.qry.head, 0, ctx.cfg.summary_log, NULL,<br>
NULL, NULL, 0, 0, 0);<br>
}<br>
- if (ctx.repo->clone_url)<br>
- print_urls(expand_macros(ctx.<u></u>repo->clone_url), NULL);<br>
- else if (ctx.cfg.clone_prefix)<br>
- print_urls(ctx.cfg.clone_<u></u>prefix, ctx.repo->url);<br>
+ cgit_print_repository_urls();<br>
html("</table>");<br>
}<br>
<br>
diff --git a/ui-summary.h b/ui-summary.h<br>
index c01f560..1dd7e9e 100644<br>
--- a/ui-summary.h<br>
+++ b/ui-summary.h<br>
@@ -1,6 +1,7 @@<br>
#ifndef UI_SUMMARY_H<br>
#define UI_SUMMARY_H<br>
<br>
+extern void cgit_print_repository_urls_as_<u></u>table();<br>
extern void cgit_print_summary();<br>
extern void cgit_print_repo_readme(char *path);<br>
______________________________<u></u>_________________<br>
CGit mailing list<br>
<a href="mailto:CGit@lists.zx2c4.com" target="_blank">CGit@lists.zx2c4.com</a><br>
<a href="http://lists.zx2c4.com/mailman/listinfo/cgit" target="_blank">http://lists.zx2c4.com/<u></u>mailman/listinfo/cgit</a><br>
</blockquote></div><br><br clear="all"><div><br></div><br>
</div></div></div>