Re: Git repo problem?

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
Cc: magnus(at)hagander(dot)net, pgsql-www(at)lists(dot)postgresql(dot)org
Subject: Re: Git repo problem?
Date: 2019-06-13 16:05:43
Message-ID: 20190613160543.GV2480@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

Greetings,

* Tatsuo Ishii (ishii(at)sraoss(dot)co(dot)jp) wrote:
> > That sounds a lot like the bug that Stephen bumped into during pgcon, and
> > that we haven't fully tracked down yet. It only makes the commit email
> > break, everything else should work as usual, so it's not that bad, but it
> > should be fixed of course.
> >
> > Did that push by any chance include a merge commit? That's our current
> > theory on what's triggering the problem...
>
> Yes. I pushed:
> https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=b9ee8417ea74798c108498849d453e693246c3a1
> and
> https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=d1a2e366afeee87493db3463baa6660f9671e5d6
>
> The latter is a merge commit.

It turns out that the issue seems to be when there is no diffstat for a
given commit and the last line read is appended back to the list:

if not l.startswith(" "):
# If there is no starting space, it means there were no stats rows,
# and we're already looking at the next commit. Put this line back
# on the list and move on
lines.append(l)
break

This ends up adding a regular str (and not a byte string) to the list,
which blows up later when we try to do a 'decode' on it, in the next
pass.

Instead, I believe this should be:

if not l.startswith(" "):
# If there is no starting space, it means there were no stats rows,
# and we're already looking at the next commit. Put this line back
# on the list and move on
lines.append(l.encode('utf-8'))
break

Local testing showed that to fix it, but I'd like to give Magnus an
opportunity to review and confirm that this fix makes sense before
changing things on the git server.

Thanks!

Stephen

In response to

Responses

Browse pgsql-www by date

  From Date Subject
Next Message Magnus Hagander 2019-06-14 09:35:02 Re: Git repo problem?
Previous Message Tatsuo Ishii 2019-06-11 07:17:37 Re: Git repo problem?