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

[PATCH] Repack should try to prevent itself from running twice, concurrently.

From
RARyan Anderson <ryan@michonline.com>
Date
Jun 25, 2006, 10:10 UTC
Message-ID
<11512302144123-git-send-email-ryan@michonline.com>
In-Reply-To
<7vy7vmormn.fsf@assigned-by-dhcp.cox.net>
Signed-off-by: Ryan Anderson <ryan@michonline.com>
---
 git-repack.sh |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/git-repack.sh b/git-repack.sh
index eb75c8c..20f9b55 100755
--- a/git-repack.sh
+++ b/git-repack.sh
@@ -24,6 +24,15 @@ do
 	shift
 done
 
+if [ -f $GIT_DIR/repack.lock ]
+then
+	echo "Existing repack job appears to be running."
+	echo "Remove $GIT_DIR/repack.lock if this is not the case."
+	exit 1
+else
+	echo $$ > $GIT_DIR/repack.lock
+fi
+
 rm -f .tmp-pack-*
 PACKDIR="$GIT_OBJECT_DIRECTORY/pack"
 
@@ -83,3 +92,5 @@ case "$no_update_info" in
 t) : ;;
 *) git-update-server-info ;;
 esac
+
+rm $GIT_DIR/repack.lock
-- 
1.4.1.rc1.gacb70
Previous: Junio C HamanoNext: Johannes Schindelin
Message 3 of 7 in “[RFC] git-fetch - repack in the background after fetching”
  1. Martin LanghoffJun 24, 2006
  2. Junio C HamanoJun 25, 2006
  3. Repack should try to prevent itself from running twice, concurrently.Ryan Anderson, Jun 25, 2006
  4. Johannes SchindelinJun 25, 2006
  5. Linus TorvaldsJun 25, 2006
  6. Johannes SchindelinJun 25, 2006
  7. Linus TorvaldsJun 25, 2006

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.