Most git executables are hard links to git.exe?
Jim Garrison
jhg@jhmg.net
Sat Jul 22 17:35:53 GMT 2023
On 07/22/23 10:33, Adam Dinwoodie wrote:
> On Fri, 21 Jul 2023 at 22:54, Jim Garrison via Cygwin wrote:
>>
>> On 07/21/23 14:52, Brian Inglis wrote:
>>> 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:
>> [snip]
>>>> 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.
>>
>> But why not use symbolic links to accomplish the same thing?
>
> A few reasons off the top of my head:
>
> - This is what the Git build tooling does out of the box. Minimising
> the number of changes we're making as a downstream packager makes my
> life easier as package maintainer.
>
[snip]
> Hopefully that's all useful and/or interesting, even if it's not the
> answer you were hoping for!
Yes, that's very useful and now I understand and appreciate all the
good reasons for hard links. Thanks!
--
Jim Garrison
jhg@acm.org
More information about the Cygwin
mailing list