Repository navigation
Using core.whitespace fix in git #11412
Description
Activity
- addedmetaIssues and PRs related to the general management of the project.Issues and PRs related to the general management of the project.
on Feb 16, 2017 I think you can also set these per-repo. Is it possible that
.gitattributesor similar could store this?I do think it is worthwhile to still suggest people enable the whitespace fixer globally. Not sure about altering
git diff, etc.@Fishrock123 what I'm saying is I don't think
core.whitespace fixactually does anything, I think it's just a wrong option. I think the option should beapply.whitespace fix.I'm pretty sure this stuff has to go in
.git/configif it's local, so I don't think we could store it.Let's drop that recommendation, we already recommend
--whitespace=fixwhen landing:https://github.com/nodejs/node/blob/master/COLLABORATOR_GUIDE.md#technical-howto
Regarding
diff.wsErrorHighlight: I'm not sure we should make any more recommendations. There's a lot one could recommend for git, and most of these options are personal preference. For example, I auto-trim trailing whitespace in the editor, so it will never be visible in a diff.I can confirm that option
core.whitespace fixis not doing for an unpatched git. Given that it is not documented in https://git-scm.com/docs/git-config it is not surprising.PR #12445 removes this misleading instruction
I think I'd rather just correct the option name rather than remove it. The less explicit parameters needed the better IMHO.
Reacted by Benjamin Gruenbaum and Gibson FahnestockI think the option should be apply.whitespace fix.
According to docs it is used only on applying patch. Is it useful/intended result of this instruction?
Reacted by Gibson Fahnestock- added a commit that references this issue
on Apr 18, 2017 - added a commit that references this issue
on Apr 25, 2017 #12445 landed, I think this can be closed now. Feel free to re-open if I’m wrong.
Reacted by Gibson Fahnestock- added a commit that references this issue
on May 16, 2017 - added a commit that references this issue
on May 18, 2017 - added a commit that references this issue
on Jul 19, 2017
We recommend using
git config --global --add core.whitespace fixin doc/onboarding.md, but I can't find any mention of that setting in the git docs. There is acore.whitespace, but it doesn't seem to have a fix option. However,apply.whitespacedoes, see the apply docs.I think what we need is
git config --global --add apply.whitespace fix. Note that this only fixes whitespace when you apply a patch. Rebase has a whitespace option as well, but it's apparently incompatible with--interactive, so I'm not sure if we should use it.We might also consider suggesting
git config --global diff.wsErrorHighlight all, which makesgit diffandgit showhighlight whitespace errors (see docs).cc/ @Fishrock123 (from git blame)