From: Karl Hasselström Date: Wed, 08 Aug 2007 23:23:49 GMT Subject: Re: 'pu' branch for StGIT Message-ID: <20070808232349.GA23172@diana.vm.bytemark.co.uk> In-Reply-To: <1186611514.7383.4.camel@dv> On 2007-08-08 18:18:34 -0400, Pavel Roskin wrote: > On Wed, 2007-08-08 at 23:39 +0200, Karl Hasselström wrote: > > > 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