Page MenuHomeVyOS Platform

git/github: Adjust configuration for safe and baseline defaults
Closed, ResolvedPublic

Description

We can apply certain safe and baseline defaults for .gitattributes(and .vscode/settings.json) for VyOS repositories on GitHub for improved developer experience.

These are mostly about aesthetics and are completely optional and don't affect VyOS operation in any way.

These .gitattrbutes settings are based on

While on this, we can also adjust some of the VSCode settings (.vscode/settings.json) by removing the editor-agnostic ones (that would already be available in .gitattributes), and overriding the editor defaults selectively.

Note to developers:

  1. Since this PR affects the line-endings of files, once this PR is applied, one might need to reset the local git working tree from the local git index (after necessary care to stash or temporarily commit the local changes) by performing the following operations in the working directory:
git rm -rf --cached .
git reset --hard HEAD

GitHub article has more details on this.

  1. In case there are local files that are "in flight" and haven't been applied upstream yet, performing the following operation on the working directory would normalize the line endings:
g add --renormalize .
git status          # Show files that will be normalized
git diff | cat -v   # Show the changes with the lin-endings (just to make sure)
git commit -m "<incoming commit message>"

Details

Difficulty level
Unknown (require assessment)
Version
1.4, 1.5
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Perfectly compatible
Issue type
Infrastructure issue or change

Event Timeline

indrajitr created this object in space S1 VyOS Public.
indrajitr updated the task description. (Show Details)