Skip to content
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

Directory symlinks with trailing slash always show as modified #210

Closed
chrisrichard opened this issue Jun 19, 2015 · 2 comments
Closed

Directory symlinks with trailing slash always show as modified #210

chrisrichard opened this issue Jun 19, 2015 · 2 comments
Assignees

Comments

@chrisrichard
Copy link

Possible to create directory symlinks with or without the trailing slash and they often get created with trailing slashes because tab completion includes it. On Windows, git always reports the link without the trailing slash resulting in these links always showing as modified.

I've created a simple repository demonstrating the problem: https://github.com/chrisrichard/git-windows-symlinks-test

Just clone to reproduce. Note that you have to enable symlinks with core.symlinks = true and run git shell as administrator to ensure links are created on Windows.

git clone [email protected]:chrisrichard/git-windows-symlinks-test.git
...

$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
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:   dir2
...

$ git diff
diff --git a/dir2 b/dir2
index 9cd0393..9011721 120000
--- a/dir2
+++ b/dir2
@@ -1 +1 @@
-dir/dir2/
+dir/dir2

@dscho
Copy link
Member

dscho commented Jun 20, 2015

I can reproduce the error with

git clone -c core.symlinks=true https://github.com/chrisrichard/git-windows-symlinks-test

@dscho
Copy link
Member

dscho commented Jun 20, 2015

@chrisrichard could you please verify that it works for you, too, with Git for Windows 2.4.4.2 (which I published today)?

dscho added a commit that referenced this issue Jun 25, 2015
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Jul 18, 2015
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Jul 28, 2015
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Aug 30, 2015
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Sep 10, 2015
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Sep 18, 2015
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Sep 29, 2015
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Oct 5, 2015
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Oct 18, 2015
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Nov 7, 2015
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Dec 11, 2015
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Jan 5, 2016
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Jan 12, 2016
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Jan 14, 2016
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Jan 15, 2016
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Mar 23, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Apr 3, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue May 29, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue May 29, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
orgads pushed a commit to orgads/git that referenced this issue Jun 22, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
orgads pushed a commit to orgads/git that referenced this issue Jun 22, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
orgads pushed a commit to orgads/git that referenced this issue Jun 22, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Aug 22, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Aug 22, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Aug 23, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Aug 23, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Aug 23, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
jamill pushed a commit to jamill/git that referenced this issue Aug 28, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
jamill pushed a commit to jamill/git that referenced this issue Sep 5, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Sep 10, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
jamill pushed a commit to jamill/git that referenced this issue Sep 11, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
git-for-windows-ci pushed a commit that referenced this issue Sep 24, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Oct 10, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit to dscho/git that referenced this issue Oct 12, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes git-for-windows#210

Signed-off-by: Johannes Schindelin <[email protected]>
dscho added a commit that referenced this issue Oct 12, 2018
This is needed so that `_wchdir()` can be used with drive root
directories, e.g. C:\ (`_wchdir("C:")` fails to switch the directory
to the root directory).

This fixes msysgit#359 (in Git for Windows
2.x only, though).

Likewise, `readlink()`'s semantics require a trailing slash for symbolic
links pointing to directories. Otherwise all checked out symbolic links
pointing to directories would be marked as modified even directly after a
fresh clone.

This fixes #210

Signed-off-by: Johannes Schindelin <[email protected]>
jeffhostetler pushed a commit to jeffhostetler/git that referenced this issue Oct 25, 2019
…the `perforce` cask

This fix is a rebase of gitgitgadget#400.

The CI builds are failing for Mac OS X due to a change in the
location of the perforce cask. The command outputs the following
error:

    + brew install caskroom/cask/perforce
    Error: caskroom/cask was moved. Tap homebrew/cask-cask instead.

So let's try to call `brew cask install perforce` first (which is what
that error message suggests, in a most round-about way).

The "caskroom" way was added in 672f51c (travis-ci:
fix Perforce install on macOS, 2017-01-22) and the justification
is that the call "brew cask install perforce" can fail due to a checksum
mismatch: the recipe simply downloads the official Perforce distro, and
whenever that is updated, the recipe needs to be updated, too.

CI servers are typically fresh virtual machines, but not always. To
accommodate for that, let's try harder if `brew cask install perforce`
fails, by specifically pulling the latest `master` of the
`homebrew-cask` repository.

This will still fail, of course, when `homebrew-cask` falls behind
Perforce's release schedule. But once it is updated, we can now simply
re-run the failed jobs and they will pick up that update.

As for updating `homebrew-cask`: the beginnings of automating this in
https://dev.azure.com/gitgitgadget/git/_build?definitionId=11&_a=summary
will be finished once the next Perforce upgrade comes around.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants