datacarpentry / python-ecology-lesson

Data Analysis and Visualization in Python for Ecologists
https://datacarpentry.org/python-ecology-lesson
Other
160 stars 310 forks source link

Pr/421 #462

Closed rreka closed 4 years ago

rreka commented 4 years ago

Hey everyone,

I was following the issue (#409) and the pull request (#421), and thought that I would throw a suggestion in. I took a look at the current ZIP folder and noticed that not every file included is used, and not every file referenced in the lesson is included in the ZIP (#409).

So, I went through and removed the files that weren't used and added the files that were used. As per the discussion, I also included a README file that notes where the files originate from (the Project Portal database, USGS, or generated by Data Carpentry). I also tried to build off the text from both of your suggestions.

Happy to help in any way!

p.s., this is my first PR, so sorry if there is an error!

maxim-belkin commented 4 years ago

Thank you for the PR, Roger. Don't worry about errors -- we're here to help!

So, it looks like your copy of the lesson got a little bit out of sync with this lesson so you need to update it before this PR can be merged. If you're using command line, here is what you can do:

git checkout -f gh-pages
git fetch https://github.com/datacarpentry/python-ecology-lesson
git reset --hard FETCH_HEAD
git rebase gh-pages pr/421

You might encounter conflicts at this point. Run git status to see which files have conflicts. Conflicts have the following form:

<<<<<<< Updated upstream
 ... The lines that you changed in your PR
 ... that have been changed "upstream" 
 ... (that is, in https://github.com/datacarpentry/python-ecology-lesson)
 ... will be shown here 
=======
 ... Your changes to the lines above
>>>>>>> Stashed changes

To resolve them, you have to choose which lines to keep (upstream or yours), remove all <<<<, =====, and >>>>> lines, run git add <filename> for files where you resolved conflicts, and, once this is done, execute:

git rebase --continue

After that you'll have to push your changes to your fork of the lesson with:

git push --force-with-lease https://github.com/rreka/python-ecology-lesson gh-pages pr/421

Could you please try following the steps above and then we'll discuss the changes? And please let me know if you encounter any issues along the way -- I'll be happy to help.

Maxim

rreka commented 4 years ago

Thanks, Maxim.

Woops -- I think I may have inadvertently closed this PR. I think it will re-open with this comment, however.

I followed your steps to update my copy of the lesson, and resolved the conflicts, but encountered an error at the end.

I ran this:

$ git push --force-with-lease https://github.com/rreka/python-ecology-lesson gh-pages pr/421

But then got this message:

To https://github.com/rreka/python-ecology-lesson
 ! [rejected]        pr/421 -> pr/421 (stale info)
error: failed to push some refs to 'https://github.com/rreka/python-ecology-lesson'

Any thoughts?

Thank you!!

maxim-belkin commented 4 years ago

Woops -- I think I may have inadvertently closed this PR.

No worries! :)

Let's try

git push --force https://github.com/rreka/python-ecology-lesson pr/421
rreka commented 4 years ago

Woo! It worked. Thanks, Maxim. I hope the changes have come through correctly.

In essence, I propose:

maxim-belkin commented 4 years ago

Looks like it worked. Great job! Now, let's resolve the conflicts in setup.md: I'm talking about those <<<<, ====, >>>> and text between them. Edit the file choosing which parts you would like to keep, add and commit changes to your branch (pr/421) and push them to GitHub. Let me know if you need help with any of these steps!

maxim-belkin commented 4 years ago

Thanks, Roger! I like your changes. I have only one question/comment but otherwise it looks great!

maxim-belkin commented 4 years ago

Thank you, Roger! Regarding the commit I pushed above: I noticed that zip archive had __MACOSX directory. So, I removed it, made minor changes to README.md and pushed updated file to your branch.

Again, thank you for your contribution to the lesson!

rreka commented 4 years ago

Awesome, and thanks for your help with this PR. I learned a lot!

One last question. I was attempting to build off of the original PR (#421), but in hindsight, it looks like I created my own branch off of the master, made my changes, and created a separate PR entirely. In the future, can I branch off of an existing PR?

maxim-belkin commented 4 years ago

You can branch off of an existing PR. There are several ways to do that but I'll show you the one that I think is the simplest one.

Let's say, you want to branch off of a PR number 421, and your remotes are set up like this:

origin <--> https://github.com/datacarpentry/python-ecology-lesson.git rreka <--> https://github.com/rreka/python-ecology-lesson.git # your remote

First, you need to fetch the branch that was used to create PR 421. The quickest way to do this is:

git fetch origin pull/421/head:pr421 

Now you have branch pr421 in your local repository that you can use to start of your branch:

git checkout -b my-branch pr421
# hack-hack-hack
git add -u # add changed files to the staging area
git commit -m "Description of changes"
git push -u rreka my-branch:my-branch

And submit a new PR. That's it!

Of course, don't forget to switch back to gh-pages branch ... and periodically sync it with upstream (this repo):

git checkout gh-pages
git pull origin gh-pages # you might need to add  `--ff-only` flag after `pull`
git push rreka gh-pages