-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Create git repository with initial commit #1288
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks! If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions. |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Added the docs to the readme. |
@gaearon, Just wondering about this PR. It's been done for quite a while now. Thanks |
|
||
execSync('git init', {stdio: 'ignore'}); | ||
execSync('git add .', {stdio: 'ignore'}); | ||
execSync('git commit -m "chore: initial commit from create-react-app"', {stdio: 'ignore'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just make this Initial commit
? I don't think a lot of people are familiar with what "chore" means in this context, and many don't use this format.
try { | ||
execSync('git --version', {stdio: 'ignore'}); | ||
|
||
if (insideGitRepository()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also bail if we're inside a Mercurial repository.
Sorry I haven't been very responsive. Lots of work on React 😛 |
@gaearon, No problem, keep up the good work. Just making sure it doesn't get lost. Made both the requested changes and rebased my commits on master. |
@@ -1009,6 +1010,12 @@ Learn more about React Storybook: | |||
|
|||
You can turn your React app into a [Progressive Web App](https://developers.google.com/web/progressive-web-apps/) by following the steps in [this repository](https://github.com/jeffposnick/create-react-pwa). | |||
|
|||
## Git Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest I think it's fine if don't specifically document this. I appreciate that you took the time to write it down but I don't think it's strictly necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gaearon Not quite sure what you want me to do. Do you want me to leave it as it is there already or delete it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea let's just remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, give me a minute.
@@ -64,6 +101,10 @@ module.exports = function(appPath, appName, verbose, originalDirectory, template | |||
} | |||
}); | |||
|
|||
if (gitInit()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we init git here, doesn't this mean adding react
and react-dom
dependencies are not added yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch and a rather stupid mistake of me. Moved it to execute after adding react an and react-dom.
@gaearon Just checking if there any more changes you would like to see on this? I see there are some conflicts now. Will rebase and resolve those later today. Thanks |
I think there was a bad merge, there's some unnecessary diffs that revert code from |
7447e25
to
21f0c51
Compare
@Timer I redid and fixed the rebase issues. I guess when Git said there where merge issues it really meant it this time :-(. Took a bit of time to figure out what went wrong but now I am only seeing my changes in the PR so the PR should be good. However I am seeing the two |
Appreciate your work. |
On Tue, May 16, 2017, 02:18 Dan Abramov ***@***.***> wrote:
Appreciate your work.
We're a bit short on time so I'm pushing this back to 0.11, but we'll look
into it again at some point!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1288 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADDLIpOPepuAKx0vnjkdFJapiRerbNeyks5r6Os6gaJpZM4LQLML>
.
|
ff91fbf
to
a3aea49
Compare
b7aaa1e
to
ff65875
Compare
@gaearon, Added two |
Sorry, our CI had a bad day. |
@gaearon Seems TravisCI was having a bad CI day as well. If you restart the CI there, I don't have permissions to do so myself, it should turn green just like on AppVeyor. |
@@ -134,6 +171,10 @@ module.exports = function( | |||
} | |||
} | |||
|
|||
if (gitInit()) { | |||
console.log('Initializing git repository'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is done after git initialized so i guess it's better to say git repository initialized rather than initializing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -104,7 +141,7 @@ module.exports = function( | |||
args = ['install', '--save', verbose && '--verbose'].filter(e => e); | |||
} | |||
args.push('react', 'react-dom'); | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can remove the space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
|
||
execSync('git init', {stdio: 'ignore'}); | ||
execSync('git add .', {stdio: 'ignore'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be git add -A
?
(infact git add .
covers create and update but this one feels more inclusive)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sendilkumarn Sure, no problem but there really is no difference. Using git add -A
is the same as git add .
with Git 2. With Git 1 it isn't the same but the difference is in deleted files. As this is a newly created repo there is not going to be any deleted files.
Thanks! |
👍 Happy we finally got this merged in. Hope I can do more in the future. |
* Create git repo with initial commit * Fixe commit message * Added the git repo to the docs * Bail if we are in a mercurial repository * Removed Chore from commit mesage * Create repo after installing react and react-dom * Removed docs * Commit changes when ejecting * Update after review * git add -A instead of git add . after code review
* Create git repo with initial commit * Fixe commit message * Added the git repo to the docs * Bail if we are in a mercurial repository * Removed Chore from commit mesage * Create repo after installing react and react-dom * Removed docs * Commit changes when ejecting * Update after review * git add -A instead of git add . after code review
Fixes #1244
The intended test plan was:
However because I am running Windows natively I was unable to test this the way I wanted because the
cra.sh
doesn't run. Trying to do so in a Docker based Linux container was also less than successful.