git-gc-preserve: write process details to gc-preserve.pid
Write the following details to the gc-preserve.pid:
<pid> <username>@<hostname>
git gc writes similar information to gc.pid.
This simplifies finding out which process started git-gc-preserve.
Release-Notes: skip
Change-Id: I73ba486a0e0cb0ec0b9a16324a845686f6743a4c
diff --git a/contrib/git-gc-preserve b/contrib/git-gc-preserve
index f3946ab..a886721 100755
--- a/contrib/git-gc-preserve
+++ b/contrib/git-gc-preserve
@@ -67,6 +67,7 @@
test -f "$LOCKFILE" || touch "$LOCKFILE"
exec 9> "$LOCKFILE"
if flock -nx 9; then
+ echo -n "$$ $USERNAME@$HOSTNAME" >&9
trap unlock EXIT
else
echo "$0 is already running"