git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: 'pu' branch for StGIT

From
Karl Hasselström <kha@treskal.com>
Date
Aug 8, 2007, 23:23 UTC
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:
Show 7 quoted lines
> 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
Previous: Pavel RoskinNext: Pavel Roskin
Message 7 of 17 in “'pu' branch for StGIT”
  1. Karl HasselströmAug 7, 2007
  2. Shawn O. PearceAug 7, 2007
  3. Pavel RoskinAug 8, 2007
  4. Karl HasselströmAug 8, 2007
  5. Karl HasselströmAug 8, 2007
  6. Pavel RoskinAug 8, 2007
  7. Karl HasselströmAug 8, 2007
  8. Pavel RoskinAug 9, 2007
  9. Karl HasselströmAug 9, 2007
  10. Pavel RoskinAug 9, 2007
  11. Karl HasselströmAug 9, 2007
  12. Karl HasselströmAug 9, 2007
  13. Pavel RoskinAug 9, 2007
  14. Karl HasselströmAug 9, 2007
  15. Catalin MarinasAug 9, 2007
  16. Karl HasselströmAug 10, 2007
  17. Pavel RoskinAug 12, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.