Bug 482218 - Case-sensitivity: cgit recognizes .Gitignore as a valid ignore file name on case-insensitive file systems; JGit doesn't
Summary: Case-sensitivity: cgit recognizes .Gitignore as a valid ignore file name on c...
Status: NEW
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 4.2   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-15 10:32 EST by Thomas Wolf CLA
Modified: 2015-11-15 10:35 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wolf CLA 2015-11-15 10:32:35 EST
On a case-insensitive file system, cgit recognizes not only .gitignore but also for instance .Gitignore as an ignore file.

JGit only recognizes .gitignore in this exact casing. For instance on a case-sensitive HFS+ partition:

  $ ls -al
  total 24
  drwxr-xr-x   6 thomas  staff   204 Nov 15 14:41 .
  drwxr-xr-x  32 thomas  staff  1088 Oct 25 19:00 ..
  -rw-r--r--@  1 thomas  staff  6148 Nov 15 13:23 .DS_Store
  drwxr-xr-x  12 thomas  staff   408 Nov 15 00:22 .git
  -rw-r--r--@  1 thomas  staff    21 Nov 15 14:43 .gitignore
  drwxr-xr-x  13 thomas  staff   442 Nov 15 13:25 testproject
  $ git status
  # On branch master
  # Your branch is ahead of 'origin/master' by 1 commit.
  #
  # Changes not staged for commit:
  #   (use "git add <file>..." to update what will be committed)
  #   (use "git checkout -- <file>..." to discard changes in working directory)
  #
  #	modified:   testproject/File with blanks.txt
  #
  # Untracked files:
  #   (use "git add <file>..." to include in what will be committed)
  #
  #	.gitignore
  no changes added to commit (use "git add" and/or "git commit -a")
  $ mv .gitignore .Gitignore
  $ ls -al
  total 24
  drwxr-xr-x   6 thomas  staff   204 Nov 15 15:28 .
  drwxr-xr-x  32 thomas  staff  1088 Oct 25 19:00 ..
  -rw-r--r--@  1 thomas  staff  6148 Nov 15 13:23 .DS_Store
  -rw-r--r--@  1 thomas  staff    21 Nov 15 14:43 .Gitignore
  drwxr-xr-x  12 thomas  staff   408 Nov 15 15:27 .git
  drwxr-xr-x  13 thomas  staff   442 Nov 15 13:25 testproject
  $ git status
  # On branch master
  # Your branch is ahead of 'origin/master' by 1 commit.
  #
  # Changes not staged for commit:
  #   (use "git add <file>..." to update what will be committed)
  #   (use "git checkout -- <file>..." to discard changes in working directory)
  #
  #	modified:   testproject/File with blanks.txt
  #
  # Untracked files:
  #   (use "git add <file>..." to include in what will be committed)
  #
  #	.Gitignore
  no changes added to commit (use "git add" and/or "git commit -a")
  $ more .Gitignore 
  .DS_Store
  ignored.txt
  $ ls -al testproject/i*
  -rw-r--r--  1 thomas  staff  28 Nov 15 13:25 testproject/ignored.txt
  $ git --version
  git version 1.7.7.5 (Apple Git-26)
  $

(Yes, I know this git version is old...)

testproject/ignored.txt is a newly added file, and is ignored.

EGit/JGit shows me three unstaged changes, .Gitignore, testproject/File with blanks.txt, and testproject/ignored.txt .

This may also affect .gitattributes, and possibly the .git directory itself. On the latter, cgit alsohandles some Window-specific quirks;see https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.5.6.txt
Comment 1 Thomas Wolf CLA 2015-11-15 10:35:35 EST
(In reply to Thomas Wolf from comment #0)
> For instance on a case-sensitive HFS+ partition:

s/case-sensitive/case-INsensitive/