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

Re: [PATCHv2 1/3] t6022: New test checking for unnecessary updates of renamed+modified files

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Mar 1, 2011, 07:33 UTC
Message-ID
<4D6CA13C.1000006@viscovery.net>
In-Reply-To
<1298941732-19763-2-git-send-email-newren@gmail.com>
Am 3/1/2011 2:08, schrieb Elijah Newren:
> +test_expect_failure 'avoid unnecessary update, normal rename' '
> +	git checkout -q avoid-unnecessary-update-1^0 &&
> +	touch -t 197001010000.01 rename &&
Use
	test-chmtime =1000000000 rename &&
> +	orig=$(stat --format="%Y" rename) &&
	orig=$(test-chmtime -v +0 rename) &&
> +	git merge merge-branch-1 &&
> +	new=$(stat --format="%Y" rename) &&
	new=$(test-chmtime -v +0 rename) &&
> +	echo "Checking whether stat times are same: $orig vs $new" &&
	echo "Checking whether stat times are same: ${orig%%	*} vs ${new%%	*}" &&
(that's TAB after the %%)
> +	test "$orig" == "$new" &&
	test "${orig%%	*}" = "${new%%	*}" &&

== is not portable. Actually, since the file name is the same in both $orig and $new, you wouldn't need the %% magic in this statement.

> +	git diff-files --exit-code # Is "rename" clean, or only racily clean?

What you see here, is not "racily clean", but "stat dirty". "Racily clean" means that git thinks that the file is clean (because the stat information matches), but in fact the file content is not identical to the content recorded in the index.

> +'
> +
>  test_done
-- Hannes
Previous: Elijah NewrenNext: Jeff King
Message 3 of 14 in “[PATCHv2 0/3] Fix unnecessary (mtime) updates of files during merge”
  1. Elijah NewrenMar 1, 2011
  2. 1/3 t6022: New test checking for unnecessary updates of renamed+modified filesElijah Newren, Mar 1, 2011
  3. Johannes SixtMar 1, 2011
  4. Jeff KingMar 1, 2011
  5. Elijah NewrenMar 2, 2011
  6. 2/3 t6022: New test checking for unnecessary updates of files in D/F conflictsElijah Newren, Mar 1, 2011
  7. 3/3 merge-recursive: When we detect we can skip an update, actually skip itElijah Newren, Mar 1, 2011
  8. Junio C HamanoMar 2, 2011
  9. Elijah NewrenMar 2, 2011
  10. Junio C HamanoMar 2, 2011
  11. Jeff KingMar 1, 2011
  12. Jeff KingMar 1, 2011
  13. Elijah NewrenMar 2, 2011
  14. Junio C HamanoMar 2, 2011

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.