Skip to content
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

Changes for #311 #312

Closed
wants to merge 4 commits into from
Closed

Changes for #311 #312

wants to merge 4 commits into from

Conversation

nackko
Copy link

@nackko nackko commented Mar 21, 2018

My first attempt at contributing. (Full disclosure https://github.com/f8full/findmybikes)

I tried to resolve the issue I opened regarding the use of a GBFS feed instead of an XML one for the Montréal Bixi system in Québec, Canada

@eskerda obviously I didn't know I could add a comment before submitting a pull request (it also IS my first github PR #proud), sry for the double tagging !

Of course I'll undertake any further required changes or tests, please let me know

Cheers,

F.

Fabrice V added 3 commits March 21, 2018 17:27
-added bixi-montreal (modeled on bixi-toronto)

Relates to eskerda#311, some more work must be done somewhere to remove the old parsing though
-removed Bixi Montréal from bixi.json

My guess is that removes the XML parsing from the system. Next commit will remove the XML scapper code
-removed XML feed scrapper

No other pertinent pieces of code could be found searching keyword 'bixi' :
https://github.com/eskerda/pybikes/search?utf8=%E2%9C%93&q=bixi&type=
Copy link
Author

@nackko nackko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant parser. Doh !

Copy link
Owner

@eskerda eskerda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @f8full , thanks for the contribution!

Please review the comments. The only thing left to do is to undo the deleting of bixi.py. All the other changes look good and ready to merge.

pybikes/bixi.py Outdated
'public': utils.str2bool(data['public']),
'latestUpdateTime': data['latestUpdateTime']
}
return station
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file cannot be deleted yet. Other systems (these are present on pybikes/data/bixi.json) are using it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooopsy
I learnt my lesson
nackko@7c3cdf9

someday I may write a parser for this file that would feed pybikes
https://github.com/NABSA/gbfs/blob/master/systems.csv

cheers,

},
"feed_url": "https://montreal.bixi.com/data/bikeStations.xml",
"format": "xml"
},
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

]
},
"feed_url": "https://api-core.bixi.com/gbfs/gbfs.json"
},
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nackko
Copy link
Author

nackko commented Mar 23, 2018

I think
nackko@7c3cdf9
should do the trick, thks GitHub desktop !

@eskerda
Copy link
Owner

eskerda commented Mar 23, 2018

Looks good. Now the problem with that revert commit is that the whole git blame on bixi.py points to you, for no particular reason.

Revert commits are good for reverting things that have already landed master or some downstream projects, but in this case, being a PR, there's no reason for not rewriting history and doing a force push.

There are many ways you can do this if you want. If not, I can cherry-pick the needed commits on a branch and merge it myself, but I think it's always interesting to learn git the hard way :) So, here's how you can get that fixed:

(Easy) Reset hard to origin/master and cherry pick commits

Since you are doing these changes on your master, you cannot reset hard into origin master, but you can rewind the head to the latest commit here

# This will put your head the same as the current pybikes head
git reset --hard 9d35934a3155c5b709c4039481ca31463006101f 
# The changes you did, however, are still somewhere so you can cherry pick them
git cherry-pick e6741000d5bbb8b38e44294e53975c31b28086e9
git cherry-pick 1d12a62377e018c3aa1caf2dad59e12867b8b84c

Now force push your repo, this PR should get updated.

git push -f origin master

(Medium) Use git rebase interactive

Simply

git rebase -i HEAD~4

Now it will show a screen with 4 commits, you want to remove from there the ones you are not interested into (the last two lines). This is the reason why you usually want to give git commits descriptive messages. So you can know what this commit does without having to read the description or the changes it does.

Again, force push that, and this PR should get updated.

A note on working on master

Usually, avoid working on master, and instead work on a feature branch. A branch can be created like

git checkout -b my-feature-branch-name

After this, you are on a different branch, you can play on that branch, commit things, and whenever you go back to master, things will be like they were before

git checkout master

You can list the branches that you have by

git branch

You can switch between branches the same way

git checkout my-feature-branch-name

You would then push that feature branch onto your repo, and then follow the usual way to create a pull request.

The idea behind this is, usually, that you want master to be the same (or not up to date) to mine, and try to avoid diverging from there. Also, unless justified, you should never force push on master, since you could leave other people that had your master on a detached state.

Copy link
Owner

@eskerda eskerda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment on fixing the history on this PR

@nackko nackko closed this Mar 24, 2018
@nackko
Copy link
Author

nackko commented Mar 24, 2018

Just opened #313 by branching correctly as you described. I'll fix my repo using the great guidance you shared, thks for that !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants