From: Rodrigo Carvalho <rodrigorsdc@gmail.com>
To: git@vger.kernel.org
Cc: Rodrigo Carvalho <rodrigorsdc@gmail.com>
Subject: [PATCH 1/2] userdiff: add support for R programming language
Date: Sun, 25 May 2025 18:02:35 -0300 [thread overview]
Message-ID: <20250525210236.116342-1-rodrigorsdc@gmail.com> (raw)
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 reply other threads:[~2025-05-25 21:03 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-25 21:02 Rodrigo Carvalho [this message]
2025-05-25 21:02 ` [PATCH 2/2] t4018: add two userdiff tests for R language Rodrigo Carvalho
2025-05-25 22:42 ` Eric Sunshine
2025-05-26 5:57 ` [PATCH 1/2] userdiff: add support for R programming language Johannes Sixt
2025-05-27 15:04 ` Junio C Hamano
2025-05-29 21:36 ` Rodrigo Carvalho
2025-05-29 22:16 ` [PATCH v2] " Rodrigo Carvalho
2025-06-03 18:20 ` Junio C Hamano
2025-06-03 21:15 ` Johannes Sixt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250525210236.116342-1-rodrigorsdc@gmail.com \
--to=rodrigorsdc@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).