Ship Git-LFS with Git for Windows?

584 views
Skip to first unread message

Lars Schneider

unread,
Jan 8, 2016, 7:18:26 AM1/8/16
to git-for-windows, techo...@github.com
Hi,

Microsoft, GitHub and Atlassian are all promoting Git-LFS [1] as a possible solution for large files in Git [2][3].
Would you support to add the "git-lfs.exe" [3] to the "mingw??/bin" directory as part of Git for Windows?

Thanks,
Lars


Johannes Schindelin

unread,
Jan 8, 2016, 10:22:13 AM1/8/16
to Lars Schneider, git-for-windows, techo...@github.com
Hi Lars,

On Fri, 8 Jan 2016, Lars Schneider wrote:

> Microsoft, GitHub and Atlassian are all promoting Git-LFS [1] as a
> possible solution for large files in Git [2][3].
>
> Would you support to add the "git-lfs.exe" [3] to the "mingw??/bin"
> directory as part of Git for Windows?

Git-LFS is written in Go, so it would be a bit of a challenge to build the
MSys2 package, no?

Having said that, I plan to support downloading and installing the Git
Credential Manager [*1*] installer, as an "add-on", so to say. The same
might be possible with Git-LFS.

Ciao,
Dscho

Footnote *1*: https://github.com/git-for-windows/git/issues/466

Lars Schneider

unread,
Jan 8, 2016, 11:32:12 AM1/8/16
to git-for-windows, larsxsc...@gmail.com, techo...@github.com


On Friday, January 8, 2016 at 4:22:13 PM UTC+1, Johannes Schindelin wrote:
Hi Lars,

On Fri, 8 Jan 2016, Lars Schneider wrote:

> Microsoft, GitHub and Atlassian are all promoting Git-LFS [1] as a
> possible solution for large files in Git [2][3].
>
> Would you support to add the "git-lfs.exe" [3] to the "mingw??/bin"
> directory as part of Git for Windows?

Git-LFS is written in Go, so it would be a bit of a challenge to build the
MSys2 package, no?
Git-LFS is in Go, correct. However, it runs out of the box in MSys2. I actually repackage your Git Distribution with Git-LFS for the engineers at my day job already.
 
Having said that, I plan to support downloading and installing the Git
Credential Manager [*1*] installer, as an "add-on", so to say. The same
might be possible with Git-LFS.
Interesting. How would I create/install such an "add-on"? Is this a solved problem already? 

Thanks,
Lars

Johannes Schindelin

unread,
Jan 11, 2016, 6:16:17 AM1/11/16
to Lars Schneider, git-for-windows
Hi Lars,

On Fri, 8 Jan 2016, Lars Schneider wrote:

> On Friday, January 8, 2016 at 4:22:13 PM UTC+1, Johannes Schindelin wrote:
> >
> > On Fri, 8 Jan 2016, Lars Schneider wrote:
> >
> > > Microsoft, GitHub and Atlassian are all promoting Git-LFS [1] as a
> > > possible solution for large files in Git [2][3].
> > >
> > > Would you support to add the "git-lfs.exe" [3] to the "mingw??/bin"
> > > directory as part of Git for Windows?
> >
> > Git-LFS is written in Go, so it would be a bit of a challenge to build
> > the MSys2 package, no?
> >
> Git-LFS is in Go, correct. However, it runs out of the box in MSys2. I
> actually repackage your Git Distribution with Git-LFS for the engineers
> at my day job already.

Sure, but that does not solve the problem of easy rebuilding at all.

You see, over the past 8.5 years I spent an insane amount of energy to
make sure that anybody can rebuild as many parts of Git for Windows as
easily as possible. It has been an up hill battle against many a
contributor preferring the sloppy route, to be sure. Every time, though, I
have debug something tricky, I just congratulate myself for not giving in.

With Git LFS it is the exact same thing.

To become a part proper of Git for Windows, it would have to ship as an
MSys2/MinGW package, and that requires a proper build recipe (having said
that, there is a cheap work-around that GitHub uses to ship git-tfs as
part of the version of Git for Windows shipped via GitHub for Windows in
that it just rebundles the binary zip distributed by the Git TFS project
itself [*1*]).

So far I am convinced that Git for Windows should not follow that example.

For that reason I intend to provide the credential manager option purely
as an add-on.

> > Having said that, I plan to support downloading and installing the Git
> > Credential Manager [*1*] installer, as an "add-on", so to say. The
> > same might be possible with Git-LFS.
> >
> Interesting. How would I create/install such an "add-on"? Is this a
> solved problem already?

No, this is not solved. There is an add-on to InnoSetup that allows
downloading additional files, but I do not trust it and instead would want
to use the curl.exe we ship with Git for Windows anyway. Most likely as a
shell script to be run as an optional task at the end of the installation.

Ciao,
Dscho

Footnote *1*:
https://github.com/github/ghfw-build-extra/blob/master/git-tfs/PKGBUILD

Lars Schneider

unread,
Jan 11, 2016, 9:21:55 AM1/11/16
to Johannes Schindelin, git-for-windows
OK. Thanks for the explanation!


>>> Having said that, I plan to support downloading and installing the Git
>>> Credential Manager [*1*] installer, as an "add-on", so to say. The
>>> same might be possible with Git-LFS.
>>>
>> Interesting. How would I create/install such an "add-on"? Is this a
>> solved problem already?
>
> No, this is not solved. There is an add-on to InnoSetup that allows
> downloading additional files, but I do not trust it and instead would want
> to use the curl.exe we ship with Git for Windows anyway. Most likely as a
> shell script to be run as an optional task at the end of the installation.
That sounds interesting as I tried something similar already. The only obstacle I ran into was that I might need "administrator" permissions to add something to "C:\Program Files". Are you aware of a way to elevate the access rights similar to "runas.exe /user:administrator ..." in git-bash? Or where would you install these add-ons? Maybe in the user profile? Might be a stupid question - I am no Windows expert...

Thanks,
Lars

Johannes Schindelin

unread,
Jan 11, 2016, 12:05:54 PM1/11/16
to Lars Schneider, git-for-windows
Hi Lars,
If this is run as part of the installer, it poses no problem because we
already run either elevated, or we do not write to Program Files but to
AppData instead.

Ciao,
Johannes

Lars Schneider

unread,
Jan 11, 2016, 12:32:15 PM1/11/16
to Johannes Schindelin, git-for-windows
Hi Johannes,

>>>>>
>>>>> Having said that, I plan to support downloading and installing the
>>>>> Git Credential Manager [*1*] installer, as an "add-on", so to say.
>>>>> The same might be possible with Git-LFS.
>>>>>
>>>> Interesting. How would I create/install such an "add-on"? Is this a
>>>> solved problem already?
>>>
>>> No, this is not solved. There is an add-on to InnoSetup that allows
>>> downloading additional files, but I do not trust it and instead would
>>> want to use the curl.exe we ship with Git for Windows anyway. Most
>>> likely as a shell script to be run as an optional task at the end of
>>> the installation.
>>
>> That sounds interesting as I tried something similar already. The only
>> obstacle I ran into was that I might need "administrator" permissions to
>> add something to "C:\Program Files". Are you aware of a way to elevate
>> the access rights similar to "runas.exe /user:administrator ..." in
>> git-bash? Or where would you install these add-ons? Maybe in the user
>> profile? Might be a stupid question - I am no Windows expert...
>
> If this is run as part of the installer, it poses no problem because we
> already run either elevated, or we do not write to Program Files but to
> AppData instead.

You are right! In what directory would you expect the installed binaries? "$GIT/bin" ?
Where would you invoke the installation of the add-ons?

A) In Inno setup?
https://github.com/git-for-windows/build-extra/blob/a253bbe0850aefbf7589fc373db38bdb83660108/installer/install.iss#L1554

B) In post-install.bat?
https://github.com/git-for-windows/build-extra/blob/a253bbe0850aefbf7589fc373db38bdb83660108/post-install.bat#L42

C) In etc/post-install?
https://github.com/git-for-windows/build-extra/tree/master/portable/root/etc/post-install

D) Somewhere else?

Thanks,
Lars

Johannes Schindelin

unread,
Jan 11, 2016, 1:27:02 PM1/11/16
to Lars Schneider, git-for-windows
Hi Lars,

On Mon, 11 Jan 2016, Lars Schneider wrote:

> > If this is run as part of the installer, it poses no problem because
> > we already run either elevated, or we do not write to Program Files
> > but to AppData instead.
>
> You are right! In what directory would you expect the installed
> binaries? "$GIT/bin" ?

No, the top-level bin/ directory exists only for backwards-compatibility.
If the executable depends on msys-2.0.dll, it should go into usr/bin/,
otherwise into mingw64/bin/ (or for 32-bit executables, mingw32/bin/).

> Where would you invoke the installation of the add-ons?
>
> [...]
>
> D) Somewhere else?

InnoSetup has the concept of tasks that can be triggered using checkboxes:

http://www.jrsoftware.org/ishelp/topic_taskssection.htm

I would use this feature (and probably turn "View README" into a feature,
too, to avoid two wizard pages with tasks at the end) to optionally call a
shell script with the correct path that downloads the appropriate binary.
In other words, InnoSetup will provide the parameters, and the script will
do the downloading/storing/installing.

Ciao,
Dscho
Reply all
Reply to author
Forward
0 new messages