git-for-windows / git

A fork of Git containing Windows-specific patches.
http://gitforwindows.org/
Other
8.18k stars 2.49k forks source link

Omit tar.exe when C:\Windows\System32\tar.exe exists #5022

Closed hickford closed 6 days ago

hickford commented 1 week ago

Windows 10 build 17063 and later include bsdtar at C:\Windows\System32\tar.exe https://ss64.com/nt/tar.html . IMHO this is superior to GNU tar at "C:\Program Files\Git\usr\bin\tar.exe" https://unix.stackexchange.com/a/104035/7732

C:\>"C:\Windows\System32\tar.exe" --version
bsdtar 3.6.2 - libarchive 3.6.2 zlib/1.2.5.f-ipp liblzma/5.2.5 bz2lib/1.0.8 libzstd/1.5.4

C:\>"C:\Program Files\Git\usr\bin\tar.exe" --version
tar (GNU tar) 1.35

Is it necessary to install C:\Program Files\Git\usr\bin\tar.exe when C:\Windows\System32\tar.exe exists? Could it be omitted?

dscho commented 1 week ago

Windows 10 build 17063 and later include bsdtar at C:\Windows\System32\tar.exe https://ss64.com/nt/tar.html . IMHO this is superior to GNU tar at "C:\Program Files\Git\usr\bin\tar.exe"

Whether or not bsdtar is superior to GNU tar is a highly contentious question, and I am the opposite of eager to take sides.

A question I am eager to take sides, however, is whether or not to break well-established expectations. Hyrum's law is a thing, after all, a really big thing. Therefore I tend to err quite clearly on the side of keeping things as-are, unless there are good reasons not to. And in this instance, personal opinions are less likely to convince me.

hickford commented 6 days ago

Good point.

dscho commented 6 days ago

To give you a workaround: If all you want is to let interactive tar invocations default to bsdtar, you could set a Bash alias tar that points to the one you want to use, in ~/.profile.