git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFH] Racy GIT (part #3)
@ 2006-06-29 21:50 Junio C Hamano
  2006-06-30  7:43 ` Uwe Zeisberger
  0 siblings, 1 reply; 2+ messages in thread
From: Junio C Hamano @ 2006-06-29 21:50 UTC (permalink / raw)
  To: git

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH/RFH] Racy GIT (part #3)
  2006-06-29 21:50 [PATCH/RFH] Racy GIT (part #3) Junio C Hamano
@ 2006-06-30  7:43 ` Uwe Zeisberger
  0 siblings, 0 replies; 2+ messages in thread
From: Uwe Zeisberger @ 2006-06-30  7:43 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hello,

Junio C Hamano wrote:
> 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.
Solaris[1] has two different "cp"s[2].

 From cp(1):
	[...] [/usr/bin/cp] does not fail if unable to preserve extended
	attributes, modification and access time, or permission modes.

	[...] [/usr/xpg4/bin/cp] does not fail if unable to preserve
	extended attributes.  If unable to duplicate the modification
	and access time or the permission modes, cp prints a diagnostic
	message to stderr and return a non-zero exit status.


There is yet an other difference when -@ is specified.  The complete man
page can be found at docs.sun.com[2].

Best regards
Uwe

[1] in my case Solaris 10 = SunOS 5.10 and Solaris 9 = SunOS 5.9
[2] http://docs.sun.com/app/docs/doc/816-5165/6mbb0m9dm?a=view

-- 
Uwe Zeisberger

http://www.google.com/search?q=0+degree+Celsius+in+kelvin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-30  7:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-29 21:50 [PATCH/RFH] Racy GIT (part #3) Junio C Hamano
2006-06-30  7:43 ` Uwe Zeisberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).