nhs-england-tools/dotfiles

ENG-253: Include default .git* files

Closed this issue · 6 comments

Files to incorporate in the PR

Does this suggest we're largely agreeing to select/merge templates rather than bootstrap with a standard .gitignore that works for our template repos? It would be nice for there to be one less thing to "select", if we have already picked a template repository.

Good question. I think we should do both.

We could include in our .gitignore suitable content in such a way that it also becomes a self-documenting pattern that can help to extend it when needed.

For example, we could have:

[ A list of non-standard rules, if any]

# ------------------------------------------------------------------------------
# Source: https://github.com/github/gitignore/blob/main/Global/Linux.gitignore

[ Copy & paste the Linux.gitignore content here ]

# ------------------------------------------------------------------------------
# Source: https://github.com/github/gitignore/blob/main/Global/macOS.gitignore

[ Copy & paste the macOS.gitignore content here ]

# ------------------------------------------------------------------------------
# Source: https://github.com/github/gitignore/blob/main/Global/Windows.gitignore

[ Copy & paste the Windows.gitignore content here ]

A few suggestions -

  • .gitignore content per section is copied exactly
  • Source file URL address is named explicitly
  • Sections are ordered alphabetically (ish)
  • Only OS-specific rules are included, for now

Similarly, for .gitattributes we could start with the Common.gitattributes file. In addition to that, we could leave a note at the top of that file on how the linguist-generated=true, linguist-language=?, linguist-vendored etc. attributes are used, See https://github.com/github/linguist. Almost every project I worked on contained a set of pre-generated test data, in some cases in a significant amount, which made the language stats look peculiar.

I understand the desire to have something universal templated, but I've always felt that OS and IDE specific rules don't belong in the project level .gitignore and should instead always be handled globally based on the contributor's own preferences.

@Judge40 I think you made a very valid point. These three files I gave as an example belong rather to the .dotfiles. Watch this space!

The content of .gitignore and .gitattributes files varies depending on the specific project. What we are building here is a generic template. But let's keep the above principle as we will expand on it when we move to Java, Python etc. tech stacks.

What I would propose then is to have the content of these files defined as the simplest thing that we can have now, but with intent on how to use them:

.gitignore

# TODO: https://github.com/github/gitignore

.gitattributes

# TODO: https://github.com/github/linguist/blob/master/docs/overrides.md#using-gitattributes

# TODO: https://github.com/alexkaratarakis/gitattributes

test comment to see if I can be assigned