Re: [PATCH v2 6/8] t7063: drop non-POSIX argument "-ls" from find(1)

2 messages, 2 authors, 2020-03-24 · open the first message on its own page

Re: [PATCH v2 6/8] t7063: drop non-POSIX argument "-ls" from find(1)

From: Junio C Hamano <hidden>
Date: 2020-03-23 15:55:40

Johannes Schindelin [off-list ref] writes:
quoted hunk
diff --git a/t/t7063-status-untracked-cache.sh
b/t/t7063-status-untracked-cache.sh
index 190ae149cf3c..ab7e8b5fea01 100755
--- a/t/t7063-status-untracked-cache.sh
+++ b/t/t7063-status-untracked-cache.sh
@@ -18,7 +18,12 @@ GIT_FORCE_UNTRACKED_CACHE=true
 export GIT_FORCE_UNTRACKED_CACHE

 sync_mtime () {
-       find . -type d -ls >/dev/null
+       if test_have_prereq BUSYBOX
+       then
+               find . -type d -print0 | xargs -0r ls -ld >/dev/null
+       else
+               find . -type d -ls >/dev/null
+       fi
Given that this is only to work around the lazy mtime sync found on
BSDs, if we were to have any if/then/else, shouldn't we be rather
doing

	if test_have_prereq NEEDS_SYNC_MTIME_BECAUSE_WE_ARE_ON_BSD
	then
		find . -type d -ls >/dev/null
	fi

to make it a no-op for most everybody (including Windows)?

Re: [PATCH v2 6/8] t7063: drop non-POSIX argument "-ls" from find(1)

From: Johannes Schindelin <hidden>
Date: 2020-03-24 22:31:16

Hi Junio,

On Mon, 23 Mar 2020, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:
quoted
diff --git a/t/t7063-status-untracked-cache.sh
b/t/t7063-status-untracked-cache.sh
index 190ae149cf3c..ab7e8b5fea01 100755
--- a/t/t7063-status-untracked-cache.sh
+++ b/t/t7063-status-untracked-cache.sh
@@ -18,7 +18,12 @@ GIT_FORCE_UNTRACKED_CACHE=true
 export GIT_FORCE_UNTRACKED_CACHE

 sync_mtime () {
-       find . -type d -ls >/dev/null
+       if test_have_prereq BUSYBOX
+       then
+               find . -type d -print0 | xargs -0r ls -ld >/dev/null
+       else
+               find . -type d -ls >/dev/null
+       fi
Given that this is only to work around the lazy mtime sync found on
BSDs, if we were to have any if/then/else, shouldn't we be rather
doing

	if test_have_prereq NEEDS_SYNC_MTIME_BECAUSE_WE_ARE_ON_BSD
	then
		find . -type d -ls >/dev/null
	fi

to make it a no-op for most everybody (including Windows)?
I like that approach.

Thank you,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help