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

Gitfiles #7

Merged
merged 2 commits into from
Apr 6, 2020
Merged

Gitfiles #7

merged 2 commits into from
Apr 6, 2020

Conversation

ac000
Copy link
Contributor

@ac000 ac000 commented Apr 4, 2020

Hi,

A couple of small additions.

  1. Add editor (and others) temporary files to .gitignore, this covers VIM and numerous other editors and utilities.

  2. Add a .gitattributes file to set the diff driver for C source files to ensure functions names are printed right in diff output.

Cheers,
Andrew

'*.swp' for VIM & '*~' for various.
Git can be told to apply language-specific rules when generating diffs.

Enable this for C source code files (*.c and *.h) so that function names
are printed right. Specifically, doing so prevents "git diff" from
mistakenly considering unindented goto labels as function names.

This has the same effect as adding

    [diff "default"]
        xfuncname = "^[[:alpha:]$_].*[^:]$"

to your git config file.

e.g get

    @@ -10,7 +10,7 @@ int main(void)

instead of

    @@ -10,7 +10,7 @@ again:

This makes use of the gitattributes(5) infrastructure by adding a
.gitattributes file.
@TimeToogo TimeToogo merged commit de02251 into TimeToogo:master Apr 6, 2020
@TimeToogo
Copy link
Owner

Merged, thanks for the contribution :)

@ac000 ac000 deleted the gitfiles branch April 7, 2020 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants