-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git diff strange warning for gitattributes when diff file in subfolder #255
Comments
It can be reproduced with a repository with 3 commits:
then: in this case, I've only two warnings:
|
@toninlg can you please provide a complete verifiable example? I.e. something like a repository that only needs to be cloned and a script inside that needs to be run to demonstrate the bug? |
@dscho You can clone https://github.com/toninlg/gitattributes_warning.git and run the script diff.sh at the root of the repository |
I can confirm with the MCVE that this is a Windows-only bug. |
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes git-for-windows#255. Signed-off-by: Johannes Schindelin <[email protected]>
Sorry for the time to reply. Thank you. |
Perfect! Thanks for testing! |
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes git-for-windows#255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes git-for-windows#255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes git-for-windows#255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes git-for-windows#255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes git-for-windows#255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes git-for-windows#255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
This problem has been reported originally in August 2015, as git-for-windows#255 The symptom: when passing <commit>:<directory>/<file> style arguments to `git diff`, Git tries to read the attributes from a file called <commit>:<directory>/.gitattributes. This symptom is more prominent on Windows because the colon in the file name is illegal, and therefore reported to the user. On Linux, the colon is legal, and it just so happens that that file typically does not exist, and therefore there are no adverse consequences. However, it is still a bug: Git should not even attempt to open that file. Let's add a test case to demonstrate that problem, even on Linux and MacOSX. The underlying problem will be really tricky to fix: the run_diff*() family of functions expects the path passed via the diff_filespec structs to be the path as if it were in the worktree. However, when processing the `git diff <blob1> <blob2>` invocation, Git uses setup_revisions()'s parsing of the pending objects to fill in this information, and setup_revisions() simply copies the command-line argument, rather than reconstructing the actual *file* path. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes the symptom reported in git-for-windows#255 Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes git-for-windows#255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes git-for-windows#255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
On Windows, a file name containing a colon is illegal. We should therefore expect the corresponding errno when `fopen()` is called for a path of the form <commit>:.gitattributes. This fixes #255. Signed-off-by: Johannes Schindelin <[email protected]>
…ire-time option This will need a change in microsoft/scalar and microsoft/vfsforgit to handle the correct input. It has _never worked_.
Hi,
I've a repository with four subfolders in it and .gitattributes at the root.
When using the following command:
The diff is shown but the following warnings are shown at the end:
version is Git for Windows 2.3.5 release 8.
I've cloned the repository to linux with git version 2.4.6, no warnings are displayed.
I've installed the last version Git-2.4.6-5th on another computer without doing any specific git config, cloned the repository and same warnings are displayed.
I've no warning on Windows when doing:
Thank you.
The text was updated successfully, but these errors were encountered: