Introduce core.keepHardLinkshardlinks
commit1c6fe8b4708ac806b2507d8dcaeb8e7f38f9ad6f
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 10 Oct 2008 23:34:40 +0000 (11 01:34 +0200)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 2 Jan 2009 21:33:51 +0000 (2 22:33 +0100)
tree856990ed7473dd8f35a0bd2795b304ab8a85c620
parentd5e04d9096724bcfe9171ada39d87f0b9777d4bb
Introduce core.keepHardLinks

When a tracked file was hard linked, we used to break the hard link
whenever Git writes to that file.

In some situations, this behavior is less-than-desirable, especially
given the fact that some popular editors do not do that, such as
(in alphabetical order) emacs and vi.

So teach Git not to break hard links when the config variable
core.keepHardLinks is set to true.  For backwards compatibility, this
variable defaults to false.

From a safety viewpoint, nothing really changes, as to keep hard links,
Git will now open the files it updates with O_TRUNC instead of deleting
them first and then opening them with O_EXCL.

To keep the implementation simple, mode changes will still break the
hard links.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Documentation/config.txt
cache.h
config.c
entry.c
environment.c
t/t0056-hardlinked.sh [new file with mode: 0644]