InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

Remove defunct .gitconfig file

Open madmini opened this issue 1 year ago • 2 comments

The .gitconfig is not actually used by git unless manually configured to do so. The repo-specific git config is located in .git/config. The only .gitconfig file read by git is the one in the user home directory. See git config docs and the answers to this stackoverflow question.

I believe it is misleading to have this file in the repo as it implies the config is automatically applied. I for one have wasted a lot of time trying to fix the .gitconfig file before I realized this and came up with #2077 instead.

If I am mistaken and the .gitconfig file represents recommendations for contributors or similar then I strongly recommend to have this reflected somewhere in the docs, or noted as a comment in the defunct .gitconfig file.

madmini avatar Jun 14 '24 18:06 madmini

The options, as outlined in #191 should probably be added to the docs. #2077 should take care of line endings.

madmini avatar Jun 14 '24 18:06 madmini

Build size and comparison to main:

Section Size Difference
text 373088B 0B
data 948B 0B
bss 22536B 0B

Run in InfiniEmu

github-actions[bot] avatar Jun 14 '24 18:06 github-actions[bot]

Agreed, it makes sense to move it into the docs. I think it'd make sense to move it and remove the file at the same time (otherwise it might get forgotten about), would you be able to move it into the docs as part of this PR? If you don't have the time that's no problem, I'll try get round to it at some point.

Sorry for the glacial review :(

mark9064 avatar Feb 12 '25 00:02 mark9064

I have added git config set ... to "Clone the repo" steps in the docs. Not sure if this is enough and/or the right place.

I have considered adding a bullet point to the "PR checklist" in CONTRIBUTING.md:

  • Configure Git to automatically fix whitespace issues:

    git config set core.whitespace trailing-space,space-before-tab
    git config set apply.whitespace fix
    

but this seems a bit out of place.

madmini avatar Feb 12 '25 08:02 madmini

whitespace = blank-at-eol,blank-at-eof,space-before-tab is the default

ah, I missed this. for some reason I believed that one of them was not default.

bad whitespace in general will be caught by clang-format, so CI will fail

I assume clang-format will only format C files? Then python scripts and other stuff require extra attention. But yes, I think this is the way to go.

I suspect most people are using editors which strip whitespace anyway

yes

I don't think anybody really knows about the .gitconfig

certainly not me before googling for this PR 😅

What do you think?

I have not yet seen many projects that make recommendations for git config and I think my current way to put it in the docs (add git config ... to any git clone ... instructions) is weird and prone to be ignored. If you want standards to be enforced, then check them in CI, as you do. So as the settings are the default anyway AND for C code its checked in CI AND its weird, I'm with you on just removing it.

I'll add a revert commit, just squash it ^^

madmini avatar Feb 14 '25 08:02 madmini