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

Document that the generated config is gitignored #11

Closed
wants to merge 1 commit into from
Closed

Document that the generated config is gitignored #11

wants to merge 1 commit into from

Conversation

spaze
Copy link

@spaze spaze commented Aug 1, 2019

Fix #10

@ondrejmirtes
Copy link
Member

Hi, sorry to let you wait for such a long time. I've had busy August :) I'd rather solve this properly than have an obscure description in the README :)

This package is heavily based on https://github.com/Ocramius/PackageVersions - it also has their generated file /src/PackageVersions/Versions.php in the .gitignore, but at the same time there's commited file in the repository: https://github.com/Ocramius/PackageVersions/blob/master/src/PackageVersions/Versions.php

Not sure how Git behaves in that scenario.

What would the consequences of removing our file from .gitignore be? I think the repo's Git repository isn't cloned to project vendor/ with stable release & --prefer-dist flag, right? So the additional file wouldn't show up anywhere in case the vendor/ isn't commited.

@spaze
Copy link
Author

spaze commented Sep 13, 2019

Hi, no problem, thanks to getting back at me. Hope you enjoyed your August (and I know you did 😊)

Agree this better be solved properly.

When there's a file in .gitignore, Git just refuses to start tracking the file (doc) but once tracked, Git "ignores" .gitignore. To put it simply, .gitignore lists paths that "shouldn't be added to repo" (as opposed to "shouldn't be in the repo"). Once added, Git will happily track those .gitgnore'd paths.

I think that Composer somehow works with .gitignore too but I don't know how exactly. I think that's also the reason why PackageVersions.php are both in the repo an in .gitignore - which in this case is used by Composer to not throw a warning (although I don't know which one right now, I'm just guessing by reading the message in the commit c36c32c), not by Git (because the file is already tracked).

I can run some experiments and do some code reading to see if that's the case but don't hold your breath, I have a busy September (though in a different way than you :-))

Thx.

@ondrejmirtes
Copy link
Member

So would the Ocramius way (force-add the generated file skeleton and add it to .gitignore) actually solve the problem for you? So it would pop up when you want to commit the vendor/ directory?

I'm willing to experiment it in the way that if we agree on something, I'll do it, release it and wait for feedback from users :)

@spaze
Copy link
Author

spaze commented Sep 13, 2019

Tightening the feedback loop, you really mean it :-)

I didn't know that PackageVersions.php is listed in .gitignore and the stub tracked in the repo until today (and I have it in the repo as an indirect dependency), so I guess it would solve it, yeah.

@ondrejmirtes
Copy link
Member

Alright, let's hope this isn't catastrophic :) Just released as 1.0.2.

@spaze
Copy link
Author

spaze commented Sep 14, 2019

Thanks!

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

Successfully merging this pull request may close these issues.

The installer doesn't add the generated config to Git
2 participants