Thread (28 messages) 28 messages, 5 authors, 2016-06-15

Re: 'pu' branch for StGIT

From: Karl Hasselström <hidden>
Date: 2016-06-15 22:43:28
Subsystem: the rest · Maintainer: Linus Torvalds

On 2007-08-08 18:18:34 -0400, Pavel Roskin wrote:
On Wed, 2007-08-08 at 23:39 +0200, Karl Hasselström wrote:
quoted
I can't reproduce.
OK, it's trickier. There are some bad patch names that don't get
imported properly. In particular, patches ending with ".diff" are
committed after import.
Ah, sneaky. And it turns out to be not a problem with import, but a
problem with dots in patch names. It's just that import is the only
place those are typically created.

It was all due to a sloppy regexp. This is the fix:
diff --git a/stgit/stack.py b/stgit/stack.py
index 4186ba9..c403f51 100644
--- a/stgit/stack.py
+++ b/stgit/stack.py
@@ -391,11 +391,11 @@ def read_refs(branch):
     given branch. The patches are listed by name; the branch head is
     None."""
     refs = {}
-    patchpat = re.compile(r'^refs/patches/%s/([^\.]+)$' % branch)
+    patchpat = re.compile(r'^refs/patches/%s/(.+)$' % branch)
     for line in git._output_lines('git-show-ref'):
         sha1, ref = line.split()
         m = re.match(patchpat, ref)
-        if m:
+        if m and not m.group(1).endswith('.log'):
             refs[m.group(1)] = sha1
         elif ref == 'refs/heads/%s' % branch:
             refs[None] = sha1
Thanks for taking the time to track this down -- with the detailed
symptoms you gave, I found it in no time. I've pushed an updated
series (as well as the other patches I've posted tonight) to
git://repo.or.cz/stgit/kha.git.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help