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

Re: [PATCH] Libify diff-files.

From
Junio C Hamano <junkio@cox.net>
Date
Apr 22, 2006, 10:52 UTC
Message-ID
<7vfyk5khm7.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vbqutlxwq.fsf@assigned-by-dhcp.cox.net>

I noticed that there are two flags related to missing working tree files in diff-files and diff-index. The former takes -q to mean "do not report lossage of working tree files", and the latter uses -m to mean "when not using --cached, pretend that missing working tree files are actually present and match the index".

Being able to pretend missing working tree files are unchanged was originally done to help merging in a separate temporary area, and it is useful, but I wish we used the same flag. I started wondering if we can unify them to '-q', since '-m' means "do not ignore merges" in diff-tree context (including log and whatchanged).

NOTE. -q is different from specifying --diff-filter=ACMRTU; while the former does not even feed the filepair to diffcore, the latter tells the diffcore to filter deletion out in the output phase. The distinction makes huge difference when the rename/copy detection, especially without --find-copies-harder, is involved.

Now, as far as I can tell, nobody uses "diff-files -q". Cogito uses "diff-index -m" quite a bit, but I suspect large part of it is remnant from the days it did a merge in a separate directory, and/or a cut-and-paste error from neighbouring "diff-tree -m -r".

A cursory look suggests some could even be bugs. For example, cg-patch has

	diff-tree -m -r "$commitparent" "$commitid"

(where -m does not have any effect) which is immediately followed by a

	diff-index -m -r HEAD
where -m may or may not be intended.
Message 1 of 1 in “Re: [PATCH] Libify diff-files.”
  1. Junio C HamanoApr 22, 2006

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.