Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Version control system recommendation?
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1234

PostPosted: Tue Nov 12, 2013 7:05 am    Post subject: Version control system recommendation? Reply with quote

I want to try out a few new vcs's and am looking for recommendations for our work flow thanks.
I(we) have the following set up:
Code:
         +------------------------+
         |                        |
         | laptop                 |
         | (coding and Testing)   |  (push and pull)
         |                        |<----------+ +---------------------------+
         |                        |+----------> |  Webserver with ssh       |
         +------------------------+             |---------------------------|
                                                |  has svn checkout         |
                                                | of main project svn code  |
                                                |                           |
                                                |  has latest stable code   |
                                                | from local developers     |
                                                |                           |
         +----------------------++------------->| and unstable branches     |
         | Main project SVN     |+              +---------------------------+
         |----------------------|                     ^ +
         |  Checkout only       |                     | |(push and pull)
         |                      |                     | |
         |                      |                     + v
         |                      |         +---------------------+
         |                      |         |  Other Developers   |
         |                      |         |---------------------|
         +----------------------+         | Coding and          |
                                          |     testing         |
                                          |                     |
                                          | need to push &      |
                                          |             pull    |
                                          +---------------------+


We work on a project that is pretty much a fork of a main project. It has frequent updates to the code from a main project, we work work on the project and make changes to it and deploy it all on a webserver. We have had trouble merging in all the updates and changes from "up stream" or the main project.
Currently we use svn. The origin of our svn repo is a pristine copy of the main project from about 6 years ago. The updates from upstream are merged in by hand one at a time.
I would like a system where the upstream project can be merged into the master or copy more easily, especially if there are not conflicts. I am not finding a way to do this in svn and am interested in how to do it in svn if there is a way..
Git has been recommended to us but we are required to keep our work on the server for others to checkout.
I am open to learning git but don't really see any advantages to it.
Someone set up Darcs years ago and we keep going back to svn.
Open source is not a requirement.
Thanks let the opinions roll
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1411

PostPosted: Tue Nov 12, 2013 2:54 pm    Post subject: Reply with quote

Before you throw out Git, have a look at the manual and step by step book. Git does allow SSH checkout:
Git - Documentation
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
Maitreya
Apprentice
Apprentice


Joined: 11 Jan 2006
Posts: 220

PostPosted: Tue Nov 12, 2013 3:59 pm    Post subject: Reply with quote

Before I used GIT I was familiar with most of the SCM's out there and was used to their flow.
This made GIT very confusing for me at first. Now however when I've bent my head around the GIT concept I don't want anything else.

http://www.youtube.com/watch?v=4XpnKHJAok8
Lengthy biased, but very informative.

The merrits of having it distributed is just worth it.
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1237
Location: 42.68n 85.41w

PostPosted: Tue Nov 12, 2013 5:03 pm    Post subject: Reply with quote

git is tough to understand at first.... because you build the revisions on a local machine and don't need a server.

its like build a little bit, save progress build a little more save progress build to finish save progress. 3 git revisions local, then push to server git server tracks the 3 revisions also. it basically clones the repository you've built.

gitlab wiki is a mess, they update that software way too much. the overlay is very out of date.

gitlab will manage all users ssh keys and give them push pull access easily. id keep the server nested deep in the network far away from any malicious attackers, then make the check out only static versions of finished product.
_________________
cat /etc/*-release
Funtoo Linux - baselayout 2.2.0
consider this warning no. 1
https://wiki.gentoo.org/index.php?title=Special:Contributions/666threesixes666&offset=&limit=500&target=666threesixes666
Back to top
View user's profile Send private message
1clue
Veteran
Veteran


Joined: 05 Feb 2006
Posts: 1368

PostPosted: Tue Nov 12, 2013 6:26 pm    Post subject: Reply with quote

I'm still what I consider to be a git novice, but these courses helped me understand a lot better:

Free:
http://try.github.io/levels/1/challenges/1

Paid, but first course is free:
https://www.codeschool.com/courses/git-real

My company has gone through several SCM products starting with CVS and including subversion and git. Before that I used several commercial tools. Git is the clear winner.

The thing about git that threw me off is the local repository. It sounds like a big pain, but it gives you a huge amount of control. You can also commit your local branch as a branch on the remote repository, and it's easy.

I won't recommend anything else. I have neither seen nor imagined a scenario git can't handle better than any other tool we've used.

Git's biggest strength is its branching and merging capabilities. Give yourself a weekend, work through every tutorial you can find and practice it on a copy of your code. Or on a sample project.
Back to top
View user's profile Send private message
schorsch_76
Apprentice
Apprentice


Joined: 19 Jun 2012
Posts: 207

PostPosted: Tue Nov 12, 2013 7:20 pm    Post subject: Reply with quote

I can only reassure what 1clue wrote. git has such big amount of usecases. its unbelivable.
Back to top
View user's profile Send private message
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2693
Location: Hamburg/Germany

PostPosted: Tue Nov 12, 2013 7:50 pm    Post subject: Reply with quote

git
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1234

PostPosted: Tue Nov 12, 2013 7:50 pm    Post subject: Reply with quote

Ok Wow 4 unanimous votes for git.

My head is not wrapping around how would a co-worker get my changes if I hoard them on my laptop?
I trust you all there is a way around this.
a coworker can ssh into the server and I can ssh into the server but he wont want to try to figure out how to ssh in to my laptop where ever I am.
I figured out git-svn because the main project is in svn we have to svn update from the "main" repo daily.
So our git master will be changing daily.

Ok now the docs say to push my changes back to the main repo but the repo is "checked out" so I imagined it would not like that.
just to see I checked out or "cloned" the master from the server to my laptop made some changes and tried to push it back to master. (svn style)
Code:
git push origin --all
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 3.50 KiB, done.
Total 5 (delta 2), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
 ! [remote rejected] master -> master (branch is currently checked out)


They want to check out what I have done and build on that.
So how do I get around this?
Make a new git repo every time I would do a svn commit?
Then the problem remains how do the co-workers know which repo to check out?

Off to get some coffee and keep reading and watching the links above.

Thanks!
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
toralf
Advocate
Advocate


Joined: 01 Feb 2004
Posts: 2693
Location: Hamburg/Germany

PostPosted: Tue Nov 12, 2013 8:13 pm    Post subject: Reply with quote

IRC: #git
Back to top
View user's profile Send private message
1clue
Veteran
Veteran


Joined: 05 Feb 2006
Posts: 1368

PostPosted: Tue Nov 12, 2013 8:36 pm    Post subject: Reply with quote

A coworker who hoards changes is not a coworker. They're a problem which needs solving, possibly by replacement.

There is no SCM which can get around this.

I just watched that Linus Torvalds@Google YouTube video. I'm struck yet again how this guy has no issues with self confidence. :)

Git works extremely well in ways that encourage proper sharing.

You might choose a central repository (github for example, or ANYTHING else) for the "official" repository. Git has no dependency on any central repository, and the Linux kernel has none.

You as a developer update when you want from sources you trust. You have a "master" branch which you traditionally want to keep clean. You branch for a project (say, new_toolbar), you make changes, you commit as soon as you finish even the tiniest unit of work that makes sense. You might share that branch with others, who might submit changes back to your branch. When you have a working, tested feature with all tests passing, you would merge that back to your master, and then push it out to the remote repository.

Likewise "your" branch could be on the remote repository to which you and a few others might have write access, but not to the master branch. You'd have a branch called new_toolbar or whatever and everyone working on that would pull from that, make their changes and push back when they have something worth committing.

By convention, the master of any repo is limited to working code with all tests passing, and more importantly all tests have been executed. Which means anyone who has access can read from that repo and get working code.
Back to top
View user's profile Send private message
1clue
Veteran
Veteran


Joined: 05 Feb 2006
Posts: 1368

PostPosted: Tue Nov 12, 2013 8:45 pm    Post subject: Reply with quote

Sorry, can't stop.

The problem with other SCMs is that branching and merging is very difficult and fraught with problems.

git handles branching/merging really well, and everything is fast. In fact, if you download (clone) a repo, you have automatically branched by any standard. From there you can branch and merge to and from your local repo, and then push all or some of it back to the remote as you decide.

That said, if you have people hoarding code you need to fix it. That's a behavioral problem, not a thing you can fix with a tool. The longer you wait between commits, the less likely the commit will be clean and the less likely it will go well or be well documented.

For teammates working on a single feature like new_toolbar, a lot of coordination is needed and frequent updates are critical. You need a scenario where you can make changes and commit them whether they work or not, whether they're tested or not. Somebody else might depend on the interface you're developing, so even stubbing something out is committable.

For other teams on the same repo, they only want to see a fully functional, fully tested new_toolbar. That's where the master branch comes into play.
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1234

PostPosted: Tue Nov 12, 2013 8:49 pm    Post subject: Reply with quote

1clue wrote:
When you have a working, tested feature with all tests passing, you would merge that back to your master, and then push it out to the remote repository.


So I
1 checked out the master from the server to my local client
2 made a tested feature with all tests passing
now how do I push that back to the main master where a coworker can have it?
How do I push it out to the remote repository?
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1237
Location: 42.68n 85.41w

PostPosted: Tue Nov 12, 2013 8:56 pm    Post subject: Reply with quote

git -> git is how your co worker gets the changes. or you can use gitlab as a central git repository. git > gitlab > co-worker git... yes hoarding changes are a problem.... its a mass patch system. code checked out, worked on, changes merged to master git repo.... if they cant handle that, then they need a brain transplant. you dont push, master pulls. you offer your godlike patches, master approves or disapproves.
_________________
cat /etc/*-release
Funtoo Linux - baselayout 2.2.0
consider this warning no. 1
https://wiki.gentoo.org/index.php?title=Special:Contributions/666threesixes666&offset=&limit=500&target=666threesixes666
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1234

PostPosted: Tue Nov 12, 2013 9:04 pm    Post subject: Reply with quote

1clue wrote:
Sorry, can't stop.

No go right ahead I never get many replies.
1clue wrote:

For teammates working on a single feature like new_toolbar, a lot of coordination is needed and frequent updates are critical. You need a scenario where you can make changes and commit them whether they work or not, whether they're tested or not. Somebody else might depend on the interface you're developing, so even stubbing something out is committable.

Yeah thats why git having it all on my laptop is a problem, and making branches people wont know about is a problem. Were all over the place not in an office my team mates cant get to my laptop it needs to be on a server.
svn has worked for well for me for years, never had a server die or fail without a mirror or any of that.

Still reading the stuff from above ;)
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1411

PostPosted: Tue Nov 12, 2013 9:06 pm    Post subject: Reply with quote

For a proper working example, see The ChromiumOS Project. The Master Branch is Open to the public, but requires each user to sign up, and if contributing code you must follow these guidelines.

This model may require you to update your standards and practices in order to prevent "code hoarding." While this may seem like a PITA in the short run, you will thank us later...
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1234

PostPosted: Tue Nov 12, 2013 9:06 pm    Post subject: Reply with quote

666threesixes666 wrote:
you dont push, master pulls

So I have to log on to the remote server and do a pull every time I would do a svn "commit"?
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1237
Location: 42.68n 85.41w

PostPosted: Tue Nov 12, 2013 9:09 pm    Post subject: Reply with quote

as far as i know yes, ive only scratched the surface of git though.
_________________
cat /etc/*-release
Funtoo Linux - baselayout 2.2.0
consider this warning no. 1
https://wiki.gentoo.org/index.php?title=Special:Contributions/666threesixes666&offset=&limit=500&target=666threesixes666
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1234

PostPosted: Tue Nov 12, 2013 9:12 pm    Post subject: Reply with quote

Well thats a problem.
So I am behind a firewall I have no control over on a laptop. I cant open ssh port on the firewall and allow the remote server to "pull" from my laptop.
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
schorsch_76
Apprentice
Apprentice


Joined: 19 Jun 2012
Posts: 207

PostPosted: Tue Nov 12, 2013 9:24 pm    Post subject: Reply with quote

On the server you need a bare repository. So you can push to it. The clients pull from it. Here is a successfulgit development model [1]

[1] http://nvie.com/posts/a-successful-git-branching-model/
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1237
Location: 42.68n 85.41w

PostPosted: Tue Nov 12, 2013 9:24 pm    Post subject: Reply with quote

i only know fork and pull... i guess there is a shared repo model. you'd really need to ask them, i only know gits designed much better than svn and cvs. mercurial & bazzar im not sure about.

https://help.github.com/articles/using-pull-requests
_________________
cat /etc/*-release
Funtoo Linux - baselayout 2.2.0
consider this warning no. 1
https://wiki.gentoo.org/index.php?title=Special:Contributions/666threesixes666&offset=&limit=500&target=666threesixes666
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1411

PostPosted: Tue Nov 12, 2013 9:35 pm    Post subject: Reply with quote

schorsch_76 wrote:
On the server you need a bare repository. So you can push to it. The clients pull from it. Here is a successfulgit development model [1]

[1] http://nvie.com/posts/a-successful-git-branching-model/


What he said. If the repo is bare and you push, that becomes the master. You should in theory need only to push to bare once. From then on, everyone including you pulls, as only the changes or differences are seen in all files, regardless of the pullee.

See Also: Git By Example
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1411

PostPosted: Tue Nov 12, 2013 9:41 pm    Post subject: Reply with quote

666threesixes666 wrote:
i only know fork and pull... i guess there is a shared repo model. you'd really need to ask them, i only know gits designed much better than svn and cvs. mercurial & bazzar im not sure about.

https://help.github.com/articles/using-pull-requests


Forking creates a new master from an existing master. You "skip over" the bare repository step because the original project creator already created the master by pushing to bare, and then you "borrowed" and make your own.
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
1clue
Veteran
Veteran


Joined: 05 Feb 2006
Posts: 1368

PostPosted: Tue Nov 12, 2013 9:44 pm    Post subject: Reply with quote

turtles wrote:

Yeah thats why git having it all on my laptop is a problem, and making branches people wont know about is a problem. Were all over the place not in an office my team mates cant get to my laptop it needs to be on a server.
svn has worked for well for me for years, never had a server die or fail without a mirror or any of that.

Still reading the stuff from above ;)


But that's the thing. Anyone who clones a repo (the recommended and only way I know of to check out a project) gets the WHOLE project. You get a complete duplicate of whatever you checked out, with ALL revision history. You could clone from your remote -- say, github -- to your laptop, so could your coworker. Then you could delete the github repo and then clone your laptop back onto github, and your coworker would not know.

svn and cvs promote stable code being committed to a central branch. Everybody sees the changes when they update, even if they don't want unstable/untested code.

Git has a private repository for every user. Each user can commit any time they want, and those commits are best when you've done exactly one conceptual thing, or taken one conceptual step. You can assemble that, and you can revert your next step, as many times as you want. When you feel that your code is ready for what would be the first commit in svn or cvs, you can merge it back to your local master. When you know those tests pass after the merge, you can:

git push

and your changes are now available for the entire organization to see. It's easy in git to create branches or to merge them. It's natural to branch, and natural to merge.


People often use a central repo like github. My company does, and I do. There's nothing special about that repository other than the fact that it's nobody's workstation (no development happens there) and that everyone agrees it's the central repo. Git itself doesn't need it. It's just an organizational tool to help developers get their heads around an idea. It's easier to think of a project as having a central repository.

Pull vs push:
You can push to a remote repo that you have write access to. That could be your home box, your office server, github or some other guy's PC in another country who has decided to give you access.

If I download an Open Source project and want to submit a bug fix, I would make my changes, test them and then submit a pull request to the forum or mailing list. Somebody with write access might then pull my changes, test them and, if they like them, push them to the rest of the team.
Back to top
View user's profile Send private message
eyoung100
Veteran
Veteran


Joined: 23 Jan 2004
Posts: 1411

PostPosted: Tue Nov 12, 2013 10:00 pm    Post subject: Reply with quote

1clue wrote:

If I download an Open Source project and want to submit a bug fix, I would make my changes, test them and then submit a pull request to the forum or mailing list. Somebody with write access might then pull my changes, test them and, if they like them, push them to the rest of the team.


Quoting the site I gave earlier:
Quote:
The integration work flow model
Git supports several different work flow models and most corporate environments adopt the integration manager model – where a single person is responsible for all the commits to the “blessed” repository.

Developers clone from this blessed repository when needing to work on the project, pushing their changes back to their own independent repositories, asking the integrator to pull in their changes for approval and inclusion into the next release.


As a developer you don't work on the "blessed repo," you check it out, work on it, submit your changes to your independent repo, then ask the integrator to approve your change, and upload for you. After that your changes are seen by everyone. Even the integrator pulls the blessed repo into his local repo. The only difference is that in some companies the integrator doesn't have to ask for permission to push his changes. In your case, you would be considered the integrator.
_________________
The Birth and Growth of Science is the Death and Atrophy of Art -- Unknown
Registerd Linux User #363735
Adopt a Post | Strip Comments| Emerge Wrapper
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1234

PostPosted: Tue Nov 12, 2013 10:27 pm    Post subject: Reply with quote

eyoung100 wrote:
schorsch_76 wrote:
On the server you need a bare repository. So you can push to it. The clients pull from it. Here is a successfulgit development model [1]

[1] http://nvie.com/posts/a-successful-git-branching-model/



Thanks all need more coffee ...

I was looking at that last night. I don't get what the colors mean in his post and the lines are they each a repo?
Reading it again now...
Say we have a 3 developer shop.
Here ill change that diagram up, now each dev would be a colored dot in his diagram and works from home or whereever.
There is a server somewhere where everyone can get in to, but as the integrator of master you cant pull from everyone's repo back to the server due to firewalls and non static ip's. So I don't get how we are making a new master?
Here is what it looks like to me:
http://postimg.org/image/pziuihd1t/

Now how do we share these different repo's if there not on the server?
I have no idea how to ssh into developer A or B's box he might be in an airport somewhere?
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum