git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Cross-directory hard links

From
CSCedric Staniewski <cedric@gmx.ca>
Date
May 11, 2009, 10:41 UTC
Message-ID
<loom.20090511T101424-212@post.gmane.org>
Hi everybody,

git commit 6a0861 [1] made bin/git the target of the builtins hard links which results in 'cross-directory' hard links. While the Makefile always works fine for the local installation via 'make install', these links can raise trouble when installing git via package manager.

The problem only occurs on systems where git's bin and lib directories will be installed on different file systems, e.g. if /usr and /usr/lib are different mount points. If you attempt to install a git package which was built with DESTDIR=/usr and contains such hard links, tar will fail to extract either bin/git or the builtins (depending on how tar resolves the hard links) complaining about a 'Invalid cross-device link'.

I know such a setup is probably quite rare, but the problem can easily be fixed by always copying bin/git to lib/git-add instead of hard linking it.

Cheers, Cedric

[1] http://git.kernel.org/?p=git/git.git;a=commit;h=6a0861a8a3295395238c8126c6e74c66b715c595

Next: Johannes Schindelin
Message 1 of 6 in “Cross-directory hard links”
  1. Cedric StaniewskiMay 11, 2009
  2. Add NO_CROSS_DIRECTORY_HARDLINKS support to the MakefileJohannes Schindelin, May 11, 2009
  3. Cedric StaniewskiMay 11, 2009
  4. Johannes SchindelinMay 11, 2009
  5. Cedric StaniewskiMay 11, 2009
  6. Tony FinchMay 11, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.