commit-graph: implement --delete-expired
authorDerrick Stolee <stolee@gmail.com>
Mon, 19 Feb 2018 18:53:21 +0000 (13:53 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 20 Feb 2018 20:30:06 +0000 (12:30 -0800)
commita33b9b79ff395de517241db5fb9559cafb2bd14b
tree4b7c135f4c18736733c5458142249680608fc30b
parent0fd2d95ee68a8248c3df101e26127cd4707813ca
commit-graph: implement --delete-expired

Teach git-commit-graph to delete the .graph files that are siblings of a
newly-written graph file, except for the file referenced by 'graph-latest'
at the beginning of the process and the newly-written file. If we fail to
delete a graph file, only report a warning because another git process may
be using that file. In a multi-process environment, we expect the previoius
graph file to be used by a concurrent process, so we do not delete it to
avoid race conditions.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-commit-graph.txt
builtin/commit-graph.c
commit-graph.c
commit-graph.h
t/t5318-commit-graph.sh