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

[PATCH] .gitattributes: Enable cpp diff parsing for .[ch] files

From
Boaz Harrosh <bharrosh@panasas.com>
Date
Aug 25, 2011, 22:37 UTC
Message-ID
<4E56CE8F.8080501@panasas.com>

The Linux Kernel source tree is certainly a C language repository. As a maintainer and code reviewer I would like too, for example: See function names as hunk headers and not goto labels. And all the other goodies a language specific diff parser gives me.

Add a .gitattributes file to the Linux tree to enable cpp parsing of the source files.

People are welcome to add other parsers for other type of files if needed. (Like Makefile or Kconfig ...)

CC: Jeff King <peff@peff.net>
CC: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 .gitattributes |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
 create mode 100644 .gitattributes
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..6d2b620
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,2 @@
+*.h diff=cpp
+*.c diff=cpp
-- 
1.7.6
Next: Linus Torvalds
Message 1 of 10 in “.gitattributes: Enable cpp diff parsing for .[ch] files”
  1. .gitattributes: Enable cpp diff parsing for .[ch] filesBoaz Harrosh, Aug 25, 2011
  2. Linus TorvaldsAug 26, 2011
  3. Junio C HamanoAug 26, 2011
  4. Linus TorvaldsAug 26, 2011
  5. Boaz HarroshAug 26, 2011
  6. Peter ZijlstraAug 29, 2011
  7. Boaz HarroshAug 29, 2011
  8. Peter ZijlstraAug 29, 2011
  9. Linus TorvaldsAug 29, 2011
  10. Boaz HarroshAug 29, 2011

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.