-
Notifications
You must be signed in to change notification settings - Fork 7
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
Wrong inferred Git workspace status in Go #130
Comments
The wrong behavior is also outlined in #129 |
Even when the |
This seems to be a known issue in go-git. Another similar (wrong) behavior has been documented here. It looks like it fails to check for file changes due to CRLF line endings (maybe it's Windows specific). When the repository contains files with CRLF, To confirm this behavior one can remove CRLF endings and the right value is returned. |
I encountered the same issue on Linux, so it's not Windows-specific. Also I scanned my repo with
|
In my repo all text files have LF ending. There is no CRLF ending in any file. I also get a clean git status from the container shell:
|
Thanks both. I'm trying to find a convenient workaround as it looks those bugs on go-git have been there forever with no fix. |
As a kinda alternative to go-git I propose create cli with jgit (so on java) and package it as docker image, what do you think about it? |
Well, if I end up executing an external library I'd rather run git. It'd be cleaner after all, and git is basically available on all hosts whwre Nyx is used (statistically speaking). |
I just published an hotfix as 1.3.1-hotfix130.2. Since there was no suitable library alternative I had to back up to use the local Reproducing the bug was quite hairy so I'd like to double check with you the workaround works. @bergtwvd and @Prototik can you please give it a try before I merge to the main branch and make it generally available? In case it doesn't work as expected please send the debug log output. You will find some rows with the Thanks |
Workaround summaryI'm leaving notes for my future self about the triage and the actions taken. Findings
The workaroundSince no other native Go alternative library was available, the only option left was to run the The Two additional tests ( All changes required for the workaround have been marked with references (see below) to explain the reason behind the change and make it easy to remove the workaround as soon as possible. For the workaround to work the Debug logs regarding the workaround have the Relevant bugs to monitorThe following bugs are open in go-git and should be monitored so that, when they're fixed, we can remove the workaround:
What to do to remove the workaroundWhen the above bugs are resolved, or when go-git can be replaced with a more reliable library, the things to di are:
|
* chode: add debug logs * chore: clean some illegal characters * chore: clean unnecessary import statements * test: bug #130 reproduced (Go tests are supposed to fail) #129 #130 * fix: wrong inferred Git workspace status in Go #130 #129 * test: bug #130 reproduced (Go tests are supposed to fail) #129 #130 * fix: wrong inferred Git workspace status in Go #130 #129 * test: bug #130 reproduced (Go tests are supposed to fail) #129 #130 * test: bug #130 reproduced (Go tests are supposed to fail) #129 #130 * test: bug #130 reproduced (Go tests are supposed to fail) #129 #130 * test: bug #130 reproduced (Go tests are supposed to fail) #129 #130 * fix: wrong inferred Git workspace status in Go #130 #129 * build: enable matrix build for Go integration tests (some Go integration tests may fail) * build: enable matrix build for Go unit tests (some Go integration tests may fail) * test: testing again after introducing the test matrix for Go unit and integration tests
Fix is generally available in release 1.3.3. |
I was away for work, but just a belated response to confirm that this solution works for me. Thanks for the effort.
|
The command line version sometimes fails when inferring the workspace status.
There are times when
git status
returns a clean workspace but Nyx gets it dirty from the underlying implementation, and this makes the release type match fail.The text was updated successfully, but these errors were encountered: