Re: Integration with Bugzilla?

2014-10-26 Thread Lukas Fleischer
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
___
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit


Re: Integration with Bugzilla?

2014-10-24 Thread Joey Reid
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!
___
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit


Re: Integration with Bugzilla?

2014-10-21 Thread Lars Hjemli
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
___
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit


Re: Integration with Bugzilla?

2014-10-21 Thread Joey Reid
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
> ?
>
___
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit


Re: Integration with Bugzilla?

2014-09-29 Thread Lukas Fleischer
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
___
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit


Re: Integration with Bugzilla?

2014-09-29 Thread Ferry Huberts



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
___
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit


Re: Integration with Bugzilla?

2014-09-29 Thread Lukas Fleischer
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?
___
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit


Re: Integration with Bugzilla?

2014-09-29 Thread Ferry Huberts



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( = sectionsetting )
# 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|"${CGIT_REPO_PATH}")/ticket/\1\">#\1|g"

fi

sed -re "$regex"
___
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit


Re: Integration with Bugzilla?

2014-09-29 Thread Lukas Fleischer
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
___
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit


Integration with Bugzilla?

2014-09-29 Thread Joey Reid
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
?
___
CGit mailing list
CGit@lists.zx2c4.com
http://lists.zx2c4.com/mailman/listinfo/cgit