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

project-gen project should add .gitkeep files to empty directories #1717

Closed
postmodern opened this Issue Jul 11, 2014 · 16 comments

Comments

Projects
None yet
4 participants
@postmodern
Contributor

postmodern commented Jul 11, 2014

In order to ensure the tmp/ and log/ directories persist across deploys/gemification, .gitkeep or .keep files should be added to them.

@namusyaka

This comment has been minimized.

Show comment
Hide comment
@namusyaka

namusyaka Jul 12, 2014

Member

What do you think about other empty directories (public/javascripts, public/stylesheets etc)?

Member

namusyaka commented Jul 12, 2014

What do you think about other empty directories (public/javascripts, public/stylesheets etc)?

@namusyaka namusyaka added this to the 0.12.3 milestone Jul 12, 2014

@postmodern

This comment has been minimized.

Show comment
Hide comment
@postmodern

postmodern Jul 12, 2014

Contributor

If the app can function without the empty dirs, I suppose it's acceptable to omit them.

Contributor

postmodern commented Jul 12, 2014

If the app can function without the empty dirs, I suppose it's acceptable to omit them.

@namusyaka

This comment has been minimized.

Show comment
Hide comment
@namusyaka

namusyaka Jul 12, 2014

Member

I tried to implement.
Could you please confirm?

Member

namusyaka commented Jul 12, 2014

I tried to implement.
Could you please confirm?

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Jul 12, 2014

Member

I can understand tmp/.gitkeep and log/.gitkeep because some servers fail without these folders, but I really don't like those files in my controllers, helpers and other optional folders.

Member

ujifgc commented Jul 12, 2014

I can understand tmp/.gitkeep and log/.gitkeep because some servers fail without these folders, but I really don't like those files in my controllers, helpers and other optional folders.

@namusyaka

This comment has been minimized.

Show comment
Hide comment
@namusyaka

namusyaka Jul 12, 2014

Member

Why do you hate these files?
These files are created in the same way as rails project.
If these files don't exist, the directory means to be ignored by the scm.

Member

namusyaka commented Jul 12, 2014

Why do you hate these files?
These files are created in the same way as rails project.
If these files don't exist, the directory means to be ignored by the scm.

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Jul 12, 2014

Member

They are ignored because they are empty. They contain no data and have no purpose. Creating of non-empty workaround 'tmp' and 'log' folders is acceptable, but it's still a workaround for broken web servers.

Member

ujifgc commented Jul 12, 2014

They are ignored because they are empty. They contain no data and have no purpose. Creating of non-empty workaround 'tmp' and 'log' folders is acceptable, but it's still a workaround for broken web servers.

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Jul 12, 2014

Member

Is it considered a good practice to gemify or deploy empty folders?

Member

ujifgc commented Jul 12, 2014

Is it considered a good practice to gemify or deploy empty folders?

@postmodern

This comment has been minimized.

Show comment
Hide comment
@postmodern

postmodern Jul 12, 2014

Contributor

If the directories are required by the program/app, then they should be in the SCM/package. Also, the user who owns the deployed/installed app might not be the same user who runs the app.

Contributor

postmodern commented Jul 12, 2014

If the directories are required by the program/app, then they should be in the SCM/package. Also, the user who owns the deployed/installed app might not be the same user who runs the app.

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Jul 12, 2014

Member

Well, padrino apps require none of these folders.

Member

ujifgc commented Jul 12, 2014

Well, padrino apps require none of these folders.

@postmodern

This comment has been minimized.

Show comment
Hide comment
@postmodern

postmodern Jul 12, 2014

Contributor

Hmm good point. I suppose that puts the responsibility on the server or the deployment process. The server can't always auto-create these directories, since it might not have write permission to the app's directory. That leaves the deployment process. If you are deploying via git/ssh, then you either have to add the .keep files manually or touch them in your deploy.sh script.

Contributor

postmodern commented Jul 12, 2014

Hmm good point. I suppose that puts the responsibility on the server or the deployment process. The server can't always auto-create these directories, since it might not have write permission to the app's directory. That leaves the deployment process. If you are deploying via git/ssh, then you either have to add the .keep files manually or touch them in your deploy.sh script.

@ujifgc

This comment has been minimized.

Show comment
Hide comment
@ujifgc

ujifgc Jul 12, 2014

Member

I understand that and I can agree that it's quite useful to initialize with keep files in tmp and log folders since its extremely common to write in those by middleware (tmp) or web server (log). My arguing is not on the original issue but on the related PR.

Member

ujifgc commented Jul 12, 2014

I understand that and I can agree that it's quite useful to initialize with keep files in tmp and log folders since its extremely common to write in those by middleware (tmp) or web server (log). My arguing is not on the original issue but on the related PR.

@skade

This comment has been minimized.

Show comment
Hide comment
@skade

skade Jul 12, 2014

Member

I'm split here. I often run into the problem that e.g. Capistrano doesn't attempt to create those folders, but needs them to set the correct symlinks.

As @ujifgc says, padrino doesn't need those folders and there are multiple parties that can be expected to set them up and make sure to keep them around (the framework generator, the deployment system, the user). As Padrino expects the users to be competent with their stacks, I think better documentation is necessary here. (BTW, the doc team starts on monday ;))

Also, I have to be a bit nitpicky: this is a git problem, not an SCM problem. Most SCMs track empty folders.

Member

skade commented Jul 12, 2014

I'm split here. I often run into the problem that e.g. Capistrano doesn't attempt to create those folders, but needs them to set the correct symlinks.

As @ujifgc says, padrino doesn't need those folders and there are multiple parties that can be expected to set them up and make sure to keep them around (the framework generator, the deployment system, the user). As Padrino expects the users to be competent with their stacks, I think better documentation is necessary here. (BTW, the doc team starts on monday ;))

Also, I have to be a bit nitpicky: this is a git problem, not an SCM problem. Most SCMs track empty folders.

@namusyaka

This comment has been minimized.

Show comment
Hide comment
@namusyaka

namusyaka Jul 12, 2014

Member

Yeah, there is no room for doubt about necessity of log and tmp directories. And I know, Padrino doesn't require these files. The generator creates files recursively.
BTW, why does the generator create empty directories such as controller and helpers?
I've thought that it is a thing to assert the existence as a template.

Member

namusyaka commented Jul 12, 2014

Yeah, there is no room for doubt about necessity of log and tmp directories. And I know, Padrino doesn't require these files. The generator creates files recursively.
BTW, why does the generator create empty directories such as controller and helpers?
I've thought that it is a thing to assert the existence as a template.

@namusyaka

This comment has been minimized.

Show comment
Hide comment
@namusyaka

namusyaka Jul 12, 2014

Member

this is a git problem, not an SCM problem. Most SCMs track empty folders.

@skade I didn't know. Thank you for letting me know!

Member

namusyaka commented Jul 12, 2014

this is a git problem, not an SCM problem. Most SCMs track empty folders.

@skade I didn't know. Thank you for letting me know!

@skade

This comment has been minimized.

Show comment
Hide comment
@skade

skade Jul 12, 2014

Member

BTW, why does the generator create empty directories such as controller and helpers?

To make sure that users don't forget that that's where the respective files should end up.

Member

skade commented Jul 12, 2014

BTW, why does the generator create empty directories such as controller and helpers?

To make sure that users don't forget that that's where the respective files should end up.

@namusyaka

This comment has been minimized.

Show comment
Hide comment
@namusyaka

namusyaka Jul 13, 2014

Member

I've just modified the PR.
The arguing should be continued, but I thought the decision should only be committed in the PR for the time being.
Everyone, thanks for the opinion.

Member

namusyaka commented Jul 13, 2014

I've just modified the PR.
The arguing should be continued, but I thought the decision should only be committed in the PR for the time being.
Everyone, thanks for the opinion.

@namusyaka namusyaka closed this in e6555aa Jul 15, 2014

ujifgc added a commit that referenced this issue Jul 15, 2014

Merge pull request #1719 from padrino/prepare-keepfile
Empty directories should contain .keep file, closes #1717
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment