<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t4018/bash-posix-style-single-command-function, branch main</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=main</id>
<link rel='self' href='https://git.shady.money/git/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2025-05-16T18:52:41Z</updated>
<entry>
<title>userdiff: extend Bash pattern to cover more shell function forms</title>
<updated>2025-05-16T18:52:41Z</updated>
<author>
<name>Moumita Dhar</name>
<email>dhar61595@gmail.com</email>
</author>
<published>2025-05-16T14:45:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ea8a71b40d3fdc91180b951c829cdf41bb6f7da0'/>
<id>urn:sha1:ea8a71b40d3fdc91180b951c829cdf41bb6f7da0</id>
<content type='text'>
The previous function regex required explicit matching of function
bodies using `{`, `(`, `((`, or `[[`, which caused several issues:

- It failed to capture valid functions where `{` was on the next line
  due to line continuation (`\`).
- It did not recognize functions with single  command body, such as
  `x () echo hello`.

Replacing the function body matching logic with `.*$`, ensures
that everything on the function definition line is captured.

Additionally, the word regex is refined to better recognize shell
syntax, including additional parameter expansion operators and
command-line options.

Signed-off-by: Moumita Dhar &lt;dhar61595@gmail.com&gt;
Acked-by: Johannes Sixt &lt;j6t@kdbg.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
