Re: Git repo problem?

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Git repo problem?
Дата
Msg-id 20190613160543.GV2480@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: Git repo problem?  (Tatsuo Ishii <ishii@sraoss.co.jp>)
Ответы Re: Git repo problem?  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-www
Greetings,

* Tatsuo Ishii (ishii@sraoss.co.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

Вложения

В списке pgsql-www по дате отправления:

Предыдущее
От: Tatsuo Ishii
Дата:
Сообщение: Re: Git repo problem?
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: Git repo problem?