On Mon, 16 Nov 2020 at 11:51, Martin Liška wrote: > > On 11/16/20 12:17 PM, Maciej W. Rozycki wrote: > > On Mon, 16 Nov 2020, Martin Liška wrote: > > > >>> I have decided to give your `contrib/mklog.py' script a hit and, well, > >>> ahem, I guess I must be doing something utterly silly, but no matter what > >>> kind of a diff I hand to the script it does not produce anything unless I > >>> apply a patch like below to it, in which case the output produced is as > >>> expected. > >> > >> Hm, it should not be really needed. See: > >> > >> $ git show > 1 > >> $ ipython > >> $ from unidiff import PatchSet > >> $ PatchSet(open('1')) > >> Out[2]: <PatchSet: [<PatchedFile: gcc/config/i386/i386.h>, <PatchedFile: > >> gcc/doc/invoke.texi>]> > > > > Hmm, > > > > $ ipython > > -bash: ipython: command not found > > $ > > > >>> What's going on here -- has the API of `PatchSet' changed so much at > >>> one > >>> point? Can we do anything to prevent someone else from tripping over this > >>> issue? > >> > >> Can you please show how do you use the script and what's the output? > > > > Sure, let's pick your recent change: > > > > $ git show 2935ff7eb7ac | contrib/mklog.py > > $ > > > > Nothing, as I wrote. With my tweaked version I instead get: > > > > $ git show 2935ff7eb7ac | ../mklog.py > > ChangeLog: > > > > * gcc/testsuite/g++.dg/ubsan/pr61272.C: > > > > $ > > > > which is not perfect as it failed to pick ChangeLog from gcc/testsuite/, > > but at least it's a starting point. > > Hm, I see proper output: > > $ git show 2935ff7eb7ac | contrib/mklog.py > gcc/testsuite/ChangeLog: > > * g++.dg/ubsan/pr61272.C:
FWIW I also get the expected output using Python 3.8.6 and unidiff 0.6.0.