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

New parser request: git log --numstat #461

Open
avi-cenna opened this issue Sep 24, 2023 · 3 comments
Open

New parser request: git log --numstat #461

avi-cenna opened this issue Sep 24, 2023 · 3 comments

Comments

@avi-cenna
Copy link

It would be nice to have a parser for git log --numstat. This command shows the number of additions and deletions for each file in a commit.

@kellyjonbrazil
Copy link
Owner

Thanks for the parser request! Seems like a good addition. Might be a new parser or a possible addition to the existing --git-log parsers.

@pwnetrationguru
Copy link

I was about to file a similar issue. Before digging in, I'd like to verify @kellyjonbrazil that you'd be interested in merging the change in.

Proposal would be to change output of --git-log from:

  {
    "commit": "0e49db35a8f39fa8cdcdbe18fc02efbe6b38bf3a",
    "author": "debo",
    "author_email": "[email protected]",
    "date": "Sun Mar 21 13:01:59 2021 -0700",
    "commit_by": "debo",
    "commit_by_email": "[email protected]",
    "commit_by_date": "Sun Mar 21 13:01:59 2021 -0700",
    "stats": {
      "files_changed": 5,
      "insertions": 248,
      "deletions": 7,
      "files": [
        ".gitignore",
        "Makefile",
        "README.md",
        "go.mod",
        "go.sum"
      ]
    }

To output of:

{
  "commit": "0e49db35a8f39fa8cdcdbe18fc02efbe6b38bf3a",
  "author": "debo",
  "author_email": "[email protected]",
  "date": "Sun Mar 21 13:01:59 2021 -0700",
  "commit_by": "debo",
  "commit_by_email": "[email protected]",
  "commit_by_date": "Sun Mar 21 13:01:59 2021 -0700",
  "stats": {
    "files_changed": 5,
    "insertions": 248,
    "deletions": 7,
    "files": [
      {"file": ".gitignore", "insertions": 169, "deletions": 0},
      {"file": "Makefile", "insertions": 26, "deletions": 3},
      {"file": "README.md", "insertions": 13, "deletions": 4},
      {"file": "go.mod", "insertions": 8, "deletions": 0},
      {"file": "go.sum", "insertions": 32, "deletions": 0}
    ]
  }
}

Without digging in more, I have some concern around complexity of the change as we'd need to use --format=fuller in combination with --numstat.

A few questions:

@kellyjonbrazil
Copy link
Owner

kellyjonbrazil commented Feb 16, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants