[GitPython] Use the right patches
Jesse Keating
jkeating at fedoraproject.org
Sat May 28 05:27:48 UTC 2011
commit 29d71ceb8a7f03b2783d1fe3558d8daf1c6858d5
Author: Jesse Keating <jkeating at redhat.com>
Date: Fri May 27 20:51:12 2011 -0700
Use the right patches
...dle-indented-comments-in-git-config-files.patch | 6 ++--
0001-Handle-indented-config-sections.patch | 37 --------------------
...number-of-leading-spaces-in-config-values.patch | 28 ---------------
...Strip-the-line-when-matching-for-sections.patch | 29 +++++++++++++++
GitPython.spec | 6 ++--
5 files changed, 35 insertions(+), 71 deletions(-)
---
diff --git a/0002-Handle-indented-comments-in-git-config-files.patch b/0001-Handle-indented-comments-in-git-config-files.patch
similarity index 88%
rename from 0002-Handle-indented-comments-in-git-config-files.patch
rename to 0001-Handle-indented-comments-in-git-config-files.patch
index ca48114..05a4807 100644
--- a/0002-Handle-indented-comments-in-git-config-files.patch
+++ b/0001-Handle-indented-comments-in-git-config-files.patch
@@ -1,7 +1,7 @@
-From e33a0621c1fb373bc8f07fc1d1e374f76e78088a Mon Sep 17 00:00:00 2001
+From 705d844aa102a2824bc860feb843e660e614771c Mon Sep 17 00:00:00 2001
From: Jesse Keating <jkeating at redhat.com>
Date: Fri, 27 May 2011 19:55:15 -0700
-Subject: [PATCH 2/2] Handle indented comments in git config files
+Subject: [PATCH 1/2] Handle indented comments in git config files
It's perfectly valid for a git config file to contain comments inside
sections, e.g.:
@@ -16,7 +16,7 @@ The git tools all parse this fine while GitPython was choking on it.
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/git/config.py b/lib/git/config.py
-index 236b4dc..7547a7d 100644
+index e5fd990..d893ebc 100644
--- a/lib/git/config.py
+++ b/lib/git/config.py
@@ -190,13 +190,14 @@ class GitConfigParser(cp.RawConfigParser, object):
diff --git a/0002-Strip-the-line-when-matching-for-sections.patch b/0002-Strip-the-line-when-matching-for-sections.patch
new file mode 100644
index 0000000..c1b9f92
--- /dev/null
+++ b/0002-Strip-the-line-when-matching-for-sections.patch
@@ -0,0 +1,29 @@
+From c8a83994c986d54fc5115783a2eec0d7e2bd1928 Mon Sep 17 00:00:00 2001
+From: Jesse Keating <jkeating at redhat.com>
+Date: Fri, 27 May 2011 20:48:40 -0700
+Subject: [PATCH 2/2] Strip the line when matching for sections
+
+The SECTCRE regex does not seem to ignore leading spaces before a
+section in the config and will cause a traceback. However git itself
+parses these files just fine. Stripping the line resolves the issue.
+https://bugzilla.redhat.com/show_bug.cgi?id=706218
+---
+ lib/git/config.py | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/lib/git/config.py b/lib/git/config.py
+index d893ebc..5db4f6c 100644
+--- a/lib/git/config.py
++++ b/lib/git/config.py
+@@ -204,7 +204,7 @@ class GitConfigParser(cp.RawConfigParser, object):
+ continue
+ else:
+ # is it a section header?
+- mo = self.SECTCRE.match(line)
++ mo = self.SECTCRE.match(line.strip()) # strip the line to remove leading spaces
+ if mo:
+ sectname = mo.group('header')
+ if sectname in self._sections:
+--
+1.7.4.4
+
diff --git a/GitPython.spec b/GitPython.spec
index 7fe0e20..ba3c7c8 100644
--- a/GitPython.spec
+++ b/GitPython.spec
@@ -17,10 +17,10 @@ BuildRequires: python-devel python-setuptools
Requires: /usr/bin/git
# https://github.com/gitpython-developers/GitPython/commit/ea5d365a93a98907a1d7c25d433efd06a854109e
Patch0: 0001-Match-any-number-of-leading-spaces-in-config-values.patch
-# https://github.com/jkeating/GitPython/commit/d27cd97d8317094454510e904b49c5c537fa202c
-Patch1: 0001-Handle-indented-config-sections.patch
# https://github.com/tmzullinger/GitPython/commit/69253459a4924e2bf71cf42cd5e2c1c9e33af137
-Patch2: 0002-Handle-indented-comments-in-git-config-files.patch
+Patch1: 0001-Handle-indented-comments-in-git-config-files.patch
+# https://github.com/jkeating/GitPython/commit/61d16f0a6e4e11ced051883117008d00e761d666
+Patch2: 0002-Strip-the-line-when-matching-for-sections.patch
%description
GitPython is a python library used to interact with Git repositories.
More information about the scm-commits
mailing list