Git comes with over 100 executables, mostly in /usr/libexec/git-core,
that all appear to be *hard* links to /bin/git, in both Cygwin and
Windows. The Windows fsutil command shows they're all hard linked:

    C:\Users\jim>fsutil hardlink list "c:\cygwin64\bin\git.exe"
    \cygwin64\usr\libexec\git-core\git-add.exe
    \cygwin64\bin\git-upload-archive.exe
    \cygwin64\bin\git-upload-pack.exe
    \cygwin64\bin\git.exe
    \cygwin64\bin\git-receive-pack.exe
    \cygwin64\usr\libexec\git-core\git-am.exe
    \cygwin64\usr\libexec\git-core\git-annotate.exe
    [snip]

This is confirmed in a Cygwin bash session showing they all have the
same inode number.

    jim@HOME10 /usr/libexec/git-core
    $ ls -il
    total 492832
     34621422135881770 -rwxr-xr-x 142 jim None 3474451 Dec 12  2022 git.exe
34621422135881770 -rwxr-xr-x 142 jim None 3474451 Dec 12 2022 git-add.exe 34621422135881770 -rwxr-xr-x 142 jim None 3474451 Dec 12 2022 git-am.exe 34621422135881770 -rwxr-xr-x 142 jim None 3474451 Dec 12 2022 git-annotate.exe 34621422135881770 -rwxr-xr-x 142 jim None 3474451 Dec 12 2022 git-apply.exe
     [snip]

This causes other Windoze programs not aware of hard links (such as even
Windows Explorer :-( and Retrospect backup) to treat them as actual
files. In the case of Retrospect (and I suspect most backup programs)
this results in backing up 400MB instead of 3MB.

I'm curious to know if there's a specific reason for this implementation
that would make it the choice over symbolic links.

--
Jim Garrison
j...@acm.org

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

Reply via email to