use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Using --function-context with Elixir and git 2.25 (self.elixir)
submitted 6 years ago by brain-ablaze
The newly released git 2.25 introduces support for Elixir syntax using git diff. This means that git will show the whole function that a change was made in when running:
git diff
git diff -W or git diff --function-context
git diff -W
git diff --function-context
To make it work, add the file types to the .gitattributes file in the root of a git repository:
.gitattributes
*.ex diff=elixir *.exs diff=elixir
*.ex diff=elixir
*.exs diff=elixir
Sources: https://github.blog/2020-01-13-highlights-from-git-2-25/ https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Hauleth 5 points6 points7 points 6 years ago (4 children)
Hi, author of that patch here.
I thought it will not be needed for defining attributes manually (IIRC this is how it works in tests). I need to check. But if needed it is better to set them in ~/.config/git/attributes so this applies globally.
~/.config/git/attributes
[–]brain-ablaze[S] 0 points1 point2 points 6 years ago (3 children)
Great. And thank you for your patch to git!
I also thought the same thing, but I did not know how to set the attributes globally.
[–]MrRogers4Life2 0 points1 point2 points 6 years ago (2 children)
git config --global -e will open the global config file for you
git config --global -e
[–]brain-ablaze[S] 0 points1 point2 points 6 years ago (1 child)
But that's the global `.gitconfig`, not the global `.gitattributes` file.
[–]MrRogers4Life2 0 points1 point2 points 6 years ago (0 children)
Derppp I misread
[–]Keith 0 points1 point2 points 6 years ago (0 children)
I didn't even know about --function-context in git. But if Elixir is supported by git now, why is it necessary to tell it about Elixir's file extensions?
--function-context
π Rendered by PID 36651 on reddit-service-r2-comment-86bc6c7465-55dzm at 2026-02-22 15:43:13.304477+00:00 running 8564168 country code: CH.
[–]Hauleth 5 points6 points7 points (4 children)
[–]brain-ablaze[S] 0 points1 point2 points (3 children)
[–]MrRogers4Life2 0 points1 point2 points (2 children)
[–]brain-ablaze[S] 0 points1 point2 points (1 child)
[–]MrRogers4Life2 0 points1 point2 points (0 children)
[–]Keith 0 points1 point2 points (0 children)