![]() |
#1 |
NPPAngband Maintainer
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
![]() |
github question
So far I have only used Git in its simplest form, merely to upload code that is ready for others to play. I have two branches for NPP. I upload every commit to a branch called "work in progress". When I am ready to finalize a version, I move everything from "work in progress" into "master", and I tag that commit as the final version.
The good news is, for the first time in about 5 years, RL is finally allowing both Diego and I to actively develop NPP at the same time. What we used to do is just send patches or files back and forth and one of us would manually merge them. I guess this question is for the Angband dev team, but what do you all think is the best way for us to use github? I still want the work-in-progress branch to be the latest code that is ready for people to play, but what do you all think is the best way for both of us to get it there? Should we each just have separate branches, and just pull/fetch, merge and push each other's code into work_in_progress? Thanks for any advice you all may have. I figure if the Angband devteam all has 6+ people all pushing things to the same branch at the same time, that you all would probably have some good advice on how Diego and I can best do things.
__________________
NPPAngband current home page: http://nppangband.bitshepherd.net/ Source code repository: https://github.com/nppangband/NPPAngband_QT Downloads: https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57 |
![]() |
![]() |
![]() |
#2 |
Veteran
Join Date: Oct 2011
Location: Toronto, Canada
Posts: 2,401
![]() |
I would probably leave your remote repo set up the way it is currently, with 'master' and 'work_in_progress' as the remote branches.
Locally, you can treat 'work_in_progress' as your "release master". If you need to do something disruptive in 'work_in_progress', you can just create a local branch (it could be remote too, but not necessary) to make multiple commits to, merge that back into 'work_in_progress' when you're done, git pull origin work_in_progress to pick up Diego's changes, and voila, you can push. Then, when it's release time, you can merge the work_in_progress branch back into master, just as you've been doing now. git branch -d <branch> will delete the ref for a local branch when you're done with it. git is awesome -- I hope you enjoy working with it as much as I have ![]() |
![]() |
![]() |
![]() |
#3 |
Prophet
Join Date: Aug 2009
Location: Madison, Wisconsin, US
Posts: 3,025
![]() |
Here's the approach that I use. I think other devs use something similar, or at least Magnate does.
It assumes that you have an official branch, something like npp/npp and a personal branch jeff/npp. I'll also assume that your official branch is named something like npp_master Code adding side.
Now let's say that Diego made some changes and submitted a pull request and you want to look at these changes and incorporate them into npp_master if everything looks ok. I assume you have a remote branch set up to track Diego (if you don't it's really easy to set it up.) Here's how I've been instructed to do this.
Things get a little tricky if you both are simultaneously pushing stuff that mess around with the same files. But there are ways around that with either fixing the merge conflicts that arise with git cherry-pick or rebasing your changes, and fixing the conflicts, right before you push and submit the pull request. There is something nice about having someone else test your changes to make sure that everything works fine, especially if you guys compile and run on different operating systems. |
![]() |
![]() |
![]() |
#4 |
Knight
Join Date: Aug 2009
Posts: 670
![]() |
Btw is using cherry pick command the best way to pull changes ? I use it, but it seems like a hack to me.
|
![]() |
![]() |
![]() |
#5 | |
Angband Devteam member
|
Quote:
It's also useful for keeping things tidy, as merging will create a separate "merge commit" for each merge. This is fine if I'm pulling in half a dozen commits from Blubaron, but for single-commit fixes from other devs it's unnecessary cruft in the history, so I cherry-pick those instead. @jeff: what fizzix said. This is written up at http://trac.rephial.org/wiki/GitUsage but pls say if we could make those pages more useful. Your WIP branch is what we used to call "staging" - we've actually done away with that, but it's definitely a valid approach. This means you and Diego should merge pull requests into WIP first, in case you need to change anything. You can stick with your system of pushing to master at intervals for 'official' releases.
__________________
"Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles |
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Getting Angband from Github and compiling it | Magnate | Development | 121 | December 17, 2019 04:57 |
Github for Windows | Nick | Development | 0 | May 30, 2012 05:25 |
Github help | nppangband | Development | 9 | September 20, 2011 21:11 |