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

Re: [PATCH] git p4 test: fix failure in 9814-git-p4-rename.sh Was: Re: Test failure in t9814-git-p4-rename.sh - my environment or bad test?

From
CBChristoph Bonitz <ml.christophbonitz@gmail.com>
Date
Jul 30, 2014, 07:08 UTC
Message-ID
<CABUJjW_tnf2SRCyjRw1n+UbzLzTbmqW6XAJSJnZ5qszdpJ3SYA@mail.gmail.com>
In-Reply-To
<xmqq4my68la5.fsf@gitster.dls.corp.google.com>
On Fri, Jul 25, 2014 at 12:05 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 10 quoted lines
> Johannes Sixt <j6t@kdbg.org> writes:
>> I see a few other no-nos in the context of the changes, in particular,
>> pipelines where git is not the last command; these would not catch
>> failures in the git commands. But a fix for that is certainly outside
>> the scope of this patch.
>
> Yuck.  Thanks for spotting.
>
> Perhaps we should apply a preliminary clean-up before doing anything
> else, perhaps?  The change in 9814 is a post 2.0 regression.

Apart from your change and the word wrap adjustments suggested by Pete, would the following also make sense, to fix the other flaw Johannes pointed out? With regards to failing, git diff-tree should be idempotent. I think those are the two occurrences in this file:

diff --git a/t/t9814-git-p4-rename.sh b/t/t9814-git-p4-rename.sh
index 1fc1f5f..7815f9a 100755
--- a/t/t9814-git-p4-rename.sh
+++ b/t/t9814-git-p4-rename.sh
@@ -176,6 +176,7 @@ test_expect_success 'detect copies' '
                git diff-tree -r -C --find-copies-harder HEAD &&
                level=$(git diff-tree -r -C --find-copies-harder HEAD
| sed 1d | cut -f1 | cut -d" " -f5 | sed "s/C
                test -n "$level" && test "$level" -gt 0 && test
"$level" -lt 98 &&
+               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 || test "$src" = file11 &&
                git config git-p4.detectCopies $(($level + 2)) &&
@@ -190,6 +191,7 @@ test_expect_success 'detect copies' '
                git diff-tree -r -C --find-copies-harder HEAD &&
                level=$(git diff-tree -r -C --find-copies-harder HEAD
| sed 1d | cut -f1 | cut -d" " -f5 | sed "s/C
                test -n "$level" && test "$level" -gt 2 && test
"$level" -lt 100 &&
+               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 || test "$src" = file11 || test
"$src" = file12 &&
                git config git-p4.detectCopies $(($level - 2)) &&
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 7 in “git p4 test: fix failure in 9814-git-p4-rename.sh Was: Re: Test failure in t9814-git-p4-rename.sh - my environment or bad test?”
  1. git p4 test: fix failure in 9814-git-p4-rename.sh Was: Re: Test failure in t9814-git-p4-rename.sh - my environment or bad test?Christoph Bonitz, Jul 23, 2014
  2. Pete WyckoffJul 23, 2014
  3. Johannes SixtJul 24, 2014
  4. Junio C HamanoJul 24, 2014
  5. Christoph BonitzJul 30, 2014
  6. Junio C HamanoJul 30, 2014
  7. Christoph BonitzJul 30, 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.