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

[PATCH/RFH] Racy GIT (part #3)

From
Junio C Hamano <junkio@cox.net>
Date
Jun 29, 2006, 21:50 UTC
Message-ID
<7v7j2zpr6k.fsf@assigned-by-dhcp.cox.net>

Does everybody have "cp -p" to preserve the file timestamps on his/her platform? I am assuming this is safe (it is in POSIX), but please raise hand if that is not a case for you.

-- >8 -- Commit 29e4d3635709778bcc808dbad0477efad82f8d7e fixed the underlying update-index races but git-commit was not careful enough to preserve the index file timestamp when copying the index file. This caused t3402 test to occasionally fail.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-commit.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/git-commit.sh b/git-commit.sh
index 7e50cf3..22c4ce8 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -29,7 +29,7 @@ THIS_INDEX="$GIT_DIR/index"
 NEXT_INDEX="$GIT_DIR/next-index$$"
 rm -f "$NEXT_INDEX"
 save_index () {
-	cp "$THIS_INDEX" "$NEXT_INDEX"
+	cp -p "$THIS_INDEX" "$NEXT_INDEX"
 }
 
 report () {
-- 
1.4.1.rc2.g3257-dirty
Next: Uwe Zeisberger
Message 1 of 2 in “Racy GIT (part #3)”
  1. Racy GIT (part #3)Junio C Hamano, Jun 29, 2006
  2. Uwe ZeisbergerJun 30, 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.