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

fix(git): broken line endings corrupt git index after weaver merge #2302

Closed
petermetz opened this issue Feb 27, 2023 · 0 comments · Fixed by #2303
Closed

fix(git): broken line endings corrupt git index after weaver merge #2302

petermetz opened this issue Feb 27, 2023 · 0 comments · Fixed by #2303
Assignees
Labels
bug Something isn't working dependencies Pull requests that update a dependency file Developer_Experience P1 Priority 1: Highest Weaver Tasks related to the future of Cactus & Weaver together.

Comments

@petermetz
Copy link
Contributor

Describe the bug

There 34 files in the git index (with no actual changes) after a rebase onto upstream/main.
This only happens on Linux based operating systems (Ubuntu in this case).
The issue is invisible on the Windows operating system.

To Reproduce

Clone the project on Ubuntu 20.04
Observe that your git index is now corrupted as shown on the screenshot below.

Expected behavior

Cloning the project leaves you with an empty index instead of having it corrupted.

Logs/Stack traces

https://stackoverflow.com/a/4683783

Screenshots

Screenshot from 2023-02-27 11-37-49

Cloud provider or hardware configuration:

Dev machine

Operating system name, version, build:

Ubuntu 20.04

Hyperledger Cactus release version or commit (git rev-parse --short HEAD):

main

Hyperledger Cactus Plugins/Connectors Used

N/A

Additional context

More information on the issue and the proposal to fix it: https://stackoverflow.com/a/15646791

@petermetz petermetz added the bug Something isn't working label Feb 27, 2023
@petermetz petermetz self-assigned this Feb 27, 2023
@petermetz petermetz added dependencies Pull requests that update a dependency file Developer_Experience P1 Priority 1: Highest Weaver Tasks related to the future of Cactus & Weaver together. labels Feb 27, 2023
petermetz added a commit to petermetz/cacti that referenced this issue Feb 27, 2023
Not yet sure if this will fix the issue, but based on my research this
is the easiest and most probable solution.

Leaving a "paper trail" of the magical git commands that were executed
in order to have an idea in the future on how to fix potential negative
side-effects that might come out of this later (not likely but if it
does happen this should be immensely helpful information)

Without further ado, the list of commands executed to achieve this diff:

git rm --cached -r .

git config core.autocrlf input

git diff --cached --name-only -z | xargs -0 git add

Fixes hyperledger-cacti#2302

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz referenced this issue in petermetz/cacti Feb 27, 2023
Housekeeping of the documents that mention usernames.

Had to skip changing the username in the ./weaver/*.md because of the
newline index corruption problem explained in
https://github.com/hyperledger/cacti/issues/2302

Resolves hyperledger-cacti#2304

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz added a commit to petermetz/cacti that referenced this issue Feb 28, 2023
Not yet sure if this will fix the issue, but based on my research this
is the easiest and most probable solution.

Leaving a "paper trail" of the magical git commands that were executed
in order to have an idea in the future on how to fix potential negative
side-effects that might come out of this later (not likely but if it
does happen this should be immensely helpful information)

Without further ado, the list of commands executed to achieve this diff:

git rm --cached -r .

git config core.autocrlf input

git diff --cached --name-only -z | xargs -0 git add

Fixes hyperledger-cacti#2302

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz added a commit that referenced this issue Feb 28, 2023
Not yet sure if this will fix the issue, but based on my research this
is the easiest and most probable solution.

Leaving a "paper trail" of the magical git commands that were executed
in order to have an idea in the future on how to fix potential negative
side-effects that might come out of this later (not likely but if it
does happen this should be immensely helpful information)

Without further ado, the list of commands executed to achieve this diff:

git rm --cached -r .

git config core.autocrlf input

git diff --cached --name-only -z | xargs -0 git add

Fixes #2302

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz referenced this issue Feb 28, 2023
Housekeeping of the documents that mention usernames.

Had to skip changing the username in the ./weaver/*.md because of the
newline index corruption problem explained in
https://github.com/hyperledger/cacti/issues/2302

Resolves #2304

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file Developer_Experience P1 Priority 1: Highest Weaver Tasks related to the future of Cactus & Weaver together.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant