pybites / challenges

PyBites Code Challenges
https://codechalleng.es/challenges/
692 stars 2.29k forks source link

No Github activity from forked repos #2

Closed jmtaysom closed 7 years ago

jmtaysom commented 7 years ago

While forking the repo and cloning from everyones own repository is easy it makes it so that when you work on a solution you dont get credit for github activity since it is in a forked repo. See https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile/

What I did when I realized I wasnt getting credit for the activity is delete the fork on github, create a new repo on github, pushed it up to my and then set the upstream to the original repo so I could still pull updates. It is definitely not as easy but if people are using these challenges to acomplish things like 100 days of code they may want to see their progress show up on their activity board.

bbelderbos commented 7 years ago

Actually that is a really good point, thanks for brining that up.

We were looking at PR but it seems you have to merge a whole branch. It was not straight-forward for our use case, but I'll also admit I have not used the feature a lot yet.

How could we do it in a clean (non-merge-conflicting) way so that somebody can just merge a challenge-name.py solution file?

Could we use git cherry-pick for example? http://stackoverflow.com/questions/5256021/send-a-pull-request-on-github-for-only-latest-commit

Happy to hear your thoughts ...

Cheers Bob

jmtaysom commented 7 years ago

The one problem I see with letting pull requests is that say 10 people solve a challenge, now when I make my next pull from upstream I am going to get all of their work too. Maybe you could set it up so each person can have their own branch that never gets merged into master. That way master stays clean with no solutions in it but people could easily explore the branches and even pull the branches if there were interested in exploring something themselves. It would necessarily be git novice friendly though.

bbelderbos commented 7 years ago

Hey Jim, cool, we already use a separate solutions branch for PyBites solutions, keeping master 'clean'.

I made a new 'community' branch: https://github.com/pybites/challenges/branches

I was able to do a PR direction : user : repo : branch from : bbelderbos : challenges(fork) : community into : pybites : challenges : commity (see https://github.com/pybites/challenges/pull/3)

Requirements

The PR is under my (bbelderbos) Contribution activity, that's the goal right?

Can you give it a try? Does it work? And is it a good approach?

If so I will update the INSTALL doc

Thanks again for raising this:

jmtaysom commented 7 years ago

Alright I think I got it working now. I just submitted the PR. I first had to figure out how to reattach my repo as fork since I had disconnected to be able to track my GH activity. I am not sure what it is going to look like but hopefully it will track the activity correctly now.

On Tue, Mar 14, 2017 at 4:42 AM, Bob Belderbos notifications@github.com wrote:

Hey Jim, cool, we already use a separate solutions branch for PyBites solutions, keeping master 'clean'.

I made a new 'community' branch: https://github.com/pybites/challenges/branches

I was able to do a PR direction : user : repo : branch from : bbelderbos : challenges(fork) : community into : pybites : challenges : commity (see #3 https://github.com/pybites/challenges/pull/3)

Requirements

  • git pull/merge new community branch and use it for your solution
  • name your solution template-GHuser.py (e.g. hangman-bbelderbos.py) to not conflict when more users start doing this.

The PR is under my (bbelderbos) Contribution activity, that's the goal right?

Can you give it a try? Does it work? And is it a good approach?

If so I will update the INSTALL doc

Thanks again for raising this:

  • allowing submissions will make this more interesting
  • good learning on how GH PRs work

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pybites/challenges/issues/2#issuecomment-286356173, or mute the thread https://github.com/notifications/unsubscribe-auth/AHe_v4QMfjaf5Yv6AqOfXszV2Z7UzxZSks5rllLxgaJpZM4MbIm2 .

jmtaysom commented 7 years ago

As I reviewed the pull request I saw that when I renamed the files that it would delete the originals in the solution branch. I will try again later.

On Tue, Mar 14, 2017 at 10:36 AM, James Taysom james.taysom@gmail.com wrote:

Alright I think I got it working now. I just submitted the PR. I first had to figure out how to reattach my repo as fork since I had disconnected to be able to track my GH activity. I am not sure what it is going to look like but hopefully it will track the activity correctly now.

On Tue, Mar 14, 2017 at 4:42 AM, Bob Belderbos notifications@github.com wrote:

Hey Jim, cool, we already use a separate solutions branch for PyBites solutions, keeping master 'clean'.

I made a new 'community' branch: https://github.com/pybites/challenges/branches

I was able to do a PR direction : user : repo : branch from : bbelderbos : challenges(fork) : community into : pybites : challenges : commity (see #3 https://github.com/pybites/challenges/pull/3)

Requirements

  • git pull/merge new community branch and use it for your solution
  • name your solution template-GHuser.py (e.g. hangman-bbelderbos.py) to not conflict when more users start doing this.

The PR is under my (bbelderbos) Contribution activity, that's the goal right?

Can you give it a try? Does it work? And is it a good approach?

If so I will update the INSTALL doc

Thanks again for raising this:

  • allowing submissions will make this more interesting
  • good learning on how GH PRs work

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pybites/challenges/issues/2#issuecomment-286356173, or mute the thread https://github.com/notifications/unsubscribe-auth/AHe_v4QMfjaf5Yv6AqOfXszV2Z7UzxZSks5rllLxgaJpZM4MbIm2 .

jmtaysom commented 7 years ago

The more I think about this the more of an issue it is going to be. Lets say I pull request my solution and then someone else wants to pull request their solution. They would have to merge my solution into their solution repo before they could make a pull request for their solution to be put up. The first couple times this happens it may be okay but after that I am pretty sure the merge conflicts would start to get ugly as people have accidentally changed things that are now making so others can even cleanly make a pull without a merge conflict. As I made pull I had do deconflict the .gitignore since I had added /.idea as something to be ignored when the master had added something else on the same line.

Another option could be the one that github suggests for teachers with a classroom of kids. https://education.github.com/guide/forks They have the students submit the pull request but they never actually accept them. Now this scenario is a little different but it might work.

Another thought (though it could be messy too) is set up branches for each user so that what get merged into my branch by me wont affect another student. The issue I see there is that it may be hard to find another persons solution for a specific problem if you have to cycle through all the branches to see who even attempted the problem.

On Tue, Mar 14, 2017 at 10:48 AM, James Taysom james.taysom@gmail.com wrote:

As I reviewed the pull request I saw that when I renamed the files that it would delete the originals in the solution branch. I will try again later.

On Tue, Mar 14, 2017 at 10:36 AM, James Taysom james.taysom@gmail.com wrote:

Alright I think I got it working now. I just submitted the PR. I first had to figure out how to reattach my repo as fork since I had disconnected to be able to track my GH activity. I am not sure what it is going to look like but hopefully it will track the activity correctly now.

On Tue, Mar 14, 2017 at 4:42 AM, Bob Belderbos notifications@github.com wrote:

Hey Jim, cool, we already use a separate solutions branch for PyBites solutions, keeping master 'clean'.

I made a new 'community' branch: https://github.com/pybites/challenges/branches

I was able to do a PR direction : user : repo : branch from : bbelderbos : challenges(fork) : community into : pybites : challenges : commity (see #3 https://github.com/pybites/challenges/pull/3)

Requirements

  • git pull/merge new community branch and use it for your solution
  • name your solution template-GHuser.py (e.g. hangman-bbelderbos.py) to not conflict when more users start doing this.

The PR is under my (bbelderbos) Contribution activity, that's the goal right?

Can you give it a try? Does it work? And is it a good approach?

If so I will update the INSTALL doc

Thanks again for raising this:

  • allowing submissions will make this more interesting
  • good learning on how GH PRs work

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pybites/challenges/issues/2#issuecomment-286356173, or mute the thread https://github.com/notifications/unsubscribe-auth/AHe_v4QMfjaf5Yv6AqOfXszV2Z7UzxZSks5rllLxgaJpZM4MbIm2 .

bbelderbos commented 7 years ago

Hi Jim, thanks for the link. Seems we can still benefit from working with PRs. And not merging won't cause a mess. Would this work for you regarding getting credit on your GH profile?

jmtaysom commented 7 years ago

I completely forgot about that. No it wouldnt work and looking back at the documentation the solutions branch wouldnt have caused the activity to show up either. It is only when the work is merged into the default branch (usually Master) that people would get credit. https://help.github.com/articles/why-are-my-contributions-not-showing-up-on-my-profile/ So at this point I dont think that getting credit is going to be possible unless people have their repo not be a fork. I am fine with that for mine and if you want I can write up how to do it if others are interested. I still have the original repo set as an upstream so I can pull updates but I cant make PRs since it isnt a fork.

On Wed, Mar 15, 2017 at 6:08 AM, Bob Belderbos notifications@github.com wrote:

Hi Jim, thanks for the link. Seems we can still benefit from working with PRs. And not merging won't cause a mess. Would this work for you regarding getting credit on your GH profile?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pybites/challenges/issues/2#issuecomment-286697080, or mute the thread https://github.com/notifications/unsubscribe-auth/AHe_v2cWaCoQInvFmKIA2hdPhi5TkdoVks5rl7iwgaJpZM4MbIm2 .

bbelderbos commented 7 years ago

Hi Jim, yes please do so, then I will link to it in the INSTALL. At least we clarify / set expectations. I also think the non-accept PR thing can be interesting in order to get solutions into our community branch (even if we have to do some manual work). Thanks.

pybites commented 7 years ago

Thanks for the PR / doc update Jim