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

Re: [PATCH] tests: test applying criss-cross rename patch

From
Alex Riesen <raa.lkml@gmail.com>
Date
Apr 21, 2009, 12:41 UTC
Message-ID
<81b0412b0904210541o17baa103h62fc0825727fe83b@mail.gmail.com>
In-Reply-To
<7viqkya3hq.fsf@gitster.siamese.dyndns.org>
2009/4/21 Junio C Hamano <gitster@pobox.com>:
Show 22 quoted lines
> Alex Riesen <raa.lkml@gmail.com> writes:
>
>> 2009/4/11 Michał Kiedrowicz <michal.kiedrowicz@gmail.com>:
>>> +test_expect_success 'criss-cross rename' '
>>> +       mv file1 tmp &&
>>> +       mv file2 file1 &&
>>> +       mv tmp file2
>>> +'
>>> +
>>> +test_expect_success 'diff -M -B' '
>>> +       git diff -M -B > diff &&
>>> +       git reset --hard
>>> +
>>> +'
>>
>> This cannot work on systems where ctime is not trusted:
>> git diff will produce no data, as there are no changes in
>> metadata (the files are of the same size). Either make
>> the file sizes different or add a "touch file1 file2".
>
> You seem to be saying that we still have a racy-git bug somewhere.  Is
> your statement from an actual experience or a speculation?
The test reproducibly fails for me.
> If the former we have a bug to kill, not a workaround to avoid the
> issue in this test.

Maybe. As I see it, there is just not _enough_ metadata in this particular case to notice the change without doing complete content comparison: the size is the same, mtime is the same, dev/ino aren't available, and ctime is marked untrusted and thus is not used. What's left to notice the change?

Previous: Junio C Hamano
Message 7 of 7 in “buglet: 'git apply' doesn't handle criss-cross renames”
  1. Linus TorvaldsApr 9, 2009
  2. tests: test applying criss-cross rename patchMichał Kiedrowicz, Apr 11, 2009
  3. Junio C HamanoApr 13, 2009
  4. Junio C HamanoApr 13, 2009
  5. Alex RiesenApr 20, 2009
  6. Junio C HamanoApr 21, 2009
  7. Alex RiesenApr 21, 2009

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.