WebAppCommand: git and hg support improvement #1212

Closed
resurtm opened this Issue Aug 12, 2012 · 14 comments

Comments

Projects
None yet
5 participants
@resurtm
Contributor

resurtm commented Aug 12, 2012

WebAppCommand has the feature to generate application structure with Git and Mercurial support. Support of the VCS means, that application generator creates appropriate .gitkeep/.gitignore and .hgignore/.hgkeep files (in purpose of forcing to store some empty important directories and ignoring temporary/cache unnecessary files). Unfortunately this command is generating not all the needed files—there are some missing .gitignore and .hgignore files (e.g. missing main .gitignore file in the root of the project which should ignore tracking of the framework distribution directory).

@resurtm

This comment has been minimized.

Show comment
Hide comment
@resurtm

resurtm Aug 12, 2012

Contributor

Feature was developed by me. Working on solution.

Contributor

resurtm commented Aug 12, 2012

Feature was developed by me. Working on solution.

@DaSourcerer

This comment has been minimized.

Show comment
Hide comment
@DaSourcerer

DaSourcerer Sep 10, 2012

Contributor

I was wondering: Would it be possible to mark the yii framework folder as a git submodule?

Contributor

DaSourcerer commented Sep 10, 2012

I was wondering: Would it be possible to mark the yii framework folder as a git submodule?

@resurtm

This comment has been minimized.

Show comment
Hide comment
@resurtm

resurtm Sep 16, 2012

Contributor

@DaSourcerer, that's the reasonable proposal. I will investigate possibility of this.

Contributor

resurtm commented Sep 16, 2012

@DaSourcerer, that's the reasonable proposal. I will investigate possibility of this.

@cebe

This comment has been minimized.

Show comment
Hide comment
@cebe

cebe Sep 16, 2012

Member

Adding framework as Submodule is only possible if yii framework directory is checked out as a git repo (not downloaded source) and it resides inside the directory structure of the newly created application. We also need to make sure the newly created application directory is a git repo which leads to too many options and a huge amount of guessing and checking. Don't think this is a useful thing as one could do the same thing with native git commands, knowing what he will get except having to read and understand documentation of our command that wraps those 2 commands hiding possible individual options.

Member

cebe commented Sep 16, 2012

Adding framework as Submodule is only possible if yii framework directory is checked out as a git repo (not downloaded source) and it resides inside the directory structure of the newly created application. We also need to make sure the newly created application directory is a git repo which leads to too many options and a huge amount of guessing and checking. Don't think this is a useful thing as one could do the same thing with native git commands, knowing what he will get except having to read and understand documentation of our command that wraps those 2 commands hiding possible individual options.

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Sep 16, 2012

Member

What about git subtree?

Member

samdark commented Sep 16, 2012

What about git subtree?

@cebe

This comment has been minimized.

Show comment
Hide comment
@cebe

cebe Sep 17, 2012

Member

I don't think we should wrap git functionality in application command. The command gets over complicated and additional options are not possible.
Creating a new app with yii as submodule and git repo just works like this:

mkdir new-app
cd new-app
git init
git submodule add https://github.com/yiisoft/yii.git yii
./yii/framework/yiic webapp ./

imo there is no need to wrap anything.

Member

cebe commented Sep 17, 2012

I don't think we should wrap git functionality in application command. The command gets over complicated and additional options are not possible.
Creating a new app with yii as submodule and git repo just works like this:

mkdir new-app
cd new-app
git init
git submodule add https://github.com/yiisoft/yii.git yii
./yii/framework/yiic webapp ./

imo there is no need to wrap anything.

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Sep 17, 2012

Member

I agree. Moreover, if you don't know what sumbodules are it can harm.

Closing this one.

Member

samdark commented Sep 17, 2012

I agree. Moreover, if you don't know what sumbodules are it can harm.

Closing this one.

@samdark samdark closed this Sep 17, 2012

@cebe

This comment has been minimized.

Show comment
Hide comment
@cebe

cebe Sep 17, 2012

Member

@samdark this issues wasn't about what was discussed recently, @resurtm created it to remember to rework this feature as is is not complete.

Member

cebe commented Sep 17, 2012

@samdark this issues wasn't about what was discussed recently, @resurtm created it to remember to rework this feature as is is not complete.

@cebe cebe reopened this Sep 17, 2012

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Sep 17, 2012

Member

Ah, OK.

Member

samdark commented Sep 17, 2012

Ah, OK.

@DaSourcerer

This comment has been minimized.

Show comment
Hide comment
@DaSourcerer

DaSourcerer Sep 17, 2012

Contributor

Heh, this has really been a question out of pure curiosity. Didn't expect that much criticism.

What gave me the idea was that this would allow rapid and uncomplicated framework upgrades on projects. Since the webapp command already does some prep work for git, I thought it weren't that far-fetched to add this functionality to the webapp command itself. The only question that remained to me was whether the webapp command could do that without invoking git itself. IIRC, git submodule add doesn't check anything out.

@cebe, @samdark: Could it be worth to add a section to the Yii guide concerning this? I do not think all people working with git are aware of git modules.

Contributor

DaSourcerer commented Sep 17, 2012

Heh, this has really been a question out of pure curiosity. Didn't expect that much criticism.

What gave me the idea was that this would allow rapid and uncomplicated framework upgrades on projects. Since the webapp command already does some prep work for git, I thought it weren't that far-fetched to add this functionality to the webapp command itself. The only question that remained to me was whether the webapp command could do that without invoking git itself. IIRC, git submodule add doesn't check anything out.

@cebe, @samdark: Could it be worth to add a section to the Yii guide concerning this? I do not think all people working with git are aware of git modules.

@cebe

This comment has been minimized.

Show comment
Hide comment
@cebe

cebe Sep 17, 2012

Member

@DaSourcerer this is worth a seperate issue, created one: #1418

Member

cebe commented Sep 17, 2012

@DaSourcerer this is worth a seperate issue, created one: #1418

@resurtm

This comment has been minimized.

Show comment
Hide comment
@resurtm

resurtm Sep 26, 2012

Contributor

I wonder how the release preparation happening. I've compared two directories (click for zoom):

The left window shows content of the protected/runtime directory of the web application generator template in the current git version, while the right one shows content of the same directory but in the 1.1.12 release codebase.

.gitignore is used by Yii's git repository, so it should be removed before preparing public Yii zipball/tarball. But git.gitignore and hg.hgignore should be left as is because they're used by WebAppCommand.

It follows that bug is in the packaging scripts/system, but not in the codebase. Preparation scripts removes files called git.gitignore. It is definitely wrong behavior.

Contributor

resurtm commented Sep 26, 2012

I wonder how the release preparation happening. I've compared two directories (click for zoom):

The left window shows content of the protected/runtime directory of the web application generator template in the current git version, while the right one shows content of the same directory but in the 1.1.12 release codebase.

.gitignore is used by Yii's git repository, so it should be removed before preparing public Yii zipball/tarball. But git.gitignore and hg.hgignore should be left as is because they're used by WebAppCommand.

It follows that bug is in the packaging scripts/system, but not in the codebase. Preparation scripts removes files called git.gitignore. It is definitely wrong behavior.

@ghost ghost assigned cebe Sep 26, 2012

@samdark

This comment has been minimized.

Show comment
Hide comment
@samdark

samdark Sep 26, 2012

Member

@qiangxue can you comment on this one?

Member

samdark commented Sep 26, 2012

@qiangxue can you comment on this one?

@qiangxue

This comment has been minimized.

Show comment
Hide comment
@qiangxue

qiangxue Sep 26, 2012

Member

This could be caused by the phing config: build/build.xml

If you look at the definition of 'framework' fileset, you will find it excludes **/.gitignore. Not sure why this would exclude git.gitignore.

Member

qiangxue commented Sep 26, 2012

This could be caused by the phing config: build/build.xml

If you look at the definition of 'framework' fileset, you will find it excludes **/.gitignore. Not sure why this would exclude git.gitignore.

@samdark samdark closed this in b37498d Sep 27, 2012

samdark added a commit that referenced this issue Sep 27, 2012

Merge pull request #1482 from resurtm/1212-webapp-git-hg
[ci skip] Fixes #1212: Added missing .gitignore files to the application generated by WebAppCommand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment