Web lists-archives.com

Re: GitForWindows vs. Cygwin




>> Can anyone enlighten me about the relationship of "Git for Windows" to
>> Cygwin?
>
> They are not related.

Yes, they are.

>> But now I hear of this GitForWindows thing.  Which seems to have replaced
>> MSysGit, with a GUI thrown in.  But is it _still_ a stale fork of Cygwin, or a
>> fork at all?  Is it descended from MSysGit?  I have been googling all over,
>> but not finding good answers.

GitForWindows 2.x is based on MSYS2, which doesn't share any non-cygwin
code with the old MSYS1 as far as I'm aware, but it reimplements (on
top of a much more up-to-date fork of cygwin) the path-mangling trick
that was the main motivating factor for using MSYS1 in the first place.
When you have a non-cygwin windows executable (one compiled by mingw.org,
or mingw-w64, or MSVC compilers) and try to pass it a posix/cygwin-style
absolute path, the windows executable won't usually recognize it as a
file that exists. What the MSYS shell does is apply a heuristic that
automatically translates posix-style absolute paths to Windows paths
(similar to manually calling `cygpath -w /posix/style/path` on each
argument within cygwin) before passing the argument to the executable.
There are other differences between MSYS2 and Cygwin, mostly that it
uses a different package manager and repository, but these are less
significant with respect to GitForWindows' requirements.

The git.exe in Cygwin's git package is a cygwin executable compiled
by cygwin's gcc. Hence it understands posix-style paths just fine,
but it depends on cygwin1.dll to do so, and may not perform as well as
a non-cygwin Windows executable. (Maybe someone has benchmarked this.)

GitForWindows has historically been compiled using mingw gcc -
the legacy and now-mostly-obsolete mingw.org in the git 1.x timeframe
(this is the reason there was not a 64 bit version of git.exe through
that release channel at the time), and more recently the mingw-w64
compilers for git 2.x. Many of your questions are answered at
https://github.com/git-for-windows/git/wiki/FAQ#what-is-the-relationship-between-git-for-windows-and-msysgit
https://github.com/git-for-windows/build-extra#components-of-the-git-for-windows-sdk
https://www.msys2.org

Some components used by git (any shell scripts, for example) require
some form of posix compatibility layer to function. The recent MinGit
has a busybox-based variant that can mostly avoid MSYS2 dependencies,
though it seems to have at least some small MSYS2 pieces remaining:
https://github.com/git-for-windows/git/wiki/MinGit#experimental-busybox-based-mingit

You can see exactly how the MSYS2 runtime used by GitForWindows differs
from the version used by the MSYS2 project itself by looking at the
git repo at https://github.com/git-for-windows/msys2-runtime/commits/master
and how MSYS2 differs from upstream cygwin by looking at the repos at
https://github.com/Alexpux/Cygwin/commits/msys2-master
https://github.com/mirror/newlib-cygwin/commits/master
https://github.com/mirror/newlib-cygwin/releases

These "patch sets" tend to get rebased pretty frequently when new
cygwin releases come out upstream.

I dunno where else this history has been written down, but this is
my understanding of the development heritage. Any git and/or MSYS2
maintainers can correct me if anything I stated here is incorrect.

-Tony

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple