-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add --system config commands, elevate install config to system scope when root/packaged #1177
Conversation
I guess I was envisioning
@andyneff Do the debian and rpm changes look good? @shiftkey: Does Git for Windows run as an admin? May be a moot point if the maintainer wants to keep hard coding the config values. @strich: Would the Windows Installer need any changes to take advantage? We'd have to confirm that it can detect windows admin access. |
The Windows installer already requests admin elevation, so that'll be fine. I could optionally add an install flag to install using --local I suppose. |
RPM 👍 Don't know about deb, @ssgelm ? FWIW, I would prefer a |
I think the deb changes are fine. |
Also +1 to having a |
Considering this is an What if we did both? By default, it installs to the system config, or global config if you don't have access. Then add |
Is there an issue, or a wiki, tracking the roadmap-detail for installation-experience? There's been a number of suggestions around user-experiences around the installation workflow and timing of the installation and configuration of LFS, especially as it relates to when they cloned a repo with LFS-pointers etc. A reasonable number of user-issues relate to install/timing and install-config scope etc. e.g. #1167 . Some thoughts:
|
The installer does, but there is also a PortableGit version that doesn't require elevation - it just unpacks itself to a directory and does the bare essentials to give you a Git environment... With respect to the hard-coded configuration values - we can switch that out to use a |
@javabrett Great points!
With my suggestion here, they can just run
It is possible. But I wouldn't want it to setup the filters in the local git config. The problem here is that Also, without any LFS filters setup, it's too easy to add and push files that should be in LFS if it's not installed. |
One side-note - I looked at:
... noticing the |
Note to self more than anything - part of the issue with enforcement of LFS processes, or at least issuing warnings when something is missing, is that there is no option to have Git itself issue a warning or failure if a filter is missing or not-configured. Git treats this condition as a no-error noop. |
Added another commit to:
You can test the new switch with While testing this I ended up shaving yaks trying to work-out what on earth goes on with error-swallowing in I decided not to let it hold-up review of the additional commit. You will notice that if you run without sudo, so I'll ask about the error-swallowing separately and link to here. |
Fixed the
|
Looks like I've unintentionally used something new in Go 1.6 API - |
edef647
to
1efba47
Compare
Fixed so it compiles with Go 1.5 by pulling-down a couple of utility methods from Go 1.6 (in a single commit so it can be easily reverted to a Go 1.6 version). Removed the nasty bool for optional swallow-error in |
Global currently remains the default scope (and there's no explicit switch for it yet) for Will it matter that having run a Matters because I expect an in-repo |
Link PR #1177 to ROADMAP,md
…UnsetSection commands. These commands operate on config stored at system scope e.g. /etc/gitconfig.
…bal if running as the root user (unless --local is specified), using the new System-level config commands.
…s to Debian deb. These will run as root and so will operate at the new --system scope.
…pts. These will run as root and so will operate at the new --system scope.
… post-install scripts in rpm/deb packages.
ExitError conditions now return a plain error with message like: Error running git [config --system filter.lfs.clean git-lfs clean -- %f]: 'error: could not lock config file /etc/gitconfig: Permission denied' 'exit status 255' Also: * Made Set/Unset Config commands return errors when they occur. * Made install attribute set fail properly with an error message e.g. if permission-denied. Previously this failed silently and reported success. ***NOTE*** this commit contains Go 1.6-specific APIs. The following commit will remove those, and that following commit can be reverted when Go >= 1.6 is required.
…. This commit can be reverted as soon as Go >= 1.6 is required. This commit copies-down some utility methods introduced as part of the API change in Go 1.6. These changes are convenient to use here, since they auto-truncate stderr error output. Revert this commit when moving to Go 1.6.
…xec stops swallowing the error return. Related test "ls-files: with zero files".
Doh, I don't know why this was left out of v1.3. Sorry for dropping this on the floor.
Hooks are installed in the following commands: clean, fsck, push, smudge, track, and untrack. It can be added to more commands with There's also a |
I fixed a merge conflict so we can ship this in v1.4: #1460. I couldn't think of a suitable shortcut for |
@javabrett Thanks again for tackling this 🤘 |
These changes modify the packaged install experience, pulling-up config changes currently made in the current user "global" config (
~/.gitconfig
), to instead be made at the "system" config (/etc/gitconfig
). That way, Git LFS is installed once per-system, and does not require additional configuration should a different user start using Git LFS and therefore require the smudge/clean filters.Note that these changes presume that it is safe to have the Git LFS filters installed and that they do and will continue to run as fast noops in non-Git LFS repos.
The elevation from global-to-system occurs automatically provided:
--local
is not specified.Additionally, post-install and pre-remove scripts are added to deb and rpm packages. Since these run as root, they automatically elevate and install to
/etc/gitconfig
.I don't know how this plays-out on Windows.