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

[PATCH] Fix 'diff' attribute semantics.

From
Junio C Hamano <junkio@cox.net>
Date
Apr 15, 2007, 23:12 UTC
Message-ID
<7vlkgt1bck.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<7vr6ql1ben.fsf@assigned-by-dhcp.cox.net>

This is in the same spirit as the previous one. Earlier 'diff' meant 'do the built-in binary heuristics and disable patch text generation based on it' while '!diff' meant 'do not guess, do not generate patch text'. There was no way to say 'do generate patch text even when the heuristics says it has NUL in it'.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 * And this is a companion patch to 'crlf' one.
 diff.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/diff.c b/diff.c
index e4efb65..dcea405 100644
--- a/diff.c
+++ b/diff.c
@@ -1069,8 +1069,9 @@ static int file_is_binary(struct diff_filespec *one)
 
 	setup_diff_attr_check(&attr_diff_check);
 	if (!git_checkattr(one->path, 1, &attr_diff_check) &&
-	    (0 == attr_diff_check.isset))
-		return 1;
+	    (0 <= attr_diff_check.isset))
+		return !attr_diff_check.isset;
+
 	if (!one->data) {
 		if (!DIFF_FILE_VALID(one))
 			return 0;
-- 
1.5.1.1.815.g3e763
Previous: Junio C HamanoNext: Tom Prince
Message 14 of 19 in “Add basic infrastructure to assign attributes to paths”
  1. 1/3 Add basic infrastructure to assign attributes to pathsJunio C Hamano, Apr 13, 2007
  2. Andy ParkinsApr 13, 2007
  3. Junio C HamanoApr 15, 2007
  4. 1/2 attribute macro supportJunio C Hamano, Apr 15, 2007
  5. 2/2 Define a few built-in attribute rules.Junio C Hamano, Apr 15, 2007
  6. Linus TorvaldsApr 15, 2007
  7. Brian GernhardtApr 15, 2007
  8. Junio C HamanoApr 15, 2007
  9. Junio C HamanoApr 15, 2007
  10. Johannes SchindelinApr 15, 2007
  11. Junio C HamanoApr 15, 2007
  12. Linus TorvaldsApr 15, 2007
  13. Fix 'crlf' attribute semantics.Junio C Hamano, Apr 15, 2007
  14. Fix 'diff' attribute semantics.Junio C Hamano, Apr 15, 2007
  15. Tom PrinceApr 15, 2007
  16. Junio C HamanoApr 15, 2007
  17. Raimund BauerApr 16, 2007
  18. Linus TorvaldsApr 13, 2007
  19. Johannes SchindelinApr 15, 2007

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.