This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271668

Summary: git system-wide property core.autocrlf is ignored (windows)
Product: versioncontrol Reporter: nb_johan1
Component: GitAssignee: Ondrej Vrabec <ovrabec>
Status: NEW ---    
Severity: normal CC: git
Priority: P1    
Version: 8.2   
Hardware: PC   
OS: Windows 10 x64   
Issue Type: DEFECT Exception Reporter:

Description nb_johan1 2017-10-18 15:47:21 UTC
When core.autocrlf is located in system-wide configuration (and is unset on global and repo level) then netbeans will ignore it and commit updated files with CRLF. 

Such files are very difficult to manage in the repository, and unfortunately after committing, the problem cannot be solved just by one client commit. Each client should perform specific operations to their repo instance to fix it.


How to reproduce:

Make sure that on  windows machine the following does not print anything:
  git config --global core.autocrlf

But the following does:
  git config --system core.autocrlf

(the above is I believe the default setup on windows.)

-----

- Create a new repo in linux, commit file1.md and push your changes. 
- clone the repo from windows with latest git client (git pull).
- Now edit the file file1.md

- scenario1: committing from CLI (use git-bash so that git grep works):
    git add file1.md
    git commit -m "file1"
    git grep -I --files-with-matches --perl-regexp '\r' HEAD
    # the last command will show nothing,which means that the file does not contain any '\r' characters
    # You can also push this change / pull it from linux client and repeat the command from a git client that has been compiled with "--with-libpcre" option.
    # Again you will see nothing.

- scenario2: committing from netbeans:
    # Edit the file again and commit it, this time from netbeans. Then again:
    git grep -I --files-with-matches --perl-regexp '\r' HEAD
    # Now you see file1.md in the list, which means that it has been committed with CRLF.
    # You can push your changes and perform the same action on linux or other windows machines. You will see file1.md being printed.
Comment 1 nb_johan1 2017-10-18 16:39:58 UTC
Note: The SAME ALSO happens even if --system is unset, in which case the effective configuration comes from : %HOME%/.gitconfig

Meaning: 

    git config --global core.autocrlf
    git config --local core.autocrlf
    git config --system core.autocrlf

do not print anything, but 

   git config core.autocrlf

does.