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

Re: [PATCH] diff-files: treat "i-t-a" files as "not-in-index"

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 18, 2020, 22:40 UTC
Message-ID
<xmqqbllgknfd.fsf@gitster.c.googlers.com>
In-Reply-To
<xmqqk104knrs.fsf@gitster.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 5 quoted lines
>> +	touch empty &&
>
> Use of "touch" gives a wrong impression that you care about the file
> timestamp; use something like ": >empty &&" instead when you care
> about the presence of the file and do not care about its timestamp.

I just realized that this is even more important in this case not to use "touch".

The test that uses this file cares not just the presence, but it deeply cares that its contents is empty. The thing it least cares about is its timestamp.

The purpose of using "touch" is to update the timestamp, to keep the current contents if it exists, and to ensure it exists (as a side effect), in the decreasing order of importance. Use of the command here misleads the readers.

Thanks.
Previous: Junio C HamanoNext: Srinidhi Kaushik
Message 7 of 12 in “diff-files: treat "i-t-a" files as "not-in-index"”
  1. diff-files: treat "i-t-a" files as "not-in-index"Srinidhi Kaushik, Jun 11, 2020
  2. Junio C HamanoJun 11, 2020
  3. Srinidhi KaushikJun 11, 2020
  4. Srinidhi KaushikJun 18, 2020
  5. Junio C HamanoJun 18, 2020
  6. Junio C HamanoJun 18, 2020
  7. Junio C HamanoJun 18, 2020
  8. Srinidhi KaushikJun 19, 2020
  9. Junio C HamanoJun 19, 2020
  10. diff-files: treat "i-t-a" files as "not-in-index"Srinidhi Kaushik, Jun 20, 2020
  11. Junio C HamanoJun 20, 2020
  12. Johannes SchindelinJun 23, 2020

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.