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

.gitattributes with macros in workspace subfolder #1334

Open
benblo opened this issue May 24, 2024 · 0 comments
Open

.gitattributes with macros in workspace subfolder #1334

benblo opened this issue May 24, 2024 · 0 comments

Comments

@benblo
Copy link

benblo commented May 24, 2024

I have a monorepo where each workspace has a .gitattributes in its own subfolder:

monorepo:

  • shared/
  • workspaces/A/
    • .gitattributes
    • contentA/
  • workspaces/B/
    • .gitattributes
    • contentB/

becomes workspace-A:

  • .gitattributes
  • contentA/
  • shared/

Problem: those gitattributes files define custom macros, which are only allowed in top-level gitattributes files, so in the main monorepo, I'm getting warnings like this:

[attr]unity_yaml -text merge=unityyamlmerge diff eol=lf not allowed: Workspace/Cartographer/.gitattributes:54

One workaround I can think of is to rename those to eg josh.gitattributes in the main repo, then rename them back in the filter. It feels icky though, those attributes wouldn't then be processed at the monorepo level.

Another idea would be to define the macros in a separate file, sitting at the root (it would make sense to share the macros anyway, though I can imagine there would be exceptions down the line), then somehow reference those in the per-workspace gitattributes... I don't know how to do that though 😅.

Has anyone run into this? Ideas?

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