Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Guinevere Larsen <guinevere@redhat.com>
To: Simon Marchi <simark@simark.ca>,
	Simon Marchi <simon.marchi@efficios.com>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] gdb: fix bugs in gdb/copyright.py, make it use glob patterns
Date: Fri, 11 Apr 2025 11:45:08 -0300	[thread overview]
Message-ID: <4a8030f1-34f2-4217-9711-413ba709d5e8@redhat.com> (raw)
In-Reply-To: <10aa0484-dde4-46c5-a94d-356741d0f8a1@simark.ca>

On 4/11/25 11:14 AM, Simon Marchi wrote:
> On 4/11/25 9:52 AM, Guinevere Larsen wrote:
>> On 4/9/25 11:49 AM, Simon Marchi wrote:
>>> gdb/copyright.py currently changes some files that it shouldn't:
>>>
>>>    - despite having a `gnulib/import` entry in EXCLUDE_LIST, it does
>>>      change the files under that directory
>>>    - it is missing `sim/Makefile.in`
>>>
>>> Change the exclude list logic to use glob patterns.  This makes it
>>> easier to specify exclusions of full directories or files by basename,
>>> while simplifying the code.
>>>
>>> Merge EXCLUDE_LIST and NOT_FSF_LIST, since there's no fundamental reason
>>> to keep them separate (they are treated identically).  I kept the
>>> comment that explains that some files are excluded due to not being
>>> FSF-licensed.
>>>
>>> Merge EXCLUDE_ALL_LIST in EXCLUDE_LIST, converting the entries to glob
>>> patterns that match everywhere in the tree (e.g. `**/configure`).
>>>
>>> Tested by running the script on the parent commit of d01e823438c7
>>> ("Update copyright dates to include 2025") and diff'ing the result with
>>> d01e823438c7.  The only differences are:
>>>
>>>    - the files that we don't want to modify (gnulib/import and
>>>      sim/Makefile.in)
>>>    - the files that need to be modified by hand
>>>
>>> Running the script on latest master produces no diff.
>> Is there any reason why you turned all globals into lists instead of tuples?
>>
>>  From what I can see in the script (and my understanding of it), there's no reason why the arrays should be mutable, so using the immutable tuple type would be better IMO.
> BY_HAND being an empty tuple messes up the typing, so I made it a
> list[str] to say that if it contained something, it would be strings.
> And then because I'm adding EXCLUDE_LIST and BY_HAND, it's easier if
> EXCLUDE_LIST is also a list[str].  But I can work around that one by
> doing:
>
>      full_exclude_list = list(EXCLUDE_LIST) + BY_HAND

would flipping that expression to

     full_exclude_list = EXCLUDE_LIST + tuple(BY_HAND)

also mess up the typing?

If that's the case, I'm fine with keeping them as lists, it was a minor 
nit anyway

>
> That all could be avoided if we just removed the BY_HAND thing, since
> it's unused at the moment.  But I thought it would be cheap to keep it
> around just it case we need it in the future.  Not sure which is better.
Yeah, I think recognizing that some files may need to be changed by 
hand, and keeping that easy is a good idea.
>
> Simon
>

-- 
Cheers,
Guinevere Larsen
She/Her/Hers


  reply	other threads:[~2025-04-11 14:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09 14:49 [PATCH 1/2] gdb: make typing strict in gdb/copyright.py Simon Marchi
2025-04-09 14:49 ` [PATCH 2/2] gdb: fix bugs in gdb/copyright.py, make it use glob patterns Simon Marchi
2025-04-11 13:52   ` Guinevere Larsen
2025-04-11 14:14     ` Simon Marchi
2025-04-11 14:45       ` Guinevere Larsen [this message]
2025-04-11 15:28         ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4a8030f1-34f2-4217-9711-413ba709d5e8@redhat.com \
    --to=guinevere@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=simon.marchi@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox