Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Git diffs #9823

Merged
merged 1 commit into from
Feb 17, 2020
Merged

Better Git diffs #9823

merged 1 commit into from
Feb 17, 2020

Conversation

hauleth
Copy link
Contributor

@hauleth hauleth commented Feb 16, 2020

In Git 2.25 there comes native support for Elixir definitions. That will
make git diff --function-context work properly. Additionally it makes
diff headers to contain name of enclosing function.

I hope that this will work in GitHub diffs as well.

In Git 2.25 there comes native support for Elixir definitions. That will
make `git diff --function-context` work properly. Additionally it makes
diff headers to contain name of enclosing function.

I hope that this will work in GitHub diffs as well.
@michalmuskala
Copy link
Member

Would it make sense to generate a .gitattributes file when generating a new project, similar to .gitignore?

@hauleth
Copy link
Contributor Author

hauleth commented Feb 16, 2020

@michalmuskala I would rather document such thing and encourage people to add it to their own global Git configuration:

$ mkdir -p ~/.config/git
$ printf '*.ex diff=elixir\n*.exs diff=elixir\n' >> ~/.config/git/attributes

@michalmuskala
Copy link
Member

Makes sense. Given I know nothing about how git attributes work - why wouldn't that be a default now that git has this support? Is there some conflict on the extensions?

@hauleth
Copy link
Contributor Author

hauleth commented Feb 16, 2020

Because Git do not support default attributes for any files at all. It would be big change in Git to provide defaults and I do not have time to go through that right now.

TL;DR there is no "default" attributes in Git, everything uses the same and user can define them on their own

@michalmuskala
Copy link
Member

Makes sense. Thank you for explaining.

@fertapric fertapric merged commit a188258 into elixir-lang:master Feb 17, 2020
@fertapric
Copy link
Member

Thanks @hauleth! 💜

github-actions bot pushed a commit to kphrx/pleroma that referenced this pull request Feb 17, 2020
@hauleth hauleth deleted the ft/better-git-diffs branch March 9, 2020 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants