You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ git init
$ echo hello > HelloWorld
$ git add .
$ git commit -m "initial commit"
[master (root-commit) 83e0652] initial commit
1 file changed, 1 insertion(+)
create mode 100644 HelloWorld
$
$ git checkout -b foo
Switched to a new branch 'foo'
$ chmod 755 HelloWorld
$ git status
On branch foo
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: HelloWorld
no changes added to commit (use "git add" and/or "git commit -a")
$ git add .
$ git commit -m "change filemode"
[foo f3c937d] change filemode
1 file changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 HelloWorld
$
$ git diff master
diff --git a/HelloWorld b/HelloWorld
old mode 100644
new mode 100755
$ git config core.filemode false
$ git diff master
diff --git a/HelloWorld b/HelloWorld
old mode 100644
new mode 100755
$
$ chmod 644 HelloWorld
$ git status
On branch foo
nothing to commit, working tree clean
So we can't ignore filemode change after a mode change is already committed. core.filemode could only works for detecting new changes, but not for showing existed diff. The only way I could find now is checking this by the size of "edit lines". If the size is zero, then this is only a filemode change.
IMO, we'd better work on this after we introducing line changes in the future.
Taken from #22 (comment)
If the only change is a chmod(no changes to the contents of the file), we should ignore the change altogether.
After this if fixed, the UT of only chmod change in #22 should update.
We will need a new test for this: chmod plus file change.
The text was updated successfully, but these errors were encountered: