]> git.ipfire.org Git - thirdparty/git.git/commit - server-info.c
update-server-info: avoid needless overwrites
authorEric Wong <e@80x24.org>
Mon, 13 May 2019 23:17:08 +0000 (23:17 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 May 2019 05:07:37 +0000 (14:07 +0900)
commitf4f476b6a19217b6ed3d5022422b3fa0f55a5ee9
tree08bab816c4d11dea4d8531287b53651999754a26
parentab15ad1a3b4b04a29415aef8c9afa2f64fc194a2
update-server-info: avoid needless overwrites

Do not change the existing info/refs and objects/info/packs
files if they match the existing content on the filesystem.
This is intended to preserve mtime and make it easier for dumb
HTTP pollers to rely on the If-Modified-Since header.

Combined with stdio and kernel buffering; the kernel should be
able to avoid block layer writes and reduce wear for small files.

As a result, the --force option is no longer needed.  So stop
documenting it, but let it remain for compatibility (and
debugging, if necessary).

v3: perform incremental comparison while generating to avoid
    OOM with giant files.  Remove documentation for --force.

Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-update-server-info.txt
server-info.c
t/t5200-update-server-info.sh [new file with mode: 0755]