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

Test failure in t9814-git-p4-rename.sh - my environment or bad test?

From
CBChristoph Bonitz <ml.christophbonitz@gmail.com>
Date
Jul 6, 2014, 14:32 UTC
Message-ID
<CABUJjW-iZU2Dp-yfuf302pNMuMj8NBXTvBW-0UHNxXdSWSk4Zw@mail.gmail.com>
Hi,

I'm trying to get the git p4 tests to pass on my machine (OS X Mavericks) from master before making some changes. I'm experiencing a test failure in "detect copies" of the rename test.

The test creates file2 with some content, creates a few copies (each with a commit), then does the following (no git write operations omitted): echo "file2" >>file2 && cp file2 file10 && git add file2 file10 && git commit -a -m "Modify and copy file2 to file10" && ... (some non-write-operations) ... cp file2 file11 && git add file11 && git commit -a -m "Copy file2 to file11" && git diff-tree -r -C --find-copies-harder HEAD && src=$(git diff-tree -r -C --find-copies-harder HEAD | sed 1d | cut -f2) && test "$src" = file10 &&

This is where it fails on my machine. The git diff-tree output is this :100644 100644 22a35c17c4c0779f75142036beef6ccd58525b9c 22a35c17c4c0779f75142036beef6ccd58525b9c C100 file2 file11 so git diff-tree sees file2 as the copy source, not file10. In my opinion, the diff-tree result is legitimate (at that point, file2, file10 and file11 are identical). Later in the tests, after making more copies of file2, the conditions are more flexible, e.g. test "$src" = file10 || test "$src" = file11 || test "$src" = file12 &&

IMO, the test discounts the legitimate possibility of diff-tree detecting file2 as source, making unnecessary assumptions about implementation details. Is this correct, or do I misunderstand the workings of diff-tree?

I'd be grateful for advice, both on whether this is a bug, and if so, which branch to base a patch on.

Best regards Christoph Bonitz

Next: Pete Wyckoff
Message 1 of 3 in “Test failure in t9814-git-p4-rename.sh - my environment or bad test?”
  1. Christoph BonitzJul 6, 2014
  2. Pete WyckoffJul 7, 2014
  3. Junio C HamanoJul 7, 2014

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.