Re: [PATCH] Import mklog.py from gcc repo

Simon Marchi
2020-09-25T14:25:44Z

On 2020-09-21 11:31 a.m., Simon Marchi via Gdb-patches wrote:
> On 2020-09-17 4:29 p.m., Simon Marchi wrote:
>> I've been using the mklog utility from the gcc repo for a while to
>> generate skeleton of ChangeLog entries. It recently got a rewrite as a
>> Python script. Unfortunately, to find the repository root, and
>> eventually to find in which ChangeLog file each entry goes, the new
>> script assumes it is located in the same git repository that it
>> generates ChangeLog entries for.
>>
>> This means that if you make a change in the gcc source tree and run
>> mklog.py from that same source tree, it works. But if you make changes
>> in your ~/src/binutils-gdb tree and run ~/src/gcc/contrib/mklog.py, it
>> won't work.
>>
>> IIRC, the old script required that you ran it with the project's root
>> directory as the CWD.
>>
>> The simplest way to fix this is to import the script in binutils-gdb and
>> use it from there. It's also nice because we can use it without having
>> a clone of the gcc repo.
>>
>> I also thought of adding a "--root" switch to the script to override the
>> project's base directory. However:
>>
>> 1) It is more work.
>> 2) If the script still lives in the gcc repo, it's less convenient than
>> having it in binutils-gdb.
>>
>> This patch imports contrib/mklog.py from the gcc repo, revision
>> c560591408440f441b8b327f5b41f9328d20b67b.
>>
>> contrib/ChangeLog:
>>
>> * mklog.py: New file, imported from gcc.
>>
>> Note: the ChangeLog entry above was generated using
>> `git show | ./mklog.py`!
>
> I'll push this at the end of the week if nobody disagrees.
>
> Simon
>

I pushed this patch.

Simon