From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Bird, Tim" <Tim.Bird@sony.com>
Cc: "Gon Solo" <gonsolo@gmail.com>,
"Duje Mihanović" <duje.mihanovic@skole.hr>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ricardo Ribalda" <ribalda@chromium.org>,
"linux-spdx@vger.kernel.org" <linux-spdx@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: spdxcheck: python git module considered harmful (was RE: [PATCH] scripts/spdxcheck: Limit the scope of git.Repo)
Date: Tue, 8 Apr 2025 20:10:23 +0200 [thread overview]
Message-ID: <2025040816-pork-lisp-7b66@gregkh> (raw)
In-Reply-To: <MW5PR13MB5632E13F8F5B0B2B6DE3D16CFDB52@MW5PR13MB5632.namprd13.prod.outlook.com>
On Tue, Apr 08, 2025 at 05:34:20PM +0000, Bird, Tim wrote:
> > -----Original Message-----
> > From: Gon Solo <gonsolo@gmail.com>
> > It's a known problem:
> > https://github.com/gitpython-developers/GitPython/issues/2003
> > https://github.com/python/cpython/issues/118761#issuecomment-2661504264
> >
>
> For what it's worth, I've always been a bit skeptical of the use of the python git module
> in spdxcheck.py. Its use makes it impossible to use spdxcheck on a kernel source tree
> from a tarball (ie, on source not inside a git repo). Also, from what I can see in spdxcheck.py,
> the way it's used is just to get the top directories for either the LICENSES dir,
> the top dir of the kernel source tree, or the directory to scan passed on the
> spdxcheck.py command line, and then to use the repo.traverse() function on said directory.
>
> This ends up excluding any files in the source directory tree that are not checked
> into git yet, silently skipping them (which I've run into before when using the tool).
>
> I think the code could be relatively easily refactored to eliminate the use of the git
> module, to overcome these issues. I'm not sure if removing the module would
> eliminate the yield operation (used inside repo.traverse()), which seems to be causing the
> problem found here. IMHO, in my experience when using python it is helpful
> to use as few non-core modules as possible, because they tend to break like this
> occasionally.
>
> Let me know if anyone objects to me working up a refactoring of spdxcheck.py
> eliminating the use of the python 'git' module, and submitting it for review.
No objection from me!
next prev parent reply other threads:[~2025-04-08 18:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-25 13:10 [PATCH] scripts/spdxcheck: Limit the scope of git.Repo Ricardo Ribalda
2025-04-03 21:34 ` Ricardo Ribalda
2025-04-04 6:21 ` Greg Kroah-Hartman
2025-04-04 6:29 ` Ricardo Ribalda
2025-04-04 8:06 ` Greg Kroah-Hartman
2025-04-07 14:38 ` Duje Mihanović
2025-04-08 8:39 ` Gon Solo
2025-04-08 9:33 ` Gon Solo
2025-04-08 10:36 ` Gon Solo
2025-04-08 17:34 ` spdxcheck: python git module considered harmful (was RE: [PATCH] scripts/spdxcheck: Limit the scope of git.Repo) Bird, Tim
2025-04-08 18:10 ` Greg Kroah-Hartman [this message]
2025-04-08 21:39 ` Ricardo Ribalda
2025-04-08 23:41 ` Thomas Gleixner
2025-04-09 17:44 ` Bird, Tim
2025-04-09 20:25 ` Thomas Gleixner
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=2025040816-pork-lisp-7b66@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=Tim.Bird@sony.com \
--cc=duje.mihanovic@skole.hr \
--cc=gonsolo@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spdx@vger.kernel.org \
--cc=ribalda@chromium.org \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.