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

Avoid to rewrite .git files on environment initialization #33

Closed
cetver opened this issue May 20, 2015 · 7 comments
Closed

Avoid to rewrite .git files on environment initialization #33

cetver opened this issue May 20, 2015 · 7 comments
Assignees
Labels
type:enhancement Enhancement
Milestone

Comments

@cetver
Copy link

cetver commented May 20, 2015

If environment directory placed on different git repository initialization script trying to rewrite it:

Start initialization ...

  unchanged yii
   generate .git/COMMIT_EDITMSG
  unchanged .git/info/exclude
      exist .git/FETCH_HEAD
            ...overwrite? [Yes|No|All|Quit]

Fix:
rewrite https://github.com/yiisoft/yii2-app-advanced/blob/master/init#L94 to

if ($path === '.git' || $path === '.svn' || $path === '.' || $path === '..') {
@samdark samdark self-assigned this May 20, 2015
@lav45
Copy link

lav45 commented May 21, 2015

And what makes .git in your environments folder ?

@cetver
Copy link
Author

cetver commented May 21, 2015

Some developers don't have access to production settings. In GIT you can't revoke access from selected directory only for repository. For this environment directory placed in another GIT repository.

@lav45
Copy link

lav45 commented May 21, 2015

in this case it is better to use the

glob(__DIR__ . '/*'); 

in place readdir()

@samdark samdark modified the milestone: 2.0.5 May 23, 2015
@samdark
Copy link
Member

samdark commented May 25, 2015

Decided not to change it in app template. It's quite specific case and could be adjusted manually if needed.

@samdark samdark closed this as completed May 25, 2015
@cetver
Copy link
Author

cetver commented May 27, 2015

Strange decision, "svn" is also quite specific case (not all projects used SVN as VCS), but it skipped.

@samdark samdark reopened this May 27, 2015
@samdark
Copy link
Member

samdark commented May 27, 2015

Oh, I was thinking about something totally diffrent :)

@samdark
Copy link
Member

samdark commented May 27, 2015

Fix applied. Thanks!

@samdark samdark reopened this May 27, 2015
@samdark samdark closed this as completed May 27, 2015
@samdark samdark added this to the 2.0.5 milestone May 27, 2015
@samdark samdark added the type:enhancement Enhancement label May 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants