Parser for git log --raw
Project description
glrp - git-log-raw-parser
A parser for parsing the command:
git log -p --format=raw --show-signature --stat
Why?
The above command provides a lot of useful information about git commits, which we can analyze, including:
- Commit message
- Diffs
- Author name and email
- Committer name and email
- Timestamps
- GPG signature
On its own, git log does not output its information in a format which is easy for other programs to use. So, this tool parses the output and turns it into JSON which is more easy to analyze and check.
Installation
pipx install glrp
Usage
Using it is simple, just run the git log command and pipe it to the standard input of git_log_raw_parser
git log -p --format=raw --show-signature --stat | python3 -m glrp --output-dir=./out/
Or perhaps a bit more realistic:
git clone https://github.com/cfengine/core
(cd core && git log -p --format=raw --show-signature --stat HEAD~500..HEAD 2>/dev/null) | python3 git_log_raw_parser.py
(Clone CFEngine core, start subshell which enters the subdirectory and runs git log for the past 500 commits).
Important notes
Warning: The output of --show-signature varies depending on which keys you have imported / trusted in your installation of GPG.
Make sure you import the correct GPG keys beforehand, and don't expect output to be identical across different machines with different GPG states.
Warning: Consider this a best-effort, "lossy" parsing. Commits may contain non utf-8 characters, to avoid "crashing", we skip these, replacing them with question marks. Thus, the parsing is lossy, don't expect all the information to be there. This tool can be used for searching / analyzing commits, but don't use it as some kind of backup tool where you expect to have the ability to "reconstruct" the commits and repo entirely.
Details
For details on how the parsing works, try running with --debug and look at the resulting ./debug/ folder.
Also, see the comments in the source code; ./git_log_raw_parser.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file glrp-0.0.3.tar.gz.
File metadata
- Download URL: glrp-0.0.3.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4831f8bc2eb00ffa77a2b21be94bb97d49f09db77180a03c3b93359bebd02e12
|
|
| MD5 |
012ee444047094c1b3f4b82010bb1ed3
|
|
| BLAKE2b-256 |
affbbe3bcff593e34204eb6847ffd806cbad76a4255befb3ad093b83dcb9e332
|
Provenance
The following attestation bundles were made for glrp-0.0.3.tar.gz:
Publisher:
python-publish.yml on olehermanse/glrp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
glrp-0.0.3.tar.gz -
Subject digest:
4831f8bc2eb00ffa77a2b21be94bb97d49f09db77180a03c3b93359bebd02e12 - Sigstore transparency entry: 227987410
- Sigstore integration time:
-
Permalink:
olehermanse/glrp@9440ef6739881f78fb67d6aa201c4cbf1d1d8223 -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/olehermanse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9440ef6739881f78fb67d6aa201c4cbf1d1d8223 -
Trigger Event:
release
-
Statement type:
File details
Details for the file glrp-0.0.3-py3-none-any.whl.
File metadata
- Download URL: glrp-0.0.3-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
879c7120b42bd8d8ab02d8e25275518525f120df8bdd4961a0306f7d4f188400
|
|
| MD5 |
93766bc913a6945b2559fc24cd503824
|
|
| BLAKE2b-256 |
8e583c324d15c65c51e68205b8692e7c378c6bfdf31037079be3dc5de9d5c3ef
|
Provenance
The following attestation bundles were made for glrp-0.0.3-py3-none-any.whl:
Publisher:
python-publish.yml on olehermanse/glrp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
glrp-0.0.3-py3-none-any.whl -
Subject digest:
879c7120b42bd8d8ab02d8e25275518525f120df8bdd4961a0306f7d4f188400 - Sigstore transparency entry: 227987416
- Sigstore integration time:
-
Permalink:
olehermanse/glrp@9440ef6739881f78fb67d6aa201c4cbf1d1d8223 -
Branch / Tag:
refs/tags/0.0.3 - Owner: https://github.com/olehermanse
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@9440ef6739881f78fb67d6aa201c4cbf1d1d8223 -
Trigger Event:
release
-
Statement type: