-
Notifications
You must be signed in to change notification settings - Fork 2.7k
RFC: system-wide config file in %PROGRAMDATA% #157
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
Conversation
I am still convinced that there are settings which make sense only in the context of Git for Windows, but not, say, for libgit2-based software. Therefore, I am opposed to simply replacing the There is the additional problem that this completely violates the portable application principle. Granted, you did not introduce it, but the proposed change would really cement that violation, i.e. now all In any case, it should be |
Factor out near identical per-file logic. Its also unclear that 'ret += git_config_from_file()' actually decrements ret on error. It adds the return value of error() (or const_error() for GCC), which is five levels down the call hierarchy. Signed-off-by: Karsten Blees <[email protected]>
'git config' (--add / --unset etc.) automatically creates missing config files. However, it fails with a misleading error message "could not lock config file" if the parent directory doesn't exist. Also create missing parent directories. Signed-off-by: Karsten Blees <[email protected]>
If Git is configured to use the absolute '/etc/gitconfig' for system-wide settings, it may still be useful to have installation-specific settings such as 'help.format' (which depends on the installed set of help pages). This is particularly relevant on Windows, where a variety of Git flavors with different feature sets may be installed in parallel. If ETC_GITCONFIG is an absolute path (typically '/etc/gitconfig'), load installation-specific defaults (from '$(prefix)/$(ETC_GITCONFIG)') before loading the system-wide configuration. As installation-specific settings will typically be defined when creating the software package / installer (i.e. *before* git is installed), we don't need an extra 'git config --installation' option. Update the documentation accordingly. This removes '$(prefix)' from most places (which would be meaningless to normal users anyway). Signed-off-by: Karsten Blees <[email protected]>
Git versions on Windows typically store system-wide config files within their installation directory. Other Git implementations (e.g. libgit2, JGit etc.) may wish to reuse the system-wide config, but finding the installation directory of an already installed Git version is problematic. On Windows, the %PROGRAMDATA% environment variable specifies the root directory for system-wide application data (%ALLUSERSPROFILE% for WinXP). This would be the equivalent of '/etc' (and '/var'), except that naming guidelines recommend organizing data in per-application sub-directories. When looking up a system_path() on Windows, replace the absolute path prefix '/etc/' with '%PROGRAMDATA%/Git/'. For MinGW and MSVC builds, activate system-wide configurations by changing the $(sysconfdir) Makefile variable to an absolute path ('/etc'). Cygwin and MSys2 builds get this automatically when building with 'prefix=/usr'. Update the documentation for /etc/gitconfig and /etc/gitattributes. IOW: All Git versions on Windows (Cygwin, MinGW, MSVC and MSys2) will load configuration settings from '$(prefix)/etc/gitconfig' followed by '%PROGRAMDATA%/Git/gitconfig'. Signed-off-by: Karsten Blees <[email protected]>
2bcfa09
to
0de57fc
Compare
I've updated the PR and the description to match the current version. |
Hmm. I still do not like the repeated "git" in |
Just to be absolutely clear: I still have two very strong objections to this Pull Request, even if most of it looks very good:
|
For the record: this Pull Request is the reason I delayed the Git for Windows version I wanted to release yesterday. |
I think this is a misunderstanding: the absolute path Of course you cannot put Git for Windows or MSys2 specific settings into
Additionally, it would be a pity if the new |
More thoughts on
Bottom line is this: The Git for Windows project cannot guarantee that the shipped Note: cURL on Windows should actually find the
This is how it worked in the old Git for Windows. However, the lookup mechanism is broken in the Mingw64 version because of this patch: https://github.com/git-for-windows/MINGW-packages/blob/master/mingw-w64-curl/0001-curl-relocation.patch This is why we have to specify the path in gitconfig in the first place. |
For my argument that
Please don't. It is a serious misunderstanding of scope and purpose to consider
That is a red herring. MSys2 already translates it to a Windows path. But that does not change the role of
I agree that it would be a good thing to support attributes in However, please let's just agree that repeating But I fear that we get hung up on almost irrelevant details, while the bigger issue still looms: you still want to equate
Wrong. If a system administrator installs other certificates, she has to update the Git for Windows
So maybe we can fix that lookup mechanism? I have no idea how it is broken, do you have any more information to share? We're getting seriously side-tracked here, though. So back to the original question of this Pull Request: will you adjust the precedence of |
Oh, and: will you revert the wholesale redirection of |
As "threatened", I cherry-picked the really nice changes, and kept the precedence in a logically defensible order: 57190aee^...57190aee^2 |
…tus-cache-untracked-hint status: deserialize with -uno does not print correct hint
…tus-cache-untracked-hint status: deserialize with -uno does not print correct hint
…tus-cache-untracked-hint status: deserialize with -uno does not print correct hint
…tus-cache-untracked-hint status: deserialize with -uno does not print correct hint
…tus-cache-untracked-hint status: deserialize with -uno does not print correct hint
Includes these pull requests: #1 #6 #10 #11 git-for-windows#157 git-for-windows#212 git-for-windows#260 git-for-windows#270 Signed-off-by: Derrick Stolee <[email protected]>
Includes these pull requests: #1 #6 #10 #11 git-for-windows#157 git-for-windows#212 git-for-windows#260 git-for-windows#270 Signed-off-by: Derrick Stolee <[email protected]>
Includes these pull requests: #1 #6 #10 #11 git-for-windows#157 git-for-windows#212 git-for-windows#260 git-for-windows#270 Signed-off-by: Derrick Stolee <[email protected]>
Includes these pull requests: #1 #6 #10 #11 git-for-windows#157 git-for-windows#212 git-for-windows#260 git-for-windows#270 Signed-off-by: Derrick Stolee <[email protected]>
Includes these pull requests: git-for-windows#1 git-for-windows#6 git-for-windows#10 git-for-windows#11 git-for-windows#157 git-for-windows#212 git-for-windows#260 git-for-windows#270 Signed-off-by: Derrick Stolee <[email protected]>
Includes these pull requests: git-for-windows#1 git-for-windows#6 git-for-windows#10 git-for-windows#11 git-for-windows#157 git-for-windows#212 git-for-windows#260 git-for-windows#270 Signed-off-by: Derrick Stolee <[email protected]>
Includes these pull requests: git-for-windows#1 git-for-windows#6 git-for-windows#10 git-for-windows#11 git-for-windows#157 git-for-windows#212 git-for-windows#260 git-for-windows#270 Signed-off-by: Derrick Stolee <[email protected]>
Includes these pull requests: git-for-windows#1 git-for-windows#6 git-for-windows#10 git-for-windows#11 git-for-windows#157 git-for-windows#212 git-for-windows#260 git-for-windows#270 Signed-off-by: Derrick Stolee <[email protected]>
Includes these pull requests: git-for-windows#1 git-for-windows#6 git-for-windows#10 git-for-windows#11 git-for-windows#157 git-for-windows#212 git-for-windows#260 git-for-windows#270 Signed-off-by: Derrick Stolee <[email protected]>
Includes these pull requests: git-for-windows#1 git-for-windows#6 git-for-windows#10 git-for-windows#11 git-for-windows#157 git-for-windows#212 git-for-windows#260 git-for-windows#270 Signed-off-by: Derrick Stolee <[email protected]>
This fixes issue #154, as an alternative to @dscho's PR #104.
Notable differences:
git config --system
reads / writes%PROGRAMDATA%\Git\gitconfig
$(prefix)/etc/gitconfig
is read before%PROGRAMDATA%\Git\gitconfig
%PROGRAMDATA%\Git\gitattributes
(and any future config files that go to thesysconfdir
Makefile variable)