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

git.log locks when using stat or numstat #977

Closed
chriseaton opened this issue Mar 5, 2024 · 3 comments
Closed

git.log locks when using stat or numstat #977

chriseaton opened this issue Mar 5, 2024 · 3 comments
Labels
more-info-needed More information is required in order to investigate

Comments

@chriseaton
Copy link

Using git version 2.39.3.

On a repo if I run git log --numstat I recieve logs with stats OK, however with simplegit, if I call await git.log({'--numstat': null}) the code will lock.

From what I can tell, it's getting all the way to run the task, and tries to execute the task:

{"commands":["log","--pretty=format:òòòòòò %H ò %h ò %P ò %p ò %aI ò %s ò %D ò %b ò %an ò %ae òò","--all","--since=2024-02-04"],"format":"utf-8"}

which seems to hiccup and lock here likely due to parsing failure somewhere that goes uncaught by the promise for some reason (perhaps due to stdout still being open or something, dunno).

@steveukx
Copy link
Owner

steveukx commented Mar 9, 2024

Hi, from the official git documentation https://git-scm.com/docs/git-log#Documentation/git-log.txt--Lltfuncnamegtltfilegt the git diff formats aren't implemented for git log, which is why they've not been catered for here.

To use --numstat please switch to git.diffSummary - an example is in the unit tests https://github.com/steveukx/git-js/blob/main/simple-git/test/unit/diff.spec.ts#L243.

I will add some tests to simple-git soon to reject known invalid arguments rather than letting the process hang.

@steveukx steveukx added the more-info-needed More information is required in order to investigate label Mar 9, 2024
steveukx added a commit that referenced this issue Mar 9, 2024
Integration test covering error reported in #977
@steveukx
Copy link
Owner

steveukx commented Mar 9, 2024

Based on the extra commands in your snippet, I've created an integration test to cover the use of your custom format block along with the --all, --since and --numstat options in https://github.com/steveukx/git-js/blob/main/simple-git/test/integration/log-numstat.spec.ts

I'm unable to reproduce a hang situation. Please create a failing integration test for me to look into this further. Thanks

Copy link
Contributor

This issue has been automatically closed due to a lack of response. If your problem persists please open a new issue including any additional detail requested from this issue. For more detail on the issues/pull requests see ISSUES_AND_PULL_REQUESTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-info-needed More information is required in order to investigate
Projects
None yet
Development

No branches or pull requests

2 participants