Add support for Git LFS#110
Conversation
|
Hey @shiftkey. I'm one of the primary contributors for the LFS Windows installer. I'm not sure how much has been discussed with @technoweenie, but just a quick history: When LFS first came out the Win installer made attempts at finding the Git-for-windows install and placing the Integrating Git LFS with Git-for-windows will help close the gap for non-technical users, so this is really exciting! Might I suggest that instead of directly packaging Git LFS execs in your installer, you instead package the Git LFS installer itself (Or better yet download the latest version at install-time) and run it silently. That way you gain the benefit of the features already in the LFS installer as well as allowing users to independently update/remove LFS outside of git-for-windows. |
|
@strich thanks for the feedback! I did mention this in passing to @technoweenie, and while I want to avoid duplicating the work of the Git LFS team there are some packaging constraints that make things interesting on the Git for Windows side. I went with this approach as this makes packaging simpler for the Git for Windows team:
I've not thought about scenarios where you might have multiple versions of
Ah yes, I knew there was something that I'd missed. I'd need to ensure that Git LFS is initialized after installation - by invoking
I'm not sure how this fits with the existing Git for Windows philosophy. I'll let @dscho speak to this but I think users will want this to be as standalone as possible.
A couple of questions I have:
|
Unlikely. Its more that since its currently early in its life-cycle there may be quite a few patch releases people might be required to often update for. However if your team release quite often yourselves then maybe its not an issue.
As you guessed - Only the .gitconfig entries need to be removed, which you can do with
Yep just run
If you have You guys have a few options here as I see it:
I think I would prefer option 3 if only because it should come with the least amount of edge case issues the user might find themselves in. For example I'd worry that the user would install git-for-windows and then later Git LFS using our installer, either because they weren't aware it was in git-for-windows or because they wanted to update LFS. Such an edge case would not break LFS, but they might find it didn't update as expected. I do understand you guys have your own ecosystem and requirements however. Happy to continue answering questions, etc. |
Yeah, unfortunately this is a no-go. The idea of Git for Windows (since 2.x) is to have the installer reflect a partial MSYS2 installation, with a MSYS2 setup being the primary development environment. Therefore, everything that gets packages should be bundled in MSYS2 packages.
What does this do? Just editing the I am asking because I do not want to run
That is only correct for
I do not think this would fly well with portable Git (which is what @shiftkey is mostly concerned, as he packages a modified version of portable Git as the command-line tools of GitHub for Windows). Even having to run a command to install something we would want to avoid: it is too easy to put absolute paths into the gitconfig that are then invalid when moving the portable Git to a new computer. So I would prefer option 1. As to releasing new Git for Windows versions when new Git LFS versions become available: we already release new Git for Windows versions when either Git or the Git Credential Manager releases new versions. I could easily add Git LFS to that list. |
|
Ah okay. Fair enough then. So the only edge case I can see here is if a user installed LFS before installing Git-for-windows, and thereby making LFS appear first in
I believe so yes. @technoweenie would better be able to tell you exactly what changes you need to replicate manually in place of |
| pkgver=1.1.2 | ||
| pkgrel=1 | ||
| pkgdesc="An open source Git extension for versioning large files" | ||
| arch=('i686' 'x86_64') |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This could be done in a post-install step. See https://github.com/git-for-windows/MINGW-packages/blob/master/mingw-w64-qt5-git/qt5.install and https://github.com/git-for-windows/MINGW-packages/blob/master/mingw-w64-qt5-git/PKGBUILD#L11 for an example. |
I believe that the |
|
One minor issue:
@strich would it be possible for us to run this against the system config? Running this at package time means it won't be available to users when they install... |
|
That was recently discussed here: git-lfs/git-lfs#799 (comment). Basically - There is currently no option to write the smudge config to the system Git config via However as @technoweenie points out in the link above, the config above doesn't affect any repos that aren't managed with LFS so it shouldn't be an issue beyond the principle of it. |
|
I'm cool with changing it, but I imagine we'd have to worry about system privs. I'm going to add |
Is that accurate? Is the |
|
Yup. Go binaries are statically linked with the entire Go runtime. |
|
Added the Ready for review 🤘 |
03c4b0d to
964e48b
Compare
| if [ -f "${arch}/bin/git-lfs.exe" ]; then | ||
| git config --system filter.lfs.clean "git-lfs clean %f" | ||
| git config --system filter.lfs.smudge "git-lfs smudge %f" | ||
| git config --system filter.lfs.required true |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
🍎 |
Urgh. So we would increase the size of the installer by a whopping 35% just to include Git LFS? Hrm. Isn't it possible to |
|
Funny you should ask! Shrink your Go binaries with this one weird trick was posted yesterday. TLDR:
I don't want to do anything that increases startup time (such as Good news is that it does compress really well. Check out the zip file releases. The Windows Installer is only 4.78MB, while including both the 32bit and 64bit versions in an Inno Setup installer. |
|
Okay. I still think it is quite concerning, though, if the Git for Windows installer would increase by more than 10% just for LFS support (which not many people need, quite honestly). |
| post_install() { | ||
| for arch in mingw32 mingw64; do | ||
| if [ -f "${arch}/bin/git-lfs.exe" ]; then | ||
| git config --system filter.lfs.clean "git-lfs clean -- %f" |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
I'll leave the packaging size discussion for everyone else to debate vigorously. I'm curious why we're not seeing those same compression benefits here @dscho - the compressed packages (which are then installed into the Git SDK environment) are only slightly larger than the upstream Git LFS dual installer: |
|
Hey @shiftkey, I'd like to merge this Pull Request (even if I would prefer to build |
Signed-off-by: Brendan Forster <[email protected]>
c4d0730 to
2b85cda
Compare
|
@dscho squashed, rebased and signed off |
|
Perfect, thanks! |
See git-for-windows/build-extra#110 Former-commit-id: 6c8f1962f9bdd417bbdb4a5be8fac0dcf3f84303


There's likely some improvements to do here, but opening this early for feedback:
git lfs installandgit lfs uninstallsteps to update configcc @dscho as we discussed last week
cc @technoweenie just cause