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

[PATCH 1/2] userdiff: add support for R programming language

From
Rodrigo Carvalho <rodrigorsdc@gmail.com>
Date
May 25, 2025, 21:02 UTC
Message-ID
<20250525210236.116342-1-rodrigorsdc@gmail.com>

The patch appends userdiff.c file in order to support R programming language function header. This will be useful for those who use Git for versioning .R files.

Signed-off-by: Rodrigo Carvalho <rodrigorsdc@gmail.com>
---
 userdiff.c | 4 ++++
 1 file changed, 4 insertions(+)
diff --git a/userdiff.c b/userdiff.c
index da75625020..d1d31ea67e 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -317,6 +317,10 @@ PATTERNS("python",
 	 "|[-+0-9.e]+[jJlL]?|0[xX]?[0-9a-fA-F]+[lL]?"
 	 "|[-+*/<>%&^|=!]=|//=?|<<=?|>>=?|\\*\\*=?"),
 	 /* -- */
+PATTERNS("r",
+	"^[ \t]*([a-zA-z][a-zA-Z0-9_.]*[ \t]*<-[ \t]*function.*)$",
+	/* -- */
+	"[a-zA-Z_][a-zA-Z0-9_.]*"),
 PATTERNS("ruby",
 	 "^[ \t]*((class|module|def)[ \t].*)$",
 	 /* -- */
-- 
2.43.0
Next: Rodrigo Carvalho
Message 1 of 9 in “userdiff: add support for R programming language”
  1. 1/2 userdiff: add support for R programming languageRodrigo Carvalho, May 25, 2025
  2. 2/2 t4018: add two userdiff tests for R languageRodrigo Carvalho, May 25, 2025
  3. Eric SunshineMay 25, 2025
  4. Johannes SixtMay 26, 2025
  5. Junio C HamanoMay 27, 2025
  6. Rodrigo CarvalhoMay 29, 2025
  7. userdiff: add support for R programming languageRodrigo Carvalho, May 29, 2025
  8. Junio C HamanoJun 3, 2025
  9. Johannes SixtJun 3, 2025

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.