simonw / git-history

Tools for analyzing Git history using SQLite
Apache License 2.0
191 stars 18 forks source link

Support `--convert .` for reading code from standard input #48

Open cpwnd opened 2 years ago

cpwnd commented 2 years ago

I have an extensive xml file. It contains an xsd definition from which I generated an xml parser and class definitions via generateDS. Now I want to use it in the git-history import. I can also install the module manually via a setup.py, but I wanted to ask if you think adding a way to import local python modules is a good idea.

Nevertheless great tool! I have already some repos up and running :)

simonw commented 2 years ago

This came up in another of my projects just a few weeks ago:

https://github.com/simonw/sqlite-utils/issues/353#issuecomment-991376639 has a workaround that should work with git-history too:

PYTHONPATH=. git-history ... --import transform

So if your module is called transform.py in the current directory the above should cause it to be imported.

simonw commented 2 years ago

Implementing the same solution as https://github.com/simonw/sqlite-utils/issues/353 feels like a good idea to me.