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

Re: t4216-log-bloom.sh broken ?

From
Junio C Hamano <gitster@pobox.com>
Date
May 2, 2024, 20:05 UTC
Message-ID
<xmqqwmocc73f.fsf@gitster.g>
In-Reply-To
<xmqq7cgcdm4f.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 7 quoted lines
> ... it is a very unsatisfactory workaround, compared to a world where we
> do not have to worry about such a broken mv (perhaps by noticing a
> broken macOS /bin/mv and automatically doing mv () { mv -f "$@" }
> for them).
>
> I am curious what other differences Torsten will find out between
> good macs and bad ones.  Perhaps we can narrow down the bad apples?
In any case, while we are waiting, I did a few "grep":
    $ git grep 'mv \(.*\)\.tmp \1' t
    t/lib-t6000.sh:	mv sed.script.tmp sed.script
    t/t7508-status.sh:	rm "$1" && mv "$1".tmp "$1"
    t/t8011-blame-split-file.sh:	mv one.tmp one &&
    t/t8011-blame-split-file.sh:	mv two.tmp two &&
    t/t9400-git-cvsserver-server.sh:	mv merge.tmp merge &&
    t/t9400-git-cvsserver-server.sh:	mv merge.tmp merge &&
    t/t9802-git-p4-filetype.sh:		mv empty-symlink,v.tmp empty-symlink,v
    $ git grep 'mv "\(.*\)\.tmp" "\1"' t
    t/lib-chunk.sh:	mv "$fn.tmp" "$fn"
    t/t3404-rebase-interactive.sh:	mv "$1.tmp" "$1"
    t/t5515-fetch-merge-logic.sh:	mv "$file.tmp" "$file"
    t/t7600-merge.sh:) >"$1.tmp" && mv "$1.tmp" "$1"
    t/t9001-send-email.sh:	mv "$1.tmp" "$1"
    t/t9001-send-email.sh:	mv "$1.tmp" "$1"
    $ git grep 'mv \(.*\)+ \1' t
    t/t4025-hunk-header.sh:	mv file+ file
    t/t6402-merge-rename.sh:	mv A+ A &&
    t/t6402-merge-rename.sh:	mv A+ A &&
    t/t6432-merge-recursive-space-options.sh:	mv text.txt+ text.txt &&
    t/t6432-merge-recursive-space-options.sh:	mv text.txt+ text.txt &&

There is nothing other than the one we found in lib-chunk.sh that work on files under .git/objects/ that are made read-only, so we should be OK with a workaround like the attached.

 t/lib-chunk.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git c/t/lib-chunk.sh w/t/lib-chunk.sh
index a7cd9c3c6d..9f01df190b 100644
--- c/t/lib-chunk.sh
+++ w/t/lib-chunk.sh
@@ -13,5 +13,6 @@ corrupt_chunk_file () {
 	fn=$1; shift
 	perl "$TEST_DIRECTORY"/lib-chunk/corrupt-chunk-file.pl \
 		"$@" <"$fn" >"$fn.tmp" &&
-	mv "$fn.tmp" "$fn"
+	# some vintages of macOS 'mv' fails to overwrite a read-only file.
+	mv -f "$fn.tmp" "$fn"
 }
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 12 in “[ANNOUNCE] Git v2.45.0”
  1. Junio C HamanoApr 29, 2024
  2. rsbecker@nexbridge.comMay 1, 2024
  3. t4216-log-bloom.sh broken ?Torsten Bögershausen, May 2, 2024
  4. Junio C HamanoMay 2, 2024
  5. Torsten BögershausenMay 2, 2024
  6. SZEDER GáborMay 2, 2024
  7. Junio C HamanoMay 2, 2024
  8. Junio C HamanoMay 2, 2024
  9. Junio C HamanoMay 2, 2024
  10. Torsten BögershausenMay 2, 2024
  11. Junio C HamanoMay 2, 2024
  12. Junio C HamanoMay 2, 2024

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.