On 2023-07-21 14:59, Jim Garrison via Cygwin wrote:
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.

For the same reason you are complaining about backups not taking hardlinks into account: to avoid distributing 400MB instead of 3MB.

Cygwin backup utilities should be able to deal with these e.g. rsync -H, --hard-links, although it appears xcopy and robocopy may not under Windows 10; don't know about other utilities or Windows 11.

--
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer     but when there is no more to cut
                                -- Antoine de Saint-Exupéry


--
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