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

Re: [PATCH] "sleep 1" sleeps too little on cygwin

From
Junio C Hamano <junkio@cox.net>
Date
Jan 18, 2006, 08:53 UTC
Message-ID
<7vmzhtzzlf.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<81b0412b0601170325y60094b4w693ac37490c67410@mail.gmail.com>

Sorry, but the previous patch turns out to be bogus as well. 'touch' did not affect the timestamp of the symbolic link but ended up creating a file pointed by it, and since we (hopefully) correctly do lstat() not stat(), it did not have any good effect. Here is an replacement.

-- >8 --
Subject: [PATCH] t4011: "sleep 1" sleeps too little on cygwin

This test depended on "sleep 1" not to return until the next second boundary, to get a dirty index entry. An initial fix was provided by Alex Riesen using a bashism $SECONDS, but make it a bit more portable, and also work around a potential problem on a filesystem with coarser-than-a-second timestamp granularity, this patch fixes it a bit differently.

The test is checking if we correctly notice the stat changes, and the timestamp is not the only thing we have in the stat part of the index. This commit fixes the problem by leaving the original symlink we create on the filesystem, so that it keeps the inode number used for the original symlink in use, and then create a second one which should get a different inode number.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 t/t4011-diff-symlink.sh |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
5f6849e7b60bc4908bf10a7946fd93d4aaaf9c35
diff --git a/t/t4011-diff-symlink.sh b/t/t4011-diff-symlink.sh
index e3ebf38..f0e3491 100755
--- a/t/t4011-diff-symlink.sh
+++ b/t/t4011-diff-symlink.sh
@@ -48,7 +48,7 @@ EOF
 
 test_expect_success \
     'diff removed symlink' \
-    'rm frotz &&
+    'mv frotz nitfol &&
     git-diff-index -M -p $tree > current &&
     compare_diff_patch current expected'
 
@@ -58,8 +58,7 @@ EOF
 
 test_expect_success \
     'diff identical, but newly created symlink' \
-    'sleep 1 &&
-    ln -s xyzzy frotz &&
+    'ln -s xyzzy frotz &&
     git-diff-index -M -p $tree > current &&
     compare_diff_patch current expected'
 
-- 
1.1.3.gce7b
Previous: Christopher FaylorNext: Johannes Schindelin
Message 6 of 22 in “"sleep 1" sleeps too little on cygwin”
  1. "sleep 1" sleeps too little on cygwinAlex Riesen, Jan 17, 2006
  2. Junio C HamanoJan 18, 2006
  3. Alex RiesenJan 18, 2006
  4. Junio C HamanoJan 18, 2006
  5. Christopher FaylorJan 19, 2006
  6. Junio C HamanoJan 18, 2006
  7. Johannes SchindelinJan 18, 2006
  8. Junio C HamanoJan 18, 2006
  9. Alex RiesenJan 18, 2006
  10. Junio C HamanoJan 19, 2006
  11. Christopher FaylorJan 19, 2006
  12. Alex RiesenJan 19, 2006
  13. Junio C HamanoJan 19, 2006
  14. Alex RiesenJan 19, 2006
  15. Junio C HamanoJan 20, 2006
  16. Christopher FaylorJan 19, 2006
  17. Alex RiesenJan 19, 2006
  18. Christopher FaylorJan 19, 2006
  19. Junio C HamanoJan 20, 2006
  20. Christopher FaylorJan 20, 2006
  21. Alex RiesenJan 20, 2006
  22. Christopher FaylorJan 20, 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.