Skip to content

Include trailing slash in prefix migration instructions #3790

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

Merged
merged 1 commit into from
Apr 13, 2022
Merged

Include trailing slash in prefix migration instructions #3790

merged 1 commit into from
Apr 13, 2022

Conversation

michaelosthege
Copy link

After attempting to add directory on a network share to the safe.directory configuration with, for example:

git config --global --add safe.directory //servername/repos/myrepo

The warning about an outdated path style:

warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'

However, the warning is missing a trailing / behind the prefix.

This PR fixes the warning such that the resulting configuration works.

Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786

@michaelosthege
Copy link
Author

@dscho to me it looks like there was simply a typo. You're probably most qualified to judge if I did right change here.

Copy link

@derrickstolee derrickstolee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks right to me, thanks!

@derrickstolee derrickstolee merged commit 3f8d163 into git-for-windows:main Apr 13, 2022
@phil-blain
Copy link

Small pass-by comment, but when I read that error message I really thought that there was a bug in the code and %(prefix) was somehow not interpolated correctly... Maybe that error message could include a link to https://git-scm.com/docs/git-config#Documentation/git-config.txt-pathname to make things clearer ...

@michaelosthege michaelosthege deleted the patch-1 branch April 13, 2022 18:36
@dscho
Copy link
Member

dscho commented Apr 13, 2022

Hmm. Does this still work for paths like /mingw64/ssl/? Wouldn't it now suggest %(prefix)//mingw64/ssl/ (which is wrong)?

@michaelosthege
Copy link
Author

Hmm. Does this still work for paths like /mingw64/ssl/? Wouldn't it now suggest %(prefix)//mingw64/ssl/ (which is wrong)?

But can one even encounter such a path on Windows?

@PhilipOakley
Copy link

Do the instructions need to note the distinction between \\server paths, the %(prefix) magic install path string, and the separator that can take it up to a triple slash, given the easy confusion?

@anoblet
Copy link

anoblet commented Apr 15, 2022

This allowed me to continue using Git without any warnings:

git config --global --add safe.directory '%(prefix)///192.168.0.120/config/'

@vdye vdye mentioned this pull request Apr 18, 2022
@dscho
Copy link
Member

dscho commented Apr 19, 2022

Does this still work for paths like /mingw64/ssl/? Wouldn't it now suggest %(prefix)//mingw64/ssl/ (which is wrong)?

But can one even encounter such a path on Windows?

@michaelosthege That was the precise use case for %(prefix)/. So that the system config of a Portable Git can specify %(prefix)/mingw64/ssl/certs/ca-bundle.crt and it would auto-expand to the actual location, no matter to where the Portable Git was extracted.

The %(prefix)/ feature was never intended for WSL paths.

git-for-windows-ci pushed a commit that referenced this pull request Apr 20, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
git-for-windows-ci pushed a commit that referenced this pull request Apr 20, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
git-for-windows-ci pushed a commit that referenced this pull request Apr 20, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request Apr 26, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request Apr 26, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request Apr 26, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request Apr 26, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request Apr 28, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request Apr 28, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request Apr 28, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request Apr 29, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request Apr 29, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request Apr 29, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request Apr 29, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request Apr 29, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request May 2, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request May 3, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request May 3, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request May 3, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request May 5, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request May 5, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request May 5, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request May 9, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request May 9, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request May 9, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
dscho pushed a commit that referenced this pull request May 9, 2022
…instructions

After attempting to add directory on a network share to the `safe.directory` configuration with, for example:

```
git config --global --add safe.directory //servername/repos/myrepo
```

The warning about an outdated path style:

```
warning: encountered old-style '//servername/repos/myrepo' that should be '%(prefix)//servername/repos/myrepo'
```

However, the warning is missing a trailing `/` behind the prefix.

This PR fixes the warning such that the resulting configuration works.


Also see https://stackoverflow.com/a/71859164/4473230

Closes #3786
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot add network locations to safe.directory
6 participants