[git-bz] Initial import (#1051681)

Ville Skyttä scop at fedoraproject.org
Mon Jan 13 15:19:25 UTC 2014


commit 2b7eef6eea4ccb9aea2992af54f63a0e7ea928b9
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon Jan 13 17:17:10 2014 +0200

    Initial import (#1051681)

 .gitignore                                         |    1 +
 ...dd-default-config-for-bugzilla.redhat.com.patch |   30 +++++++++++
 ...cookies-for-.host-in-addition-to-host-fro.patch |   36 +++++++++++++
 Include-token-when-submitting-patches.patch        |   44 ++++++++++++++++
 git-bz.spec                                        |   54 ++++++++++++++++++++
 sources                                            |    1 +
 6 files changed, 166 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..dafa321 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/*.tar.*
diff --git a/0001-Add-default-config-for-bugzilla.redhat.com.patch b/0001-Add-default-config-for-bugzilla.redhat.com.patch
new file mode 100644
index 0000000..d8cad64
--- /dev/null
+++ b/0001-Add-default-config-for-bugzilla.redhat.com.patch
@@ -0,0 +1,30 @@
+From a1f43dcd132929580f3507afe017c4795468fcd3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta at iki.fi>
+Date: Sat, 21 Dec 2013 15:08:06 +0200
+Subject: [PATCH] Add default config for bugzilla.redhat.com.
+
+---
+ git-bz | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/git-bz b/git-bz
+index 495ff51..83040af 100755
+--- a/git-bz
++++ b/git-bz
+@@ -66,6 +66,13 @@ https = true
+ default-priority = ---
+ """
+ 
++CONFIG['bugzilla.redhat.com'] = \
++"""
++https = true
++default-product = Fedora
++default-version = rawhide
++"""
++
+ # Default values for options that can be configured via 'git config'
+ git_config = {
+     'browser': 'firefox3',
+-- 
+1.8.3.1
+
diff --git a/0001-Search-for-cookies-for-.host-in-addition-to-host-fro.patch b/0001-Search-for-cookies-for-.host-in-addition-to-host-fro.patch
new file mode 100644
index 0000000..3c9b69d
--- /dev/null
+++ b/0001-Search-for-cookies-for-.host-in-addition-to-host-fro.patch
@@ -0,0 +1,36 @@
+From b5c1b167a38e8399fed23aa71964edbcefe711a9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta at iki.fi>
+Date: Sat, 21 Dec 2013 13:33:48 +0200
+Subject: [PATCH] Search for cookies for ".host" in addition to "host" from
+ sqlite.
+
+At least bugzilla.redhat.com ones are stored like that.
+---
+ git-bz | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/git-bz b/git-bz
+index dbdef34..9d53fe0 100755
+--- a/git-bz
++++ b/git-bz
+@@ -586,7 +586,7 @@ def get_cookies_from_sqlite(host, cookies_sqlite, browser, query, chromium_time=
+ 
+ def get_cookies_from_sqlite_xulrunner(host, cookies_sqlite, name):
+     return get_cookies_from_sqlite(host, cookies_sqlite, name,
+-                                   "select name,value,path,expiry from moz_cookies where host = :host")
++                                   "select name,value,path,expiry from moz_cookies where host in (:host, '.'||:host)")
+ 
+ def get_bugzilla_cookies_ff3(host):
+     profiles_dir = os.path.expanduser('~/.mozilla/firefox')
+@@ -643,7 +643,7 @@ def get_bugzilla_cookies_chr(host, browser, config_dir):
+     if not os.path.exists(cookies_sqlite):
+         raise CookieError("%s doesn't exist" % cookies_sqlite)
+     return get_cookies_from_sqlite(host, cookies_sqlite, browser,
+-                                   "select name,value,path,expires_utc from cookies where host_key = :host",
++                                   "select name,value,path,expires_utc from cookies where host_key in (:host, '.'||:host)",
+                                    chromium_time=True)
+ 
+ def get_bugzilla_cookies_chromium(host):
+-- 
+1.8.3.1
+
diff --git a/Include-token-when-submitting-patches.patch b/Include-token-when-submitting-patches.patch
new file mode 100644
index 0000000..b96f315
--- /dev/null
+++ b/Include-token-when-submitting-patches.patch
@@ -0,0 +1,44 @@
+From 0eba6242103ca3dd65108e693cc128f160fc8597 Mon Sep 17 00:00:00 2001
+From: Hib Eris <hib at hiberis.nl>
+Date: Fri, 12 Apr 2013 17:17:36 +0200
+Subject: [PATCH] Include token when submitting patches
+
+... to make it work on bugs.freedesktop.org.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=700502
+---
+ git-bz | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+diff --git a/git-bz b/git-bz
+index cdaf031..3aed35e 100755
+--- a/git-bz
++++ b/git-bz
+@@ -1245,12 +1245,25 @@ class Bug(object):
+         print self.get_url()
+ 
+     def create_patch(self, description, comment, filename, data, obsoletes=[], status='none'):
++
++        # Get token from html enter attachment form
++        url = "/attachment.cgi?bugid=" + str(self.id) + "&action=enter"
++        response = self.server.send_request("GET", url)
++        if response.status != 200:
++            die ("Failed to retrieve attachment token: %d" % response.status)
++        html = response.read()
++        match = re.search(r'<input type="hidden" name="token" value="(\w*)">', html)
++        if match is None:
++            die ("Failed to find attachment token")
++        token = match.group(1)
++
+         fields = {}
+         fields['bugid'] = str(self.id)
+         fields['action'] = 'insert'
+         fields['ispatch'] = '1'
+         fields['attachments.status'] = status
+         fields['description'] = description
++        fields['token'] = token
+         if comment:
+             fields['comment'] = comment
+         if obsoletes:
+-- 
+1.8.1.2
\ No newline at end of file
diff --git a/git-bz.spec b/git-bz.spec
new file mode 100644
index 0000000..ff86273
--- /dev/null
+++ b/git-bz.spec
@@ -0,0 +1,54 @@
+%global gitdate 20130906
+%global gitrev  5ae7a50
+
+Name:           git-bz
+Version:        0
+Release:        0.1.%{gitdate}git%{gitrev}%{?dist}
+Summary:        Command line integration of git with Bugzilla
+
+License:        GPLv2+
+URL:            http://blog.fishsoup.net/2008/11/16/git-bz-bugzilla-subcommand-for-git/
+Source0:        http://git.fishsoup.net/cgit/git-bz/snapshot/%{name}-%{gitrev}.tar.bz2
+# https://bugzilla.gnome.org/show_bug.cgi?id=673826
+Patch0:         0001-Search-for-cookies-for-.host-in-addition-to-host-fro.patch
+# https://bugzilla.gnome.org/show_bug.cgi?id=700502
+Patch1:         Include-token-when-submitting-patches.patch
+# https://bugzilla.gnome.org/show_bug.cgi?id=673828
+Patch2:         0001-Add-default-config-for-bugzilla.redhat.com.patch
+BuildArch:      noarch
+
+Requires:       git
+BuildRequires:  asciidoc
+BuildRequires:  xmlto
+
+%description
+git-bz is a tool for integrating the Git command line with the
+Bugzilla bug-tracking system. Operations such as attaching patches to
+bugs, applying patches in bugs to your current tree, and closing bugs
+once you've pushed the fixes publicly can be done completely from the
+command line without having to go to your web browser.
+
+
+%prep
+%autosetup -n %{name}-%{gitrev}
+
+
+%build
+%configure
+make %{?_smp_mflags}
+
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%make_install
+
+
+%files
+%doc COPYING git-bz.html TODO
+%{_bindir}/git-bz
+%{_mandir}/man1/git-bz.1*
+
+
+%changelog
+* Fri Jan 10 2014 Ville Skyttä <ville.skytta at iki.fi> - 0-0.1.20130906git5ae7a50
+- First build.
diff --git a/sources b/sources
index e69de29..9869d26 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+fb31219924b5175ab5ff0a87873535df  git-bz-5ae7a50.tar.bz2


More information about the scm-commits mailing list