• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Blackjack: GitHub repository  RSS feed

 
Saloon Keeper
Posts: 10225
216
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all! I just created an organization on GitHub containing a repository for the Blackjack project: https://github.com/CoderanchCorral/Blackjack

I set up the repository so that it has a protected master branch, which can only be pushed to using pull requests. Pull requests have the following policies:
- At least two members must perform a code review and approve the pull request.
- Branches that are merged into master must be up to date (must contain all commits also present in master).
- Branches that are merged into master must have a successful build status.

All members of the project are free to create new branches. Branches from master are automatically built and tested using Travis-ci.

I took the liberty of initializing the master branch with the Mozilla Public License Version 2.0, we can probably change this if people feel strongly about it.

To test the setup, I created a branch project/readme with a single commit to update the readme with a badge displaying the build status of the master branch and then I created a pull request. The pull request can not be completed because it lacks a code review and the build currently fails (because there is no script to build the project).

Later I will update the pull request so it will build successfully, but I first need two approvals from other members so I can test that approvals are discarded when I push a new commit.
 
Stephan van Hulst
Saloon Keeper
Posts: 10225
216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, today I found out there is no way for users to request membership through the GitHub site. If you want to become a member, send me a PM.

Note that it may take anywhere from a few minutes to a few days to process your request, because I need to eat and sleep and sometimes be off for the weekend. :-)
 
Ranch Hand
Posts: 66
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I'm not very familiar with GitHub and wanted to make sure I won't mess up anything so couple questions if I may:

Should I just clone the repo, work on it locally and then push it back? Or should I fork it first and clone from my copy? Should I create a new branch when working on new features? What about when I want to make a really small change? Many thanks
 
Stephan van Hulst
Saloon Keeper
Posts: 10225
216
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Easiest is to clone the repo, check out a feature branch and edit locally. Feel free to push to all branches. Don't worry about breaking anything, important branches (like master and release) will be protected so you can't push to them. The point of using Git is that mistakes are natural and easy to fix.

If you want to try out something without bothering others, feel free to create a new branch based on whatever other branch you want to continue from.

Later I will add a CONTRIBUTING to the project, to formalize how you can play around with the repository and eventually get your code to master.
 
Bartender
Posts: 1868
81
Android Chrome IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for doing this Stephan. My Github username is letkemanpete78.

I see that you may have setup Travis-CI for this project. Was this a difficult and/or tedious task?

Eventually we all write bad code, even if it's a typo. Were you planning setting up an code quality check or rules?
For instance you can integrate Sonar to help limit some of the common bad code that people use.
I think with Sonar you can insure that X% of all the code that is committed is covered with a passing/working unit test.
 
Stephan van Hulst
Saloon Keeper
Posts: 10225
216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, we definitely want something like that, but I figured that we'd first want to reach agreement on our style rules? Or do we just set something up and tweak the rules as we go?
 
Pete Letkeman
Bartender
Posts: 1868
81
Android Chrome IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting dilemma. Programmers of all experience may write bad code or code that could be improved upon.
If Sonar were to be used, you can still commit your code if you have some Sonar issues.
Sonar can also verify that X% of your code base is covered by unit tests.
I think that initially Sonar ensure that 60% of the code committed is tested.
This is for each and every commit (I think) which means that if you change one line of code you may need to create/update a unit test.

My initial thought is to enable Sonar, but set the bar to something lower then 60%.

However there is also the issue of code style. Google Java code style (https://github.com/google/styleguide) is not the same as other code style.
But I do think that a code style should be used. Do you have a style XML file which you recommend?
 
Bartender
Posts: 1205
82
Angular Framework AngularJS Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Github username is Ganesh-Patekar. I'm thinking to post code here on our forum since there seems some code already written by Pete and Adrian which I don't want to see because It will help me in coding. I want to write code on my own at least for now so I can understand where I'm lacking what I need to understand ...

Regarding Git I've been practicing the site Learn Git Branching Stephan gave me, It is really helpful. About Testing and maven and all I think I better finish the coding part first so I could give try for Testing as well as Maven, I guess?  

Feel free to guide me and nitpick my code whenever you get time ...
 
Stephan van Hulst
Saloon Keeper
Posts: 10225
216
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can of course start topics in the Ranch Corral forum about snippets of code you want us to review. However, don't be afraid to create your own branches on GitHub.
 
Ganesh Patekar
Bartender
Posts: 1205
82
Angular Framework AngularJS Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:You can of course start topics in the Ranch Corral forum about snippets of code you want us to review. However, don't be afraid to create your own branches on GitHub.

Thank you so much. I'm a bit familiar now with basic commands of Git. Will post the code and create a branch perhaps by tomorrow, eventually will get used to with Github and all for sure.
 
Stephan van Hulst
Saloon Keeper
Posts: 10225
216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A request to all contributors: Please use all lowercase names for shared branches. Git is case sensitive, while some file systems are not. This may have very confusing effects when creating or checking out branches that only differ in capitalization.
 
Sheriff
Posts: 6747
466
BSD Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be aware of this.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!