Skip to content

Staging fails due CRLF/LF conflict? #30

@cornelius-dol

Description

@cornelius-dol

We seem to have some number of repos where CRLF line endings have crept into the repo for some number of files due to developer mistakes (myself included). When such files are checked out on my Linux system, they correctly have LF line endings, but when I try to stage a modified source file it fails with:

Operation failed: Stage files.

Git error: CRLF would be replaced by LF in 'src/com/businesslink/core/lib/msp/BuiltInFunction.java'
If you want to file a bug report, please click “Show Details” and copy the entire message.

Traceback (most recent call last):
repotask.py:820, in _getNextToken
    token = next(flow)
            ^^^^^^^^^^
indextasks.py:76, in flow
    self.repo.stage_files(patches)
porcelain.py:1231, in stage_files
    index.add(path)
index.py:217, in add
    check_error(err, io=True)
errors.py:66, in check_error
    raise GitError(message)
_pygit2.GitError: CRLF would be replaced by LF in 'src/com/businesslink/core/lib/msp/BuiltInFunction.java'

Now I can't get my files to stage, and it is correct that the LF line endings should replace the CRLF endings.

Any thoughts on how to proceed? Ideally, I'd like a global setting that tells GitFourchette to ignore this altogether and stage the file. Am I overlooking a potential problem?


And now I seem to be in a worse state after globally find/replacing all CRLF with LF in all files, since just visiting a large repo now gives me:

Operation failed: Refresh repo.

AssertionError: 
If you want to file a bug report, please click “Show Details” and copy the entire message.

Operation failed: Refresh repo.

AssertionError: 
If you want to file a bug report, please click “Show Details” and copy the entire message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions