git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [almost-patch] Add diff regular expressions for Markdown and Zshell
@ 2020-02-25 13:56 Sebastian Gniazdowski
  0 siblings, 0 replies; only message in thread
From: Sebastian Gniazdowski @ 2020-02-25 13:56 UTC (permalink / raw)
  To: git

Hi.
Git comes with a few of the diff-regexes built-in. They are listed
here: https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header

I'm a Zsh plugin creator and I've found the following regexes to be useful:

- Zshell function-matching:
    xfuncname =
"^((function[[:blank:]]+[^[:blank:]]+[[:blank:]]*(\\(\\)|))|([^[:blank:]]+[[:blank:]]*\\(\\)))[[:blank:]]*(\\{|)[[:blank:]]*$"

- Markdown hading-matching:
    xfuncname = "^#+[[:blank:]].*$"

Could those regexes be added to the built-in set? I think that they're
extremely useful and shipping them with Git would lift the requirement
of having them in each .gitconfig on each machine – particularly
useful for e.g.: receiving bug-reports from Zsh-plugin users, that may
have the patterns not set up.

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zinit
Blog: http://zdharma.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-25 13:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-25 13:56 [almost-patch] Add diff regular expressions for Markdown and Zshell Sebastian Gniazdowski

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).