public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Most git executables are hard links to git.exe?
@ 2023-07-21 20:59 Jim Garrison
  2023-07-21 21:52 ` Brian Inglis
  0 siblings, 1 reply; 8+ messages in thread
From: Jim Garrison @ 2023-07-21 20:59 UTC (permalink / raw)
  To: cygwin

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
jhg@acm.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-11-06 17:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-21 20:59 Most git executables are hard links to git.exe? Jim Garrison
2023-07-21 21:52 ` Brian Inglis
2023-07-21 21:54   ` Jim Garrison
2023-07-22  5:55     ` Larry
2023-07-22 17:33     ` Adam Dinwoodie
2023-07-22 17:35       ` Jim Garrison
2023-07-30  0:32         ` L A Walsh
2023-07-31 13:36     ` Andrey Repin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).