|
|
|
|
Re: egit shows ">" on all files in newly cloned project [message #1760114 is a reply to message #1760085] |
Sat, 22 April 2017 23:46 |
David M. Karr Messages: 813 Registered: July 2009 |
Senior Member |
|
|
"Generator"? What is that? There is "General", is that what you meant? In that hierarchy, there is "Editors"->"Text Editors", which has a "show whitespace characters", which I just turned on. When I did that, it definitely showed additional information in the compare view, but it still didn't indicate there were any differences, even with the additional whitespace markers. Both the local file and the repo file had line endings showing two icons, one a sort of a box with extra dots on the corners of the box, followed by a paragraph icon.
This codebase in the repo was actually pushed by me on my Win7 laptop, from a codebase originally checked out from a SVN repository.
|
|
|
|
|
|
|
|
|
Re: egit shows ">" on all files in newly cloned project [message #1760480 is a reply to message #1760435] |
Thu, 27 April 2017 15:52 |
David M. Karr Messages: 813 Registered: July 2009 |
Senior Member |
|
|
With some minor elisions, here is the same output on my box:
% git clone -n ssh://git@fqhn:7999/st_usl/estimator.git test_crlf_auto
Cloning into 'test_crlf_auto'...
remote: Counting objects: 271, done.
remote: Compressing objects: 100% (230/230), done.
remote: Total 271 (delta 103), reused 117 (delta 16)
Receiving objects: 100% (271/271), 714.06 KiB | 308.00 KiB/s, done.
Resolving deltas: 100% (103/103), done.
Checking connectivity... done.
% git clone -n ssh://git@fqhn:7999/st_usl/estimator.git test_crlf_noAuto
Cloning into 'test_crlf_noAuto'...
remote: Counting objects: 271, done.
remote: Compressing objects: 100% (230/230), done.
remote: Total 271 (delta 103), reused 117 (delta 16)
Receiving objects: 100% (271/271), 714.06 KiB | 342.00 KiB/s, done.
Resolving deltas: 100% (103/103), done.
Checking connectivity... done.
% git -C test_crlf_auto config core.autocrlf true
% git -C test_crlf_noAuto config core.autocrlf false
% cd test_crlf_auto/
% ~/Downloads/org.eclipse.jgit.pgm-4.7.0.201704051617-r.sh checkout master
Already on 'master'
% ~/Downloads/org.eclipse.jgit.pgm-4.7.0.201704051617-r.sh diff | cat
diff --git a/.project b/.project
old mode 100755
new mode 100644
diff --git a/EstimatingApp.xlsx b/EstimatingApp.xlsx
old mode 100755
new mode 100644
Binary files differ
diff --git a/build.gradle b/build.gradle
old mode 100755
new mode 100644
...
% cd ../test_crlf_noAuto/
% ~/Downloads/org.eclipse.jgit.pgm-4.7.0.201704051617-r.sh checkout master
Already on 'master'
% ~/Downloads/org.eclipse.jgit.pgm-4.7.0.201704051617-r.sh diff | cat
diff --git a/.project b/.project
old mode 100755
new mode 100644
diff --git a/EstimatingApp.xlsx b/EstimatingApp.xlsx
old mode 100755
new mode 100644
Binary files differ
diff --git a/build.gradle b/build.gradle
old mode 100755
new mode 100644
...
%
The diffs with or without autocrlf show every file has had its mode changed. I've shortened the diff output, but it does appear that the same mode change was done on every file.
|
|
|
|
|
Re: egit shows ">" on all files in newly cloned project [message #1761338 is a reply to message #1761332] |
Tue, 09 May 2017 19:24 |
David M. Karr Messages: 813 Registered: July 2009 |
Senior Member |
|
|
David M. Karr wrote on Tue, 09 May 2017 11:28Before I run the script, I note that on the repo that I originally had this problem with, filemode is "false". The other repo instance that I cloned from this is "true", and the project I imported from that repo doesn't have the problem. It's been a while since I've looked at this, but I'll prepare to run that script again, but it appears the disconnect is due to that "filemode" flag, not the "autocrlf" one.
Correction, I had these reversed. The original repo had filemode = true.
I've verified with the script that in the repo with filemode = true, I get the "old mode 100755 new mode 100644" on every file, and I get no differences in the repo with filemode = false.
I get the impression that filemode should be true in general, so what might be happening here that is causing this disconnect? Is our git server configured in an unconventional way?
|
|
|
|
|
|
|
Re: egit shows ">" on all files in newly cloned project [message #1761913 is a reply to message #1761442] |
Thu, 11 May 2017 18:07 |
David M. Karr Messages: 813 Registered: July 2009 |
Senior Member |
|
|
Christian Halstrick wrote on Thu, 11 May 2017 01:56Ok, I guess we have an explanation and a fix/workaround now.
If you work on windows with native git in a cygwin environment then the git executables believe that they can support the executable bit. They probe the filesystem after cloning, think that the current filesystem supports executable bits and set filemode true.
But thats only the case when you use cygwin. When you work with the official git for windows from git-scm.com it is detected that filemodes are not supported on Windows with a windows filesystem. See this
C:\Temp>git --version
git version 2.11.0.windows.1
C:\Temp>git clone https://github.com/chalstrick/test_crlf.git
Cloning into 'test_crlf'...
remote: Counting objects: 14, done.
remote: Total 14 (delta 0), reused 0 (delta 0), pack-reused 14
Unpacking objects: 100% (14/14), done.
C:\Temp>type test_crlf\.git\config
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
[remote "origin"]
url = https://github.com/chalstrick/test_crlf.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
Not only the official git tooling for windows but also JGit is that opinion.
That explains the problem: You clone with msysgit and then you work with native-git/JGit.
Solution:
- also clone with JGit or with git for windows.
- or set core.filemode=false in your global config.
- or set core.filemode=false once in the repo after you cloned.
I understand the explanation and the info shown in that code sample. I'm a bit confused by your conclusion and the workarounds.
From what I can tell, my workaround at this point is always to clone with cygwin git, and not to change the filemode setting from true to false, or to clone without checkout with jgit or eclipse (can I even do that in eclipse?), then set filemode to true, and then checkout.
|
|
|
Re: egit shows ">" on all files in newly cloned project [message #1763122 is a reply to message #1761913] |
Fri, 12 May 2017 08:08 |
Christian Halstrick Messages: 274 Registered: July 2009 |
Senior Member |
|
|
In the end filemode has to be "false". That's all we want to achieve. On a windows based filesystem file modes are not supported and we have to tell that to git. git for windows and jgit achieve this goal by setting core.filemode to false in the repo-config directly after clone or init.
My fixes/workaround tell ways how to achieve that. Either clone with Eclipse/EGit/JGit or with git for windows or set the core.filemode explicitly in the config (either global or repo config) . From all the different ways I currently see only one way which is broken: clone/init with cygwin git and later work with any non-cygwin based tool like JGit or git for windows.
Ciao
Chris
|
|
|
Powered by
FUDForum. Page generated in 0.06469 seconds