add --skip-ignore and --skip-keeps options to generators. #7614

Merged
merged 1 commit into from Sep 13, 2012

Conversation

Projects
None yet
5 participants
Contributor

frodsan commented Sep 12, 2012

This is an updated version of #2808.

It closes #2800. Users of other SCM's can now generate rails
apps that will add the "empty" directories to source control,
but will not have a useless .gitignore or mis-named .gitkeep
files.

Member

josevalim commented Sep 12, 2012

Why not just use the existing --skip-git option?

Owner

rafaelfranca commented Sep 12, 2012

Good question. @derekprior could you explain?

Between I'm closing #2808 since we have a new version.

Contributor

derekprior commented Sep 12, 2012

--skip-git will skip creation of the .gitignore and .gitkeep files. The keep files are useful to source control systems other than git. Perforce, for instance, also needs files present to track a folder. Just because I'm not using git doesn't mean I don't want to keep Rails' empty folders around.

Perhaps a better, simpler solution is:

  1. Change the generator to name the .gitkeep files in a more SCM-agnostic way (e.g. .keep).
  2. Change --skip-git so that it only skips the .gitignore file and still generates .keep.

Currently, the --skip-git option is enticing to people who use other SCMs but it might not be what they really want. They don't want to lose those empty folders. What they should do is generate the project as usual, but then delete the .gitignore file and rename all the .gitkeep files to something a bit more agnostic.

Renaming the files might seem like minutia, but why be git-centric when there's no reason to be?

Contributor

frodsan commented Sep 12, 2012

@josevalim @rafaelfranca Yup, i have the same concern. I just updated it to keep with the discussion.

Owner

rafaelfranca commented Sep 12, 2012

I think is better to follow the simple solution.

Contributor

frodsan commented Sep 12, 2012

@rafaelfranca agree. I'm happy with --skip-git because it's simpler. So don't worry ... no resentments if you close it haha :)

Owner

rafaelfranca commented Sep 12, 2012

@frodsan we will still need to merge this one changing the current implementation to:

  1. Change the generator to name the .gitkeep files in a more SCM-agnostic way (e.g. .keep).
  2. Change --skip-git so that it only skips the .gitignore file and still generates .keep.
Contributor

frodsan commented Sep 13, 2012

@rafaelfranca updated. I removed the --skip-ignore option and change --skip-git to only skip the .gitignore file.

Owner

rafaelfranca commented Sep 13, 2012

Great. Could you add an CHANGELOG entry and see if we need to update any doc/guide.

Contributor

frodsan commented Sep 13, 2012

no problem, 1.second.

Contributor

frodsan commented Sep 13, 2012

I squashed the commits and added an CHANGELOG entry. I don't see any related in the guides, but what about the GettingStarted code? https://github.com/rails/rails/tree/master/guides/code/getting_started/app/mailers

Owner

rafaelfranca commented Sep 13, 2012

I don't think we need to. Github said that this pull request cannot be automatically merged.

@derekprior derekprior change app/plugin generators to be more SCM agnostic
Users of other SCM's can now generate rails
apps that will add the "empty" directories to source control,
but will not have a useless .gitignore or mis-named .gitkeep
files.

* Change `rails new` and `rails plugin new` generators to name
  the `.gitkeep` as `.keep` in a more SCM-agnostic way.

* Change `--skip-git` option to only skip the `.gitignore` file
  and still generate the `.keep` files.

* Add `--skip-keeps` option to skip the `.keep` files.

It closes #2800.
ceb05bd
Contributor

frodsan commented Sep 13, 2012

CHANGELOG merge conflict => fixed.

@rafaelfranca rafaelfranca added a commit that referenced this pull request Sep 13, 2012

@rafaelfranca rafaelfranca Merge pull request #7614 from frodsan/scm_agnostic
add --skip-ignore and --skip-keeps options to generators.
9641cdd

@rafaelfranca rafaelfranca merged commit 9641cdd into rails:master Sep 13, 2012

Owner

rafaelfranca commented Sep 13, 2012

Thanks

Member

steveklabnik commented Sep 13, 2012

Renaming the files might seem like minutia, but why be git-centric when
there's no reason to be?

Well, 95(?)% of Rubyists use git, so it's a pretty reasonable assumption.

I'm on mobile or I'd find that survey link...

Contributor

derekprior commented Sep 13, 2012

Does changing .gitkeep to .keep impact those 95% in any meaningful way?

Owner

rafaelfranca commented Sep 13, 2012

I don't think so.

Member

steveklabnik commented Sep 13, 2012

Other than being a weird non-convention for everyone involved, no.

I'm not so much 👎 as I am playing devil's advocate.

@gwagener gwagener added a commit to gwagener/refinerycms that referenced this pull request May 1, 2014

@gwagener gwagener Renamed source control keep files.
This keeps in line with Rails since rails/rails#7614.
5133c19

@gwagener gwagener added a commit to gwagener/refinerycms that referenced this pull request May 1, 2014

@gwagener gwagener Renamed source control keep files.
This keeps in line with Rails since rails/rails#7614.
9ac175c

@keram keram added a commit to keram-refinery/refinerycms that referenced this pull request May 17, 2014

@gwagener @keram gwagener + keram Renamed source control keep files.
This keeps in line with Rails since rails/rails#7614.
3c7c7fa

@isaacfreeman isaacfreeman added a commit to isaacfreeman/refinerycms that referenced this pull request May 18, 2014

@gwagener @isaacfreeman gwagener + isaacfreeman Renamed source control keep files.
This keeps in line with Rails since rails/rails#7614.
eec04b2

@isaacfreeman isaacfreeman added a commit to isaacfreeman/refinerycms that referenced this pull request May 18, 2014

@gwagener @isaacfreeman gwagener + isaacfreeman Renamed source control keep files.
This keeps in line with Rails since rails/rails#7614.
43b0923
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment