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

Proposal: Sort '!' to the bottom of the gitignore file, so inclusions are more important than exclusions #626

Open
constant-flow opened this issue Sep 21, 2023 · 0 comments

Comments

@constant-flow
Copy link

constant-flow commented Sep 21, 2023

Issue

The unity and visual studio templates conflict with each other in the sense that unity relies heavily on *.meta files when versioned and VS is excluding these files. Both solutions are used alongside very often, so they should be matched to work together.

You say now: This sounds like a template issue, you are right, but I'd propose an improvement to this tool.

For example:
This tool could check if the one is having a !*.meta where the other is having a *.meta (unfortunately unity's template doesn't use this notation yet)

Expected Behavior:

Either

  • Give info where the templates conflict, give users a chance to select which rule is active or inactive.
    e.g. track *.meta or ignore *.meta
  • OR (even better solution) automatically see the ! listed items as more important as the exclusion, so basically sorting all the sections (all items listed under a # section) containing ! items to the bottom of the generated file (order in .gitignore matters)

so for example, this whole section should go to the end of the generated gitignore file

# Unity3D generated meta files (include & exclude)
!*.meta
*.pidb.meta
*.pdb.meta
*.mdb.meta

Actual Behavior:

  • stapling files together, order in list will define who wins the fight over inclusion or exclusion

Reproduction Steps:

  • generate a file with unity and visualstudio together --> will exclude *.meta files
  • even if unity would include a !*.meta file, the order would decide which on wins (inc/exc)
@constant-flow constant-flow changed the title Proposal: Sort '!' to the bottom of the gitignore file, so inclusions are Proposal: Sort '!' to the bottom of the gitignore file, so inclusions are more important than exclusions Sep 21, 2023
constant-flow added a commit to constant-flow/gitignore that referenced this issue Sep 21, 2023
gitignore template of visualstudio is excluding meta file

a proposal like in this issue could make use of the inclusion phrases to make generated gitignore files more usable: toptal/gitignore.io#626
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

No branches or pull requests

1 participant