Bug#663357: uscan: Please support scanning git repositories for tags
Niels Thykier
niels at thykier.net
Tue Apr 23 09:29:23 UTC 2013
On 2013-04-23 10:58, Maximiliano Curia wrote:
> Tags: + patch
>
> Hi,
>
Hi,
(Disclaimer: not the maintainer).
> I'm attaching a very basic patch that adds git support to watch files.
>
> With this patch a watch file of the form:
> version=3
> git://anongit.kde.org/bomber.git tags/v([\d.]+)
>
Interesting idea and I suspect it will be very useful.
> [...]
>
>
> @@ -982,8 +982,64 @@ sub process_watchline ($$$$$$)
> warn "$progname warning: In $watchfile,\n no matching hrefs for watch line\n $line\n";
> return 1;
> }
> - }
> - else {
> + } elsif ($site =~ m%^git://%) {
> + # TODO: check if there is a git command
> + # sanitize $base
> + open(REFS, "git ls-remote $base |");
Why do you use "2-arg open" here? A "3-arg open" would avoid issues
with quoting. E.g.
open(REFS, '-|', 'git', 'ls-remote', $base)
Also, the return value of open is not checked. So if it fails (e.g. git
is not installed) it will cause a lot of warnings from reading an
"unopened handle".
~Niels
More information about the devscripts-devel
mailing list