Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for number of lines changed for git logs for each file #557

Merged
merged 3 commits into from May 14, 2024

Conversation

konstantin-shatalov
Copy link

@konstantin-shatalov konstantin-shatalov commented Apr 5, 2024

I noticed that json output for "git log --stat" didn't include the number of rows changed for each file.
This change will add number of line changed for each file. To me this was useful to filter on file that I didn't need in stats.
This info is indeed in raw output from "git log --stat" and would be nice to include in json output as well.

Old structure for stats was:

"stats": {
            "files_changed": 2,
            "insertions": 3,
            "deletions": 2,
            "files": [
                ".../test1.kt",
                ".../test2.kt",
            ]
        }

Now it is:

"stats": {
            "files_changed": 2,
            "insertions": 3,
            "deletions": 2,
            "files": [
                {
                    "name": ".../test1.kt",
                    "lines_changed": 2
                },
                {
                    "name": ".../test2.kt",
                    "lines_changed": 3
                }
            ]
        }

@konstantin-shatalov konstantin-shatalov changed the title Added support for number of lines changed for git logs Added support for number of lines changed for git logs for each file Apr 5, 2024
@kellyjonbrazil
Copy link
Owner

Thank you for the contribution! To keep the schema backwards compatible, we should probably create a new key called file_stats and add the new info there and keep the files schema the same.

@kellyjonbrazil kellyjonbrazil changed the base branch from master to dev April 13, 2024 17:26
@kellyjonbrazil
Copy link
Owner

I'll go ahead and pull this in but I'll make some changes to keep backwards compatibility and do some more error checking. Thanks again!

@kellyjonbrazil kellyjonbrazil merged commit 0faacb6 into kellyjonbrazil:dev May 14, 2024
0 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants