⚠️☢️☣️ For this to work properly, it must be run within the main folder of a Git repository and Git must be installed. ☣️☢️⚠️
Git History Analyzer
https://pypi.org/project/git-history-analyzer/
This package provides a simple way to analyze the commit history of a specified file in a Git repository. It retrieves the complete commit history along with the changes made in each commit, allowing users to track modifications effectively.
Features
- Retrieve commit history for a specific file.
- Display details such as commit ID, author, date, and commit message.
- Track line changes with added and removed lines.
Installation
You can install the package using pip:
pip install git-history-analyzer
Usage
Here's how to use the GitCommitsReportGenerator function:
Parameters
report_type=['blame', 'log_history'], print_details=False
list_files_to_read(list): list of The path to the files you want to analyze. Please use single slashes (/) for linux or double backslashes (\\) for windows, depending on the operating system you are using to avoid directory-related issues.report_type(list) ['blame', 'log_history']print_details(bool): If set toTrue, the function will print the details of each commit. Default isFalse.
Output
The function returns a list of dictionaries, where each dictionary contains:
Branch: The branch currently under analysis.commit_id: The ID of the commit.commit_author: The author of the commit.commit_email: The author's email address.commit_date: The date of the commit.commit_message: The message associated with the commit.changes: A list of changes, each detailing the type (added or removed), the line content, and the line number.
Reports Directory
for blame_report_main.py and log_history_main.py
📦 jorge_cardona_project [project_directory] ┗ report [package] ┃ ┣ 📂 blame [package] ┃ ┃ ┣ blame_report_main.py ┃ ┣ 📂 log_history [package] ┃ ┃ ┣ log_history_main.py ┗ 📂 deployment [package] ┗ 📂 requirements [package] ┗ 📂 test [package] ┗ 🐍 main.py [__main__] ┗ 📜 README.md ┗ ⚠️ .gitignore
Example blame report
from git_history_analyzer import GitCommitsReportGenerator
# Example usage
list_files_to_read = ['C:\\Users\\USUARIO\\Documents\\satellite_notifier\\main.py',
'C:\\Users\\USUARIO\\Documents\\satellite_notifier\\.github\workflows\\main.yml']
GitCommitsReportGenerator(list_files_to_read=list_files_to_read,
report_type=['blame'],
print_details=True)
Example Output - blame report
Example log_history report
from git_history_analyzer import GitCommitsReportGenerator
# Example usage
list_files_to_read = ['C:\\Users\\USUARIO\\Documents\\satellite_notifier\\main.py',
'C:\\Users\\USUARIO\\Documents\\satellite_notifier\\.github\workflows\\main.yml']
GitCommitsReportGenerator(list_files_to_read=list_files_to_read,
report_type=['log_history'],
print_details=True)
Example Output - log_history report
Log History and Blame Reports (Without Print Details)
from git_history_analyzer import GitCommitsReportGenerator
# Example usage
list_files_to_read = ['C:\\Users\\USUARIO\\Documents\\satellite_notifier\\main.py',
'C:\\Users\\USUARIO\\Documents\\satellite_notifier\\.github\workflows\\main.yml']
GitCommitsReportGenerator(list_files_to_read=list_files_to_read)
Example Output - log_history report (Without Print Details)
Contributing
Contributions are welcome! Please fork the repository and submit a pull request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
Project Link: GitHub Repository
Release files for git-history-analyzer 0.0.13
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| git-history-analyzer-0.0.13.tar.gz | 10.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| git_history_analyzer-0.0.13-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.0 kB
Release files / git-history-analyzer-0.0.13.tar.gz
| Download URL | git-history-analyzer-0.0.13.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5f7506c65c31023fff43cc257efcbc47218dc23cd203244061dda1f24e81dde
|
|
BLAKE2b-256 checksum How to use checksums |
2444ccc0bc709ea248a3f3bbfc210e03381dfc9accfa1d7e7eb5c42c0c92099f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / git_history_analyzer-0.0.13-py3-none-any.whl
| Download URL | git_history_analyzer-0.0.13-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0738e7ee9d2156f591ef25122592d5d1d219a5b870fa19e73a89ff7f67d6c708
|
|
BLAKE2b-256 checksum How to use checksums |
31b567ff31c03bd56151f7c62174ec6e3eaa96b359bbe6c57f9e887247a46b7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|