From mboxrd@z Thu Jan 1 00:00:00 1970 From: joeyisdamanya at gmail.com (Joey Reid) Date: Mon, 29 Sep 2014 13:49:09 -0400 Subject: Integration with Bugzilla? Message-ID: I often run into situations where the git commit log references a bugzilla report. Such as this one http://cgit .freedesktop.org/libreoffice/core/commit/?id=559484d5871c7c0a7e771f75916c46f3a6a590ae Where fdo#60123 Refers to https://bugs.freedesktop.org/show_bug.cgi?id=60123 or this one where the bug is #i125581# https://github.com/apache/openoffice/commit/8cb619bd314a80fe7f7094b16f25d362979f0c69 Is it possible to have cgit parse the subject for fdo# or #i# and replace the plain text with a hyperlink containing ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mboxrd@z Thu Jan 1 00:00:00 1970 From: cgit at cryptocrack.de (Lukas Fleischer) Date: Mon, 29 Sep 2014 20:07:57 +0200 Subject: Integration with Bugzilla? In-Reply-To: References: Message-ID: <20140929180757.906.12865@typhoon.lan> On Mon, 29 Sep 2014 at 19:49:09, Joey Reid wrote: > [...] > Is it possible to have cgit parse the subject for fdo# or > #i# and replace the plain text with a hyperlink containing > ? > [...] Yes, you can use the commit-filter option [1, 2]. There also is a very basic commit filter in the cgit source tree [3]. [1] http://git.zx2c4.com/cgit/tree/cgitrc.5.txt#n114 [2] http://git.zx2c4.com/cgit/tree/cgitrc.5.txt#n582 [3] http://git.zx2c4.com/cgit/tree/filters/commit-links.sh From mboxrd@z Thu Jan 1 00:00:00 1970 From: mailings at hupie.com (Ferry Huberts) Date: Mon, 29 Sep 2014 20:09:48 +0200 Subject: Integration with Bugzilla? In-Reply-To: References: Message-ID: <5429A06C.30707@hupie.com> On 29/09/14 19:49, Joey Reid wrote: > I often run into situations where the git commit log references a > bugzilla report. Such as this one > > http://cgit.freedesktop.org/libreoffice/core/commit/?id=559484d5871c7c0a7e771f75916c46f3a6a590ae > > > Where fdo#60123 Refers to > https://bugs.freedesktop.org/show_bug.cgi?id=60123 > > or this one where the bug is #i125581# > https://github.com/apache/openoffice/commit/8cb619bd314a80fe7f7094b16f25d362979f0c69 > > Is it possible to have cgit parse the subject for fdo# or > #i# and replace the plain text with a hyperlink containing > ? > > Sure. The below script is what I use on my server to refer to a trac ticket. --- #!/bin/bash # # This script can be used to generate links in commit messages. # # To use this script, refer to this file with either the commit-filter or the # repo.commit-filter options in cgitrc. # # The following environment variables can be used to retrieve the configuration # of the repository for which this script is called: # CGIT_REPO_URL ( = repo.url setting ) # CGIT_REPO_NAME ( = repo.name setting ) # CGIT_REPO_PATH ( = repo.path setting ) # CGIT_REPO_OWNER ( = repo.owner setting ) # CGIT_REPO_DEFBRANCH ( = repo.defbranch setting ) # CGIT_REPO_SECTION ( = section setting ) # CGIT_REPO_CLONE_URL ( = repo.clone-url setting ) # declare regex="" # # Commit SHA1 # regex="s|\b([0-9a-fA-F]{7,40})\b|\1|g" # # Trac # # We have a trac instance for every repository, # located under /reposerf/trac/repoName # if [[ -n "${CGIT_REPO_PATH:-}" ]]; then regex="$regex s|#([0-9]+)\b|#\1|g" fi sed -re "$regex" From mboxrd@z Thu Jan 1 00:00:00 1970 From: cgit at cryptocrack.de (Lukas Fleischer) Date: Mon, 29 Sep 2014 20:30:49 +0200 Subject: Integration with Bugzilla? In-Reply-To: <5429A06C.30707@hupie.com> References: <5429A06C.30707@hupie.com> Message-ID: <20140929183049.1785.85360@typhoon.lan> On Mon, 29 Sep 2014 at 20:09:48, Ferry Huberts wrote: > [...] > #!/bin/bash > [...] This is a bit off topic but the script doesn't seem to rely on any bashisms (apart from the double brackets which can be ported easily), so it might be a good idea to use a "/bin/sh" shebang (and use a shell other than bash as "default shell") here? From mboxrd@z Thu Jan 1 00:00:00 1970 From: mailings at hupie.com (Ferry Huberts) Date: Mon, 29 Sep 2014 20:33:28 +0200 Subject: Integration with Bugzilla? In-Reply-To: <20140929183049.1785.85360@typhoon.lan> References: <5429A06C.30707@hupie.com> <20140929183049.1785.85360@typhoon.lan> Message-ID: <5429A5F8.1050504@hupie.com> On 29/09/14 20:30, Lukas Fleischer wrote: > On Mon, 29 Sep 2014 at 20:09:48, Ferry Huberts wrote: >> [...] >> #!/bin/bash >> [...] > > This is a bit off topic but the script doesn't seem to rely on any > bashisms (apart from the double brackets which can be ported easily), so > it might be a good idea to use a "/bin/sh" shebang (and use a shell > other than bash as "default shell") here? > my server is guaranteed to have bash, so no need to change it. but thanks for the hint anyway :-) also, this script is a very minor modification of the script that's in the source tree. -- Ferry Huberts From mboxrd@z Thu Jan 1 00:00:00 1970 From: cgit at cryptocrack.de (Lukas Fleischer) Date: Mon, 29 Sep 2014 22:32:23 +0200 Subject: Integration with Bugzilla? In-Reply-To: <5429A5F8.1050504@hupie.com> References: <5429A06C.30707@hupie.com> <20140929183049.1785.85360@typhoon.lan> <5429A5F8.1050504@hupie.com> Message-ID: <20140929203223.2104.57735@typhoon.lan> On Mon, 29 Sep 2014 at 20:33:28, Ferry Huberts wrote: > [...] > my server is guaranteed to have bash, so no need to change it. > but thanks for the hint anyway :-) > I am not (only) talking about portability here. My main concern is the current spate of bash vulnerabilities. As John pointed out earlier [1], these can be used to remotely exploit any cgit setup that uses a bash filter. We currently have at least five CVEs, some of which are very critical. So if you really want to use bash, you should at least closely follow the developments and always update your bash binary when there's a new security patch. > also, this script is a very minor modification of the script that's in > the source tree. > > -- > Ferry Huberts > [1] http://lists.zx2c4.com/pipermail/cgit/2014-September/002236.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: joeyisdamanya at gmail.com (Joey Reid) Date: Tue, 21 Oct 2014 21:22:17 -0400 Subject: Integration with Bugzilla? In-Reply-To: References: Message-ID: Last month, I asked I often run into situations where the git commit log references a bugzilla report. Such as this one http://cgit .freedesktop.org/libreoffice/core/commit/?id=559484d5871c7c0a7e771f75916c46f3a6a590ae Where fdo#60123 Refers to https://bugs.freedesktop.org/show_bug.cgi?id=60123 And was told to do this: http://people.freedesktop.org/~jrayhawk/cgit-filter.txt but after making the changes, cgit still does not link to bugzilla. Could anyone help or provide a working example? Thanks! On Mon, Sep 29, 2014 at 1:49 PM, Joey Reid wrote: > I often run into situations where the git commit log references a bugzilla > report. Such as this one > > http://cgit > .freedesktop.org/libreoffice/core/commit/?id=559484d5871c7c0a7e771f75916c46f3a6a590ae > > Where fdo#60123 Refers to > https://bugs.freedesktop.org/show_bug.cgi?id=60123 > > or this one where the bug is #i125581# > > https://github.com/apache/openoffice/commit/8cb619bd314a80fe7f7094b16f25d362979f0c69 > > Is it possible to have cgit parse the subject for fdo# or > #i# and replace the plain text with a hyperlink containing > ? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mboxrd@z Thu Jan 1 00:00:00 1970 From: hjemli at gmail.com (Lars Hjemli) Date: Wed, 22 Oct 2014 08:29:25 +0200 Subject: Integration with Bugzilla? In-Reply-To: References: Message-ID: On Wed, Oct 22, 2014 at 3:22 AM, Joey Reid wrote: > http://people.freedesktop.org/~jrayhawk/cgit-filter.txt In your config example, you specify the scan-path option before specifying the filter option. This means that the filter-option is not active when the scan-path option is processed. You need to specify all options which should be in effect for repositories found by scan-path before the actual scan-path directive is specified. PS: We should probably reword the scan-path section of cgitrc.5 to make this more obvious, and maybe also add an entry to the faq. -- larsh From mboxrd@z Thu Jan 1 00:00:00 1970 From: joeyisdamanya at gmail.com (Joey Reid) Date: Fri, 24 Oct 2014 16:25:01 -0400 Subject: Integration with Bugzilla? In-Reply-To: References: Message-ID: Yes, rewording the scan-path section of cgitrc.5 and adding an entry to the FAQ would be immensely helpful. The commit-links.sh and the trac script appear to spawn extra process. With servers like FreeDesktop's cgit under a heavy load, is there a way to minimize CPU usage? Thanks for all your help! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mboxrd@z Thu Jan 1 00:00:00 1970 From: cgit at cryptocrack.de (Lukas Fleischer) Date: Sun, 26 Oct 2014 11:41:29 +0100 Subject: Integration with Bugzilla? In-Reply-To: References: Message-ID: <20141026104129.5022.81655@typhoon.lan> On Fri, 24 Oct 2014 at 22:25:01, Joey Reid wrote: > Yes, rewording the scan-path section of cgitrc.5 and adding an entry to > the FAQ would be immensely helpful. > > The commit-links.sh and the trac script appear to spawn extra process. With > servers like FreeDesktop's cgit under a heavy load, is there a way > to minimize CPU usage? > [...] You can use Lua filters, check [1] for details. [1] http://git.zx2c4.com/cgit/tree/cgitrc.5.txt#n582