From nirfri at gmail.com Sun May 1 14:34:39 2011 From: nirfri at gmail.com (Nir Friedman) Date: Sun, 1 May 2011 15:34:39 +0300 Subject: commit graph Message-ID: <000301cc07fc$25386e30$6fa94a90$@com> enable-commit-graph=1 should be first in cgitrc to operate (v0.9) Nir From jugg at hotmail.com Wed May 4 13:53:33 2011 From: jugg at hotmail.com (chris) Date: Wed, 4 May 2011 11:53:33 +0000 (UTC) Subject: clone url generation issue Message-ID: I use gitolite to manage my repositories, and per my gitolite configuration the general clone url for all of my repositories is: git at example.com: My cgit instance is such that a particular project is browsed at: http://example.com/git// As such, I have the following in my cgitrc: logo=/git/cgit.png css=/git/cgit.css remove-suffix=1 virtual-root=/git project-list=/var/lib/gitolite/projects.list scan-path=/srv/gitolite clone-prefix=git at example.com: However, with this setup, the clone url shown on each project is incorrect, like so: git at example.com:/ Notice the erroneous forward slash being inserted between the clone-prefix and project name. Have I configured something incorrectly, or is this setup not supported? Thanks, chris From plenz at cis.fu-berlin.de Thu May 5 16:58:38 2011 From: plenz at cis.fu-berlin.de (Julius Plenz) Date: Thu, 5 May 2011 16:58:38 +0200 Subject: clone url generation issue In-Reply-To: References: Message-ID: <20110505145838.GA10654@plenz.com> Hi! * chris [2011-05-04 13:56]: > I use gitolite to manage my repositories, and per my gitolite > configuration the general clone url for all of my repositories is: > > git at example.com: This is a short syntax supported by git because it resembles scp usage, where you also do user at host:path. However, Git equally supports the ssh://user at host/path syntax, which might be a better approach because you explicitly state the protocol to use (ssh) so that a browser may infer the appropriate program to call. > clone-prefix=git at example.com: > However, with this setup, the clone url shown on each project is incorrect, > like so: > > git at example.com:/ > > Notice the erroneous forward slash being inserted between the > clone-prefix and project name. As far as I can see the print_url() function is responsible (ui-summary.c), which does a simple fmt("%s/%s", base, suffix). So you'd have to do some patching there in order to support that short notion you're using. I think it's best to use the long ssh:// syntax instead. Julius From jugg at hotmail.com Fri May 6 06:03:39 2011 From: jugg at hotmail.com (chris) Date: Fri, 6 May 2011 04:03:39 +0000 (UTC) Subject: clone url generation issue References: <20110505145838.GA10654@plenz.com> Message-ID: Julius Plenz writes: > * chris [2011-05-04 13:56]: > > git at ...:/ > > > > Notice the erroneous forward slash being inserted between the > > clone-prefix and project name. > > As far as I can see the print_url() function is responsible > (ui-summary.c), which does a simple fmt("%s/%s", base, suffix). So > you'd have to do some patching there in order to support that short > notion you're using. >From my reading of the code, that concatenation is only used when a url-prefix is defined. In which case, simply changing the line from: base = fmt("%s/%s", base, suffix); to base = fmt("%s%s", base, suffix); allowing the forward slash to be specified as part of the prefix insetad. > I think it's best to use the long ssh:// syntax instead. Yes, unfortunately prior to integrating cgit, our repository urls have been using the shorthand format. Thanks for the feedback and pointer to the relevant code. chris From jugg at hotmail.com Fri May 6 06:07:00 2011 From: jugg at hotmail.com (chris) Date: Fri, 6 May 2011 04:07:00 +0000 (UTC) Subject: clone url generation issue References: <20110505145838.GA10654@plenz.com> Message-ID: chris writes: > From my reading of the code, that concatenation is only used when a url-prefix > is defined. I mean clone-prefix of course. Examples: clone-prefix=ssh://git at example.com/ or clone-prefix=git at example.com: chris From thomas.moschny at gmx.de Wed May 11 16:06:28 2011 From: thomas.moschny at gmx.de (Thomas Moschny) Date: Wed, 11 May 2011 16:06:28 +0200 Subject: git gc and idle times Message-ID: <20110511160628.7d00fb2a@andromeda.ipd.uni-karlsruhe.de> Hi, we are using cgit 0.9 successfully on a bunch of repositories. Nice tool! One question however: After running git-gc on some of the repositories, the overview page of cgit misses idle times for those. The idle time is back after pushing a commit. Is there something that needs to be adjusted/fixed manually after running git-gc? Or is it a bug of cgit? Thanks, -- Thomas Moschny From cgit at cryptocrack.de Wed May 11 16:47:35 2011 From: cgit at cryptocrack.de (Lukas Fleischer) Date: Wed, 11 May 2011 16:47:35 +0200 Subject: git gc and idle times In-Reply-To: <20110511160628.7d00fb2a@andromeda.ipd.uni-karlsruhe.de> References: <20110511160628.7d00fb2a@andromeda.ipd.uni-karlsruhe.de> Message-ID: <20110511144735.GF12088@blizzard> On Wed, May 11, 2011 at 04:06:28PM +0200, Thomas Moschny wrote: > Hi, > > we are using cgit 0.9 successfully on a bunch of repositories. Nice > tool! > > One question however: After running git-gc on some of the repositories, > the overview page of cgit misses idle times for those. The idle time is > back after pushing a commit. Is there something that needs to be > adjusted/fixed manually after running git-gc? Or is it a bug of cgit? cgit uses the mtime of the file containing the default branch's HEAD ref to guess the idle time if there's no agefile. If you pack heads and tags there won't be such a file anymore, resulting in no idle time being displayed. You could try to set "gc.packrefs" to "notbare" to prevent the garbage collector from packing refs as a workaround. From mailings at hupie.com Fri May 13 19:01:14 2011 From: mailings at hupie.com (Ferry Huberts) Date: Fri, 13 May 2011 19:01:14 +0200 Subject: git gc and idle times In-Reply-To: <20110511144735.GF12088@blizzard> References: <20110511160628.7d00fb2a@andromeda.ipd.uni-karlsruhe.de> <20110511144735.GF12088@blizzard> Message-ID: <4DCD63DA.2050301@hupie.com> On 05/11/2011 04:47 PM, Lukas Fleischer wrote: > On Wed, May 11, 2011 at 04:06:28PM +0200, Thomas Moschny wrote: >> Hi, >> >> we are using cgit 0.9 successfully on a bunch of repositories. Nice >> tool! >> >> One question however: After running git-gc on some of the repositories, >> the overview page of cgit misses idle times for those. The idle time is >> back after pushing a commit. Is there something that needs to be >> adjusted/fixed manually after running git-gc? Or is it a bug of cgit? > > cgit uses the mtime of the file containing the default branch's HEAD ref > to guess the idle time if there's no agefile. If you pack heads and tags > there won't be such a file anymore, resulting in no idle time being > displayed. > > You could try to set "gc.packrefs" to "notbare" to prevent the garbage > collector from packing refs as a workaround. > I have this too. When repos are repacked then some refs can end up in packed-refs, including the ref for the default branch. I think cgit should add one more fallback to look for packed-refs before giving up. I'll be submitting a patch later to this effect. grtz -- Ferry Huberts From mailings at hupie.com Fri May 13 23:09:34 2011 From: mailings at hupie.com (Ferry Huberts) Date: Fri, 13 May 2011 23:09:34 +0200 Subject: [PATCH] ui_repolist: get modtime from packed-refs as fallback Message-ID: <1305320974-8453-1-git-send-email-mailings@hupie.com> From: Ferry Huberts When no modtime could be determined then as a final fallback try to get it from the packed-refs. This will show an idle time when a repository has been packed with all refs in the packed-refs. Signed-off-by: Ferry Huberts --- ui-repolist.c | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ui-repolist.c b/ui-repolist.c index 2c98668..6c33e38 100644 --- a/ui-repolist.c +++ b/ui-repolist.c @@ -46,11 +46,20 @@ static int get_repo_modtime(const struct cgit_repo *repo, time_t *mtime) } path = fmt("%s/refs/heads/%s", repo->path, repo->defbranch); - if (stat(path, &s) == 0) + if (stat(path, &s) == 0) { *mtime = s.st_mtime; - else - *mtime = 0; + r->mtime = *mtime; + return 1; + } + + path = fmt("%s/%s", repo->path, "packed-refs"); + if (stat(path, &s) == 0) { + *mtime = s.st_mtime; + r->mtime = *mtime; + return 1; + } + *mtime = 0; r->mtime = *mtime; return (r->mtime != 0); } -- 1.7.4.4 From mailings at hupie.com Fri May 13 23:20:57 2011 From: mailings at hupie.com (Ferry Huberts) Date: Fri, 13 May 2011 23:20:57 +0200 Subject: CGit and modification times Message-ID: <4DCDA0B9.4000108@hupie.com> Hi list. While implementing the patch fixing idle times for packed repos it occurred to me that currently CGit looks at modification times of files, instead of at the timestamp on the actual commits. Wouldn't it be better to retrieve the timestamp of the relevant commit/tag and use that? In case of the front page (listing all repos) that would mean getting timestamps of all HEADs of all refs/tags of a repo to determine the idle time (which also must be done for the repo page itself). This obviously is a bit more expensive but maybe also a bit more correct? Enabling caching should alleviate much of the problem. Feedback appreciated :-) -- Ferry Huberts From lodatom at gmail.com Sat May 14 01:59:07 2011 From: lodatom at gmail.com (Mark Lodato) Date: Fri, 13 May 2011 19:59:07 -0400 Subject: [PATCH] fix virtual-root if script-name is "" Message-ID: <1305331147-22700-1-git-send-email-lodatom@gmail.com> In d0cb841 (Avoid trailing slash in virtual-root), virtual-root was set from script-name using trim_end(). However, if script-name was the empty string (""), which happens when cgit is used to serve the root path on a domain (/), trim_end() returns NULL and cgit acts like virtual-root is not available. Now, set virtual-root to "" in this case, which fixes this bug. --- cgit.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/cgit.c b/cgit.c index e302a7c..e498030 100644 --- a/cgit.c +++ b/cgit.c @@ -757,8 +757,11 @@ int main(int argc, const char **argv) * that virtual-root equals SCRIPT_NAME, minus any possibly * trailing slashes. */ - if (!ctx.cfg.virtual_root) + if (!ctx.cfg.virtual_root && ctx.cfg.script_name) { ctx.cfg.virtual_root = trim_end(ctx.cfg.script_name, '/'); + if (!ctx.cfg.virtual_root) + ctx.cfg.virtual_root = ""; + } /* If no url parameter is specified on the querystring, lets * use PATH_INFO as url. This allows cgit to work with virtual -- 1.7.5.1 From mailings at hupie.com Sat May 14 09:55:26 2011 From: mailings at hupie.com (Ferry Huberts) Date: Sat, 14 May 2011 09:55:26 +0200 Subject: CGit and modification times In-Reply-To: <4DCDA0B9.4000108@hupie.com> References: <4DCDA0B9.4000108@hupie.com> Message-ID: <4DCE356E.3040807@hupie.com> On 05/13/2011 11:20 PM, Ferry Huberts wrote: > Hi list. > > While implementing the patch fixing idle times for packed repos it > occurred to me that currently CGit looks at modification times of files, > instead of at the timestamp on the actual commits. > > Wouldn't it be better to retrieve the timestamp of the relevant > commit/tag and use that? > > In case of the front page (listing all repos) that would mean getting > timestamps of all HEADs of all refs/tags of a repo to determine the idle > time (which also must be done for the repo page itself). > > This obviously is a bit more expensive but maybe also a bit more correct? > > Enabling caching should alleviate much of the problem. > > Feedback appreciated :-) forget I said it :-) Thought about it a bit more and I think current behaviour (+ the packed-refs patch) is good enough. -- Ferry Huberts From plenz at cis.fu-berlin.de Wed May 18 12:19:24 2011 From: plenz at cis.fu-berlin.de (Julius Plenz) Date: Wed, 18 May 2011 12:19:24 +0200 Subject: CGit and modification times In-Reply-To: <4DCE356E.3040807@hupie.com> References: <4DCDA0B9.4000108@hupie.com> <4DCE356E.3040807@hupie.com> Message-ID: <20110518101924.GA15410@plenz.com> Hi, Ferry! * Ferry Huberts [2011-05-15 12:00]: > > This obviously is a bit more expensive but maybe also a bit more correct? > Thought about it a bit more and I think current behaviour (+ the > packed-refs patch) is good enough. It is pretty expensive to cover all the corner cases like packed refs. Also, the file's modification time might not be the time the last commit was made. Unless you want to do this expensive look up every time you request a repository listing (caching aside), your best bet is to write the commit date to a so-called agefile. You find out the date of the last commit upon a "git push" (via an update hook) and later retrieve it (which is a fast operation: simply reading in a small file). See here for an example command: http://hjemli.net/git/cgit/commit/?id=57f6a8bf0de6c112cabc1d8e20ade2698bd886b7 Lars: It may be worth starting a FAQ page. What do you think? Julius From mailings at hupie.com Wed May 18 13:02:37 2011 From: mailings at hupie.com (Ferry Huberts) Date: Wed, 18 May 2011 13:02:37 +0200 Subject: CGit and modification times In-Reply-To: <20110518101924.GA15410@plenz.com> References: <4DCDA0B9.4000108@hupie.com> <4DCE356E.3040807@hupie.com> <20110518101924.GA15410@plenz.com> Message-ID: <4DD3A74D.5090402@hupie.com> On 05/18/2011 12:19 PM, Julius Plenz wrote: > Hi, Ferry! > > * Ferry Huberts [2011-05-15 12:00]: >>> This obviously is a bit more expensive but maybe also a bit more correct? > >> Thought about it a bit more and I think current behaviour (+ the >> packed-refs patch) is good enough. > > It is pretty expensive to cover all the corner cases like packed refs. > Also, the file's modification time might not be the time the last > commit was made. > I came to the same conclusion, that's why I said that the current behaviour is good enough. I still would like to see the packed-refs fallback patch integrated though :-) > Unless you want to do this expensive look up every time you request a > repository listing (caching aside), your best bet is to write the > commit date to a so-called agefile. You find out the date of the last > commit upon a "git push" (via an update hook) and later retrieve it > (which is a fast operation: simply reading in a small file). > > See here for an example command: > http://hjemli.net/git/cgit/commit/?id=57f6a8bf0de6c112cabc1d8e20ade2698bd886b7 > > Lars: It may be worth starting a FAQ page. What do you think? > I think it'd be better to include (part of) the comment of that commit in the cgitrc.5.txt file! :-) a FAQ is then not needed IMHO > Julius > > _______________________________________________ > cgit mailing list > cgit at hjemli.net > http://hjemli.net/mailman/listinfo/cgit grtz -- Ferry Huberts From alex.smith.93 at gmail.com Fri May 20 00:26:21 2011 From: alex.smith.93 at gmail.com (Alex Smith) Date: Thu, 19 May 2011 18:26:21 -0400 Subject: Problem compiling on Mac Message-ID: Hi, I've tried installing from a cloned cgit repository as well as the v0.9 downloadable release named cgit-0.9.tar.gz. Both give me the same problem when I "make" or "make get-git": CC cgit Undefined symbols: "_iconv", referenced from: _reencode_string in libgit.a(utf8.o) "_iconv_close", referenced from: _reencode_string in libgit.a(utf8.o) _reencode_string in libgit.a(utf8.o) "_iconv_open", referenced from: _reencode_string in libgit.a(utf8.o) ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [cgit] Error 1 Is there a forum for this stuff or is this it? Regards, Alex From info at naptravel.com Sun May 22 11:05:23 2011 From: info at naptravel.com (Nap Travel) Date: Sun, 22 May 2011 09:05:23 +0000 (UTC) Subject: Promocion Cruceros Message-ID: Versi?n Online: http://pemln.com/pem/v?p=dtPJryvzElKNYp%2BetnP04g%3D%3D Por favor utilice un cliente de email con soporte HTML para visualizar correctamente este email, o acceda a la version online aqui: http://pemln.com/pem/v?p=dtPJryvzElKNYp%2BetnP04g%3D%3D --- Este mensaje fue enviado a cgit at hjemli.net por NAP TRAVEL FLORIDA 890, BS AS, Argentina Para dejar de recibir estos mensajes, haga click en el siguiente enlace: desuscribir [ http://pemln.com/pl/u?p=dtPJryvzElKNYp%2BetnP04g%3D%3D ] From hjemli at gmail.com Tue May 24 00:10:59 2011 From: hjemli at gmail.com (Lars Hjemli) Date: Tue, 24 May 2011 00:10:59 +0200 Subject: Updates to stable and master on hjemli.net Message-ID: First off, sorry for the silence+latency, and thanks for all the patches! I've finally gotten around to process some of them, and the result has been pushed to hjemli.net/git/cgit: Pushed to stable ================ Jonathon Mah (1): Fix escaping of paths with spaces Lars Hjemli (4): tests/setup.sh: add support for known bugs tests: add tests for links with space in path and/or args shared.c: do not modify const memory ui-repolist.c: do not return random/stale data from read_agefile Lukas Fleischer (4): Remove unused variable from cgit_diff_tree(). Fix memory leak in http_parse_querystring(). Avoid null pointer dereference in reencode(). Avoid null pointer dereference in cgit_print_diff(). Mark Lodato (1): fix virtual-root if script-name is "" Pushed to master ================ Dan McGee (3): Add is_clone flag to available commands Allow disabling of HTTP clone URLs Return 404 on command not found Ferry Huberts (4): new_filter: determine extra_args from filter type cgit_open_filter: also take the repo as a parameter cgit_open_filter: hand down repo configuration to script filters: document environment variables in filter scripts Lars Hjemli (4): html.c: add html_intoption() ui-diff.c: create a control panel for diff options ui-stats.c: create a control panel for stat options shared.c: use execvp() to execute filter commands -- larsh From hjemli at gmail.com Tue May 24 00:41:00 2011 From: hjemli at gmail.com (Lars Hjemli) Date: Tue, 24 May 2011 00:41:00 +0200 Subject: clone url generation issue In-Reply-To: References: <20110505145838.GA10654@plenz.com> Message-ID: On Fri, May 6, 2011 at 06:03, chris wrote: > Julius Plenz writes: >> * chris [2011-05-04 13:56]: >> > git at ...:/ >> > >> > Notice the erroneous forward slash being inserted between the >> > clone-prefix and project name. >> >> As far as I can see the print_url() function is responsible >> (ui-summary.c), which does a simple fmt("%s/%s", base, suffix). So >> you'd have to do some patching there in order to support that short >> notion you're using. > > From my reading of the code, that concatenation is only used when a url-prefix > is defined. ?In which case, simply changing the line from: > > ?base = fmt("%s/%s", base, suffix); > > to > > ?base = fmt("%s%s", base, suffix); > > allowing the forward slash to be specified as part of the prefix insetad. > Such a change would correctly fix your problem, but it would break existing installations. I think a better solution is to introduce a new setting, clone-url, which is adopted by each repo during config/scanning and which supports expansion of environment variables like $CGIT_REPO_NAME. Maybe something like this untested (and gmail-mangled) patch: diff --git a/cgit.c b/cgit.c index 6be3754..b651843 100644 --- a/cgit.c +++ b/cgit.c @@ -244,6 +244,8 @@ void config_cb(const char *name, const char *value) ctx.cfg.robots = xstrdup(value); else if (!strcmp(name, "clone-prefix")) ctx.cfg.clone_prefix = xstrdup(value); + else if (!strcmp(name, "clone-url")) + ctx.cfg.clone_url = xstrdup(value); else if (!strcmp(name, "local-time")) ctx.cfg.local_time = atoi(value); else if (!prefixcmp(name, "mimetype.")) @@ -463,6 +465,7 @@ static int prepare_repo_cmd(struct cgit_context *ctx) cgit_print_docend(); return 1; } + cgit_prepare_env(ctx->repo); return 0; } diff --git a/cgit.h b/cgit.h index caa9d8e..21f4815 100644 --- a/cgit.h +++ b/cgit.h @@ -165,6 +165,7 @@ struct cgit_config { char *agefile; char *cache_root; char *clone_prefix; + char *clone_url; char *css; char *favicon; char *footer; @@ -319,6 +320,8 @@ extern const char *cgit_repobasename(const char *reponame); extern int cgit_parse_snapshots_mask(const char *str); +extern void cgit_prepare_env(struct cgit_repo *repo); + extern int cgit_open_filter(struct cgit_filter *filter, struct cgit_repo * repo); extern int cgit_close_filter(struct cgit_filter *filter); diff --git a/shared.c b/shared.c index be2ae59..af1f403 100644 --- a/shared.c +++ b/shared.c @@ -66,6 +66,7 @@ struct cgit_repo *cgit_add_repo(const char *url) ret->max_stats = ctx.cfg.max_stats; ret->module_link = ctx.cfg.module_link; ret->readme = ctx.cfg.readme; + ret->clone_url = ctx.cfg.clone_url; ret->mtime = -1; ret->about_filter = ctx.cfg.about_filter; ret->commit_filter = ctx.cfg.commit_filter; @@ -374,7 +375,8 @@ typedef struct { char * value; } cgit_env_var; -static void prepare_env(struct cgit_repo * repo) { +void cgit_prepare_env(struct cgit_repo *repo) +{ cgit_env_var env_vars[] = { { .name = "CGIT_REPO_URL", .value = repo->url }, { .name = "CGIT_REPO_NAME", .value = repo->name }, @@ -406,8 +408,6 @@ int cgit_open_filter(struct cgit_filter *filter, struct cgit_repo * repo) close(filter->pipe_fh[1]); chk_non_negative(dup2(filter->pipe_fh[0], STDIN_FILENO), "Unable to use pipe as STDIN"); - if (repo) - prepare_env(repo); execvp(filter->cmd, filter->argv); die("Unable to exec subprocess %s: %s (%d)", filter->cmd, strerror(errno), errno); diff --git a/ui-summary.c b/ui-summary.c index 1e9a1b6..d8a745a 100644 --- a/ui-summary.c +++ b/ui-summary.c @@ -62,7 +62,7 @@ void cgit_print_summary() NULL, NULL, 0, 0); } if (ctx.repo->clone_url) - print_urls(ctx.repo->clone_url, NULL); + print_urls(expand_macros(ctx.repo->clone_url), NULL); else if (ctx.cfg.clone_prefix) print_urls(ctx.cfg.clone_prefix, ctx.repo->url); html(""); -- larsh From hjemli at gmail.com Tue May 24 00:50:10 2011 From: hjemli at gmail.com (Lars Hjemli) Date: Tue, 24 May 2011 00:50:10 +0200 Subject: Problem compiling on Mac In-Reply-To: References: Message-ID: On Fri, May 20, 2011 at 00:26, Alex Smith wrote: > I've tried installing from a cloned cgit repository as well as the v0.9 > downloadable release named > cgit-0.9.tar.gz. > Both give me the same problem when I "make" or "make get-git": > > ? ?CC cgit > Undefined symbols: > ?"_iconv", referenced from: > ? ? ?_reencode_string in libgit.a(utf8.o) Try this incantation: $ make NEEDS_LIBICONV=YesPlease > Is there a forum for this stuff or is this it? This is it ;) -- larsh From alex.smith.93 at gmail.com Tue May 24 01:20:35 2011 From: alex.smith.93 at gmail.com (Alex Smith) Date: Mon, 23 May 2011 19:20:35 -0400 Subject: Problem compiling on Mac In-Reply-To: References: Message-ID: <78940411-A9EF-4AAB-A727-59610A919B45@gmail.com> On 2011-05-23, at 6:50 PM, Lars Hjemli wrote: > On Fri, May 20, 2011 at 00:26, Alex Smith wrote: >> I've tried installing from a cloned cgit repository as well as the v0.9 >> downloadable release named >> cgit-0.9.tar.gz. >> Both give me the same problem when I "make" or "make get-git": >> >> CC cgit >> Undefined symbols: >> "_iconv", referenced from: >> _reencode_string in libgit.a(utf8.o) > > Try this incantation: > > $ make NEEDS_LIBICONV=YesPlease > Great! Did the trick. :) > >> Is there a forum for this stuff or is this it? > > This is it ;) > > -- > larsh Alex Smith From alex.smith.93 at gmail.com Tue May 24 01:30:13 2011 From: alex.smith.93 at gmail.com (Alex Smith) Date: Mon, 23 May 2011 19:30:13 -0400 Subject: Incorrect default install path for Apache on Mac Message-ID: <970199E2-E0EC-4539-A95A-AAE64B021295@gmail.com> On Mac install goes more like this however, it won't install to the default htdocs dir on a mac: make get-git make NEEDS_LIBICONV=YesPlease get-git sudo make NEEDS_LIBICONV=YesPlease install Instead it installs to as evidenced by the Terminal: install -m 0755 -d /var/www/htdocs/cgit install -m 0755 cgit /var/www/htdocs/cgit/cgit.cgi install -m 0755 -d /var/www/htdocs/cgit install -m 0644 cgit.css /var/www/htdocs/cgit/cgit.css install -m 0644 cgit.png /var/www/htdocs/cgit/cgit.png install -m 0755 -d /usr/lib/cgit/filters install -m 0755 filters/* /usr/lib/cgit/filters Default directory for Mac web documents (i.e. htdocs) is: /Library/WebServer/Documents I feel I can easily just move all files under /var/www/htdocs to this directory, but is it safe to move /usr/lib/cgit/filters? Perhaps there should be a prompt for the user to enter the paths for these two directories? Just an option... Regards, Alex From hjemli at gmail.com Tue May 24 02:01:57 2011 From: hjemli at gmail.com (Lars Hjemli) Date: Tue, 24 May 2011 02:01:57 +0200 Subject: Incorrect default install path for Apache on Mac In-Reply-To: <970199E2-E0EC-4539-A95A-AAE64B021295@gmail.com> References: <970199E2-E0EC-4539-A95A-AAE64B021295@gmail.com> Message-ID: On Tue, May 24, 2011 at 01:30, Alex Smith wrote: > On Mac install goes more like this however, it won't install to the default htdocs dir on a mac: > make get-git > make NEEDS_LIBICONV=YesPlease get-git > sudo make NEEDS_LIBICONV=YesPlease install sligthly off-topic: * the get-git target is only needed once (to download the sources for libgit.a) * if you've done 'git submodule init; git submodule update', there's no need to 'make get-git' at all * specifying NEEDS_LIBICONV is also only needed once (during building, not install) > > Instead it installs to as evidenced by the Terminal: > install -m 0755 -d /var/www/htdocs/cgit > install -m 0755 cgit /var/www/htdocs/cgit/cgit.cgi > install -m 0755 -d /var/www/htdocs/cgit > install -m 0644 cgit.css /var/www/htdocs/cgit/cgit.css > install -m 0644 cgit.png /var/www/htdocs/cgit/cgit.png > install -m 0755 -d /usr/lib/cgit/filters > install -m 0755 filters/* /usr/lib/cgit/filters Yeah, these are the default paths, as defined at the start of the Makefile. > > Default directory for Mac web documents (i.e. htdocs) is: /Library/WebServer/Documents Ok. Running 'make CGIT_SCRIPT_PATH=/Library/WebServer/Documents install' would have put (some of) the files at the right place, put a better solution is to specify these variables in a file named cgit.conf which is always included by the Makefile (see the start of the Makefile for these and other variables you might want to adjust in cgit.conf). Also, a new darwin-specific section in the Makefile would probably be helpful, i.e. something like this (totally untested...): diff --git a/Makefile b/Makefile index af2879e..43b061c 100644 --- a/Makefile +++ b/Makefile @@ -49,6 +49,12 @@ ifeq ($(uname_O),Cygwin) NEEDS_LIBICONV = YesPlease endif +ifeq ($(uname_S),Darwin) + NEEDS_LIBICONV = YesPlease + CGIT_SCRIPT_PATH=/Library/WebServer/Documents + filterdir=/Library/cgit/filters +endif + # # Let the user override the above settings. # > I feel I can easily just move all files under /var/www/htdocs to this directory, but > is it safe to move /usr/lib/cgit/filters? The filter scripts are not supposed to be accessible by apache, so I'd move them to e.g. /Library/cgit/filters (just guessing, I don't know the fs layout on darwin...) -- larsh From mailings at hupie.com Tue May 24 10:48:22 2011 From: mailings at hupie.com (Ferry Huberts) Date: Tue, 24 May 2011 10:48:22 +0200 Subject: Updates to stable and master on hjemli.net In-Reply-To: References: Message-ID: <4DDB70D6.8010305@hupie.com> On 05/24/2011 12:10 AM, Lars Hjemli wrote: > First off, sorry for the silence+latency, and thanks for all the > patches! I've finally gotten around to process some of them, and the > result has been pushed to hjemli.net/git/cgit: > Thanks for the update! On a side note: any feedback for my patch titled '[PATCH] ui_repolist: get modtime from packed-refs as fallback'? I think it's a good idea to have a last fallback to the time of the packed-refs file when no time could be determined. At least then the time is shown at which the repo was packed, instead of no time at all. grtz -- Ferry Huberts From cgit at cryptocrack.de Tue May 24 20:38:40 2011 From: cgit at cryptocrack.de (Lukas Fleischer) Date: Tue, 24 May 2011 20:38:40 +0200 Subject: [PATCH] Properly escape ampersands inside HTML attributes Message-ID: <20110524183840.GA1238@blizzard> Ampersands ("&") appearing inside HTML attributes need to be translated to "&". Otherwise, invalid XHTML will be generated at various places, such as at tree views containing links to submodules. Signed-off-by: Lukas Fleischer --- html.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/html.c b/html.c index 4a18a57..eb1c25d 100644 --- a/html.c +++ b/html.c @@ -138,7 +138,7 @@ void html_attr(const char *txt) const char *t = txt; while(t && *t){ int c = *t; - if (c=='<' || c=='>' || c=='\'' || c=='\"') { + if (c=='<' || c=='>' || c=='\'' || c=='\"' || c=='&') { html_raw(txt, t - txt); if (c=='>') html(">"); @@ -148,6 +148,8 @@ void html_attr(const char *txt) html("'"); else if (c=='"') html("""); + else if (c=='&') + html("&"); txt = t+1; } t++; -- 1.7.5.2 From mailings at hupie.com Tue May 24 21:09:58 2011 From: mailings at hupie.com (Ferry Huberts) Date: Tue, 24 May 2011 21:09:58 +0200 Subject: Updates to stable and master on hjemli.net In-Reply-To: References: Message-ID: <4DDC0286.3050306@hupie.com> On 05/24/2011 12:10 AM, Lars Hjemli wrote: > First off, sorry for the silence+latency, and thanks for all the > patches! I've finally gotten around to process some of them, and the > result has been pushed to hjemli.net/git/cgit: > ... > Ferry Huberts (4): > new_filter: determine extra_args from filter type > cgit_open_filter: also take the repo as a parameter > cgit_open_filter: hand down repo configuration to script > filters: document environment variables in filter scripts These patches are now working for me on my git server :-) I've included the script as an example. PS. Lars: this script is an 'improved' version over the one in the tree, do you want a patch for it? grtz -- Ferry Huberts -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: commit-links.bash URL: From alex.smith.93 at gmail.com Thu May 26 07:48:47 2011 From: alex.smith.93 at gmail.com (Alex Smith) Date: Thu, 26 May 2011 01:48:47 -0400 Subject: Incorrect default install path for Apache on Mac In-Reply-To: References: <970199E2-E0EC-4539-A95A-AAE64B021295@gmail.com> Message-ID: On 2011-05-23, at 8:01 PM, Lars Hjemli wrote: > On Tue, May 24, 2011 at 01:30, Alex Smith wrote: >> On Mac install goes more like this however, it won't install to the default htdocs dir on a mac: >> make get-git >> make NEEDS_LIBICONV=YesPlease get-git >> sudo make NEEDS_LIBICONV=YesPlease install > > sligthly off-topic: > * the get-git target is only needed once (to download the sources for libgit.a) > * if you've done 'git submodule init; git submodule update', there's > no need to 'make get-git' at all > * specifying NEEDS_LIBICONV is also only needed once (during building, > not install) > I made a typo earlier but not where you would think. From experience getting this to compile, it's necessary for me to compile like: # Compile just cgit (if you already have git) make NEEDS_LIBICONV=YesPlease # Download/compile git and compile cgit make NEEDS_LIBICONV=YesPlease get-git # Do the install: sudo make NEEDS_LIBICONV=YesPlease install If you don't include the NEEDS_LIBICONV=YesPlease to the install phase I get: sudo make install SUBDIR git SUBDIR git CC cgit Undefined symbols: "_iconv", referenced from: _reencode_string in libgit.a(utf8.o) "_iconv_close", referenced from: _reencode_string in libgit.a(utf8.o) _reencode_string in libgit.a(utf8.o) "_iconv_open", referenced from: _reencode_string in libgit.a(utf8.o) ld: symbol(s) not found collect2: ld returned 1 exit status If this can carry over to the install that would be cool. I looked at the makefile and in order for it to "comply" with where to put it, you'd need patience and support spaces in directory paths. It unknowingly fails when presented with spaces for libdir: Proper directories for these files are: CGIT_SCRIPT_PATH=/Library/WebServer/Documents/cgit libdir=/Library/Application\ Support docdir=/Library/Documentation/Applications/cgit I think this should comply with standards in the Darwin world. >> >> Instead it installs to as evidenced by the Terminal: >> install -m 0755 -d /var/www/htdocs/cgit >> install -m 0755 cgit /var/www/htdocs/cgit/cgit.cgi >> install -m 0755 -d /var/www/htdocs/cgit >> install -m 0644 cgit.css /var/www/htdocs/cgit/cgit.css >> install -m 0644 cgit.png /var/www/htdocs/cgit/cgit.png >> install -m 0755 -d /usr/lib/cgit/filters >> install -m 0755 filters/* /usr/lib/cgit/filters > > Yeah, these are the default paths, as defined at the start of the Makefile. > >> >> Default directory for Mac web documents (i.e. htdocs) is: /Library/WebServer/Documents > > Ok. Running 'make CGIT_SCRIPT_PATH=/Library/WebServer/Documents > install' would have put (some of) the files at the right place, put a > better solution is to specify these variables in a file named > cgit.conf which is always included by the Makefile (see the start of > the Makefile for these and other variables you might want to adjust in > cgit.conf). > > Also, a new darwin-specific section in the Makefile would probably be > helpful, i.e. something like this (totally untested...): > > diff --git a/Makefile b/Makefile > index af2879e..43b061c 100644 > --- a/Makefile > +++ b/Makefile > @@ -49,6 +49,12 @@ ifeq ($(uname_O),Cygwin) > NEEDS_LIBICONV = YesPlease > endif > > +ifeq ($(uname_S),Darwin) > + NEEDS_LIBICONV = YesPlease > + CGIT_SCRIPT_PATH=/Library/WebServer/Documents > + filterdir=/Library/cgit/filters > +endif > + > # > # Let the user override the above settings. > # > > >> I feel I can easily just move all files under /var/www/htdocs to this directory, but >> is it safe to move /usr/lib/cgit/filters? > > The filter scripts are not supposed to be accessible by apache, so I'd > move them to e.g. /Library/cgit/filters (just guessing, I don't know > the fs layout on darwin...) > > -- > larsh From mail-20 at mayday.saikyou.biz Fri May 27 06:41:00 2011 From: mail-20 at mayday.saikyou.biz (=?ISO-2022-JP?B?GyRCIUozdCVTJTglTSU5JUglaSU5JUglNyU5JUYlYCU6GyhC?=) Date: Fri, 27 May 2011 13:41:00 +0900 (JST) Subject: =?ISO-2022-JP?B?GyRCOl9CcCVvITwlKyE8NV5KZ0IuSnMbKEI=?= =?ISO-2022-JP?B?IRskQiFaJUchPCU/Rn5OTzZITDNCZ05MPHVDbSROJD8kYRsoQg==?= =?ISO-2022-JP?B?GyRCIVsheSVhJWslXiUsGyhCU09ITxskQkA4M2glSxsoQg==?= =?ISO-2022-JP?B?GyRCJWUhPCU5GyhC?= Message-ID: <20110527044100.BEC436CFAC6F8@r1361.ps.combzmail.jp> ??????SOHO??????01039??2011?5?? ??????:142,254? ?????????????????????????? ?????????????????????????????????????? http://regist.mail-magazine.co.jp/d/69rm&m=@Aquw7evxs0zwf1s7 ?1? ????SOHO???????????????????????????????? ?PR???????????????????????????????? ?????????????????! SOHO???????????????! ????????????????????!!???????????????????! ????????????????????????????????!? ??? !! ?????????? ? http://www.soho-comu.rash.jp/ ?PR???????????????????????????????? ???????5??????????????? ?????????????????????????? ??SOHO??????????3??????????????? ?????????????????????????? ?1????????????????! ????????????! ????????????????????????????? ?2?????????????????????????! ??????! ?SOHO????????????????! ?3??????????????????????!?????! ????????????????????! ? ? ????????? ? ???????! ??????????!! ? ? ????? http://www.soho-comu.rash.jp/ ???????????????? ????????????????? ?????????????????????????? ????SOHO??????!! ?????????????? 1.???? ? 18,500 ? 5,550? 2.?????????????? ? 10,550 ? 45,900? 3.????????? ? 1,000 ? 31,531? 4.????????? 6 ? 42,000? 5.?????????? 4 ? 13,500? 6.???????????????? ? 90 ? 45,000? ????????183,481????? ???????????????????(1?2?4????)???????!! ? http://www.soho-comu.rash.jp/ ? ?(??????????) ????????????????????????? ???????????????! ????????????!! ??????????????????????????????????? ?????????????????????????SOHO?????????? ?????????????????????????????????????????? ??????????????????????????????????? ??????????????? ??????????????????????????????????????? ?????????????????????? ?????????????????????????????????? ??????????????????????????? ?????????????????????????????????????? http://regist.mail-magazine.co.jp/d/69rm&m=@B731jq205cb1rd5j ??????????????????????????????????? ??????????????)??????????????Web?????????? ??????????????????????????????????? Copyright (c) 1999 ???????????????????????All rights reserved.??????? From hjemli at gmail.com Mon May 30 23:31:26 2011 From: hjemli at gmail.com (Lars Hjemli) Date: Mon, 30 May 2011 23:31:26 +0200 Subject: [PATCH] ui_repolist: get modtime from packed-refs as fallback In-Reply-To: <1305320974-8453-1-git-send-email-mailings@hupie.com> References: <1305320974-8453-1-git-send-email-mailings@hupie.com> Message-ID: On Fri, May 13, 2011 at 23:09, Ferry Huberts wrote: > When no modtime could be determined then as a final > fallback try to get it from the packed-refs. > > This will show an idle time when a repository has been packed > with all refs in the packed-refs. Thanks, applied to master. -- larsh From hjemli at gmail.com Tue May 31 00:02:13 2011 From: hjemli at gmail.com (Lars Hjemli) Date: Tue, 31 May 2011 00:02:13 +0200 Subject: CGit and modification times In-Reply-To: <20110518101924.GA15410@plenz.com> References: <4DCDA0B9.4000108@hupie.com> <4DCE356E.3040807@hupie.com> <20110518101924.GA15410@plenz.com> Message-ID: On Wed, May 18, 2011 at 12:19, Julius Plenz wrote: > Lars: It may be worth starting a FAQ page. What do you think? I agree, and I've now created the branch 'wiki' to get this going. The content of this branch is rendered at hjemli.net/git/cgit/about due to the following cgitrc: about-filter=markdown repo.readme=wiki:index I've also added a (currently empty) faq-file which is announced on the index page. Patches to this 'wiki' are most welcome! -- larsh From hjemli at gmail.com Tue May 31 00:33:45 2011 From: hjemli at gmail.com (Lars Hjemli) Date: Tue, 31 May 2011 00:33:45 +0200 Subject: [PATCH] Properly escape ampersands inside HTML attributes In-Reply-To: <20110524183840.GA1238@blizzard> References: <20110524183840.GA1238@blizzard> Message-ID: On Tue, May 24, 2011 at 20:38, Lukas Fleischer wrote: > Ampersands ("&") appearing inside HTML attributes need to be translated > to "&". Otherwise, invalid XHTML will be generated at various > places, such as at tree views containing links to submodules. Thanks, applied to stable. -- larsh From hjemli at gmail.com Tue May 31 00:42:26 2011 From: hjemli at gmail.com (Lars Hjemli) Date: Tue, 31 May 2011 00:42:26 +0200 Subject: Updates to stable and master on hjemli.net In-Reply-To: <4DDC0286.3050306@hupie.com> References: <4DDC0286.3050306@hupie.com> Message-ID: On Tue, May 24, 2011 at 21:09, Ferry Huberts wrote: >> ? ? ? new_filter: determine extra_args from filter type >> ? ? ? cgit_open_filter: also take the repo as a parameter >> ? ? ? cgit_open_filter: hand down repo configuration to script >> ? ? ? filters: document environment variables in filter scripts > > These patches are now working for me on my git server :-) > > I've included the script as an example. > > PS. Lars: this script is an 'improved' version over the one in the tree, > do you want a patch for it? Sure, but I'd like to keep the "fictional bugtracker" comment + link. -- larsh From hjemli at gmail.com Tue May 31 00:54:34 2011 From: hjemli at gmail.com (Lars Hjemli) Date: Tue, 31 May 2011 00:54:34 +0200 Subject: Incorrect default install path for Apache on Mac In-Reply-To: References: <970199E2-E0EC-4539-A95A-AAE64B021295@gmail.com> Message-ID: On Thu, May 26, 2011 at 07:48, Alex Smith wrote: > > On 2011-05-23, at 8:01 PM, Lars Hjemli wrote: > >> On Tue, May 24, 2011 at 01:30, Alex Smith wrote: >>> On Mac install goes more like this however, it won't install to the default htdocs dir on a mac: >>> make get-git >>> make NEEDS_LIBICONV=YesPlease get-git >>> sudo make NEEDS_LIBICONV=YesPlease install >> >> sligthly off-topic: >> * the get-git target is only needed once (to download the sources for libgit.a) >> * if you've done 'git submodule init; git submodule update', there's >> no need to 'make get-git' at all >> * specifying NEEDS_LIBICONV is also only needed once (during building, >> not install) >> > > I made a typo earlier but not where you would think. From experience getting this to compile, it's necessary for me to compile like: > > # Compile just cgit (if you already have git) > make NEEDS_LIBICONV=YesPlease > # Download/compile git and compile cgit > make NEEDS_LIBICONV=YesPlease get-git > # Do the install: > sudo make NEEDS_LIBICONV=YesPlease install > > If you don't include the NEEDS_LIBICONV=YesPlease to the install phase I get: > sudo make install > ? ?SUBDIR git > ? ?SUBDIR git > ? ?CC cgit > Undefined symbols: Yeah, this is because you downloaded a new snapshot of the git sourcecode in step 2 above, which triggers a rebuild of the cgit binary during install. The build-procedure should be like this: 1) make get-git (but only if you build from a cgit tarball - see README for more info) 2) make (add any special options here or in cgit.conf) 3) make test (runs the selftests, optional) 4) make install > I looked at the makefile and in order for it to "comply" with where to put it, you'd need patience and support spaces in directory paths. It unknowingly fails when presented with spaces for libdir: > > Proper directories for these files are: > CGIT_SCRIPT_PATH=/Library/WebServer/Documents/cgit > libdir=/Library/Application\ Support > docdir=/Library/Documentation/Applications/cgit > > I think this should comply with standards in the Darwin world. Thanks. A patch to the Makefile with a darwin-specific section containing your findings would be much appreciated. -- larsh From mailings at hupie.com Tue May 31 10:22:47 2011 From: mailings at hupie.com (Ferry Huberts) Date: Tue, 31 May 2011 10:22:47 +0200 Subject: git gc and idle times In-Reply-To: <20110511160628.7d00fb2a@andromeda.ipd.uni-karlsruhe.de> References: <20110511160628.7d00fb2a@andromeda.ipd.uni-karlsruhe.de> Message-ID: <4DE4A557.7040604@hupie.com> On 05/11/2011 04:06 PM, Thomas Moschny wrote: > Hi, > > we are using cgit 0.9 successfully on a bunch of repositories. Nice > tool! > > One question however: After running git-gc on some of the repositories, > the overview page of cgit misses idle times for those. The idle time is > back after pushing a commit. Is there something that needs to be > adjusted/fixed manually after running git-gc? Or is it a bug of cgit? > patch is in master: 21e0e0bfac660072a4518f91f59d5c4bf6e764b5 grtz -- Ferry Huberts