Skip to content

Up For Grabs: make installing the Git for Windows SDK as easy as cloning a repository #1357

@dscho

Description

@dscho

Currently, the Git for Windows SDK needs to be installed by running a self-extracting 7-Zip archive that eventually runs a .bat script to initialize our custom fork of MSYS2.

This is a bit tedious, as many things can go wrong on the way:

  • there may be a proxy and pacman has to know about it
  • pacman may want to update itself, which is a bit of a chicken-and-egg problem
  • MSYS2's pacman repository (which really is a static website at https://repo.msys2.org) needs to be up and running
  • Git for Windows' pacman repository (hosted by BinTray) needs to be up and running
  • oh so many other things need to run smoothly

And even then, it is hard to assess how far along we are in the process.

The proposed solution

There is a silver lining on the horizon, though, as it should be a lot easier to install the SDK than this involved and fragile process

git-sdk-64.git and git-sdk-32.git

For the Continuous Testing of https://github.com/git/git, we already needed a more robust way to initialize and update Git for Windows SDKs. Imitating the way Git for Windows 1.x worked (whose SDK was called "msysgit", mistaken by many to be the end-user facing software), we have two repositories tracking the 64-bit and the 32-bit SDKs, respectively: https://github.com/git-for-windows/git-sdk-64 and https://github.com/git-for-windows/git-sdk-32

A trusty VSTS job keeps them up-to-date, at least once every 24h cycle, sometimes triggered manually (e.g. after updating a dependency).

The missing parts

These repositories already have most of what is needed to initialize a full Git for Windows SDK, but not quite:

Outline: the new SDK "installer"

So while it is totally possible to clone https://github.com/git-for-windows/git-sdk-64 and then double-click git-bash.exe, this will only open a Git Bash but leave a couple of things missing. The way we could make sure that those things are not missing is by detecting their absence and installing them in a script at startup.

Such a script already exists: /etc/profile.d/git-sdk.sh

This file is present only in Git for Windows SDKs (installed via the git-extra package), and it is excluded from the Git for Windows installer, portable Git, MinGit, etc

So the idea is simple: extend that script to install the missing parts, namely

  • /usr/src/build-extra
  • /usr/src/git (and build and install Git, unless it was already cloned)
  • the Desktop shortcut

As with the current SDK installer, these steps should be guarded behind an test -z "$JENKINS_URL" || { ... }, to still allow installing the SDK into a Continuous Integration system where we may not want build-extra, git, and certainly not the shortcut.

It is also conceivable to introduce a new environment variable, say, GIT_SDK_OPTIONS with space-separated options to turn those features off on demand.

Document how to "install" the SDK in a README.md file

So far, the git-sdk-64 and git-sdk-32 repositories do not have a README.md file, which probably leaves occasional visitors wondering what those repositories are all about.

These files would make for an excellent location to describe what those repositories represent, how they are to be used, how they can be extended, how they are maintained, etc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions