Page 3 of 3

Re: [INFO] Call for Maintainers and forum changes

Posted: Fri Jun 07, 2013 5:22 am
by Tectu
The advantages of git over svn? Local repositories!!!

You may read (scroll through) these:

Here's some quote of the second one:
  • Git is much faster than Subversion
  • Subversion allows you to check out just a subtree of a repository; Git requires you to clone the entire repository (including history) and create a working copy that mirrors at least a subset of the items under version control.
  • Git's repositories are much smaller than Subversions (for the Mozilla project, 30x smaller)
  • Git was designed to be fully distributed from the start, allowing each developer to have full local control
  • Git branches are simpler and less resource heavy than Subversion's
  • Git branches carry their entire history
  • Git provides better auditing of branch and merge events
  • Git's repo file formats are simple, so repair is easy and corruption is rare.
  • Backing up Subversion repositories centrally is potentially simpler - since you can choose to distributed folders within a repo in git
  • Git repository clones act as full repository backups
  • Subversion's UI is more mature than Git's
  • Walking through versions is simpler in Subversion because it uses sequential revision numbers (1,2,3,..); Git uses unpredictable SHA-1 hashes. Walking backwards in Git is easy using the "^" syntax, but there is no easy way to walk forward.


~ Tectu

Re: [INFO] Call for Maintainers and forum changes

Posted: Fri Jun 07, 2013 6:19 pm
by Giovanni
Thanks for the links.

I have some questions:
1) How do I branch release trees? do I need a different central repository for each branch? I need to keep history for each stable branch I am maintaining.
2) Is the merge mechanism mandatory? I don't like potentially merging also unwanted changes. For example white space changed without noticing. I thing I especially like is to be able do make quick diffs before committing anything and see what is going in.
3) Can I partially merge?
4) How merge conflicts are managed?

Giovanni

Re: [INFO] Call for Maintainers and forum changes

Posted: Fri Jun 07, 2013 8:43 pm
by jscott
I am not a Git expert, but I use it regularly for my projects and find it works well and is easier to use then subversion that I used many years ago.

I have some questions:
1) How do I branch release trees? do I need a different central repository for each branch? I need to keep history for each stable branch I am maintaining.


No, one repository to rule them all.. errr I mean one repository for the whole project. However, you may find it easier to break things up. Maybe, break the demos out into a separate repository since there are so many of them.

When you are ready to create a stable release, you can create a branch for it, then put a tag on it that specifies that it is a release branch. ( not a good explanation, but I need to runs some tests to figure out the best way to do it. )

Each branch will show all the history leading up that branch, and continuing into that branch.


2) Is the merge mechanism mandatory? I don't like potentially merging also unwanted changes. For example white space changed without noticing. I thing I especially like is to be able do make quick diffs before committing anything and see what is going in.


No. If multiple files are changed between commits, you can view changes in each file and decide if you want to commit that file at that time. You will be able to see that the change was only a white space change and ignore it.


3) Can I partially merge?


yes, see above

4) How merge conflicts are managed?


graphically, you can see both versions and visually compare the different lines.

I use Git Gui that comes with the Windows version of Git.

I make very frequent commits. Every time I make meaningful changes to some code
and get to a good stopping point.

When I import new code modules from somewhere else, I do a commit for it.

If they are going to require extensive modification, testing, or are going to take extensive time to
work on, I will create a new branch and do a commit in that new branch. Then I can continue
work on the master branch, and when I have time switch to the other branch to work on that
outside code. When it is ready, and can merge that branch into the master and it just becomes
part of the main(master), or I can keep it as a custom version in its own branch.

Doing a commit or creating a branch takes a few seconds. Mostly typing the name of the new branch or writing the commit notes.

This may shed some light on how I work with git, but maybe others can add their two cents also.

( I wonder if this should be retitled the GIT thread.... )

-John Scott

Re: [INFO] Call for Maintainers and forum changes

Posted: Fri Jun 07, 2013 9:08 pm
by mobyfab
Hi Giovanni,

You should read this: http://nvie.com/posts/a-successful-git-branching-model

This is what I use at work and it's really convenient for team work. I make a release branch for each release version.

1) The above link should answer your question. You only need one "central" (online) repo to share your work. As said each clone IS a fully featured repo.
Also each branch has it's own history.

2) It's not mandatory, you can also do what we call "rebase", it's basically changing the point at which you branched to a newer revision.
In other words you change where/when your branch is based on. (hence re-base)
The nice thing about rebase it that there is no commits. Keep in mind the merging in git is very easy and common compared to svn.

3) Yes but it depends what you want to merge.
You can apply one or more commits from another branch using "cherry-pick commitid" or "cherry-pick commitid_from commitid_to".
You can copy a file from another branch using "checkout branch -- file" (but you'll have to commit)
Or even make patches and apply them.

4) Conflicts are resolved in 3 ways: use theirs/ours or fix it "manually" (with a merge tool)
There are lots of merge tools like TortoiseMerge (same as with TortoiseSVN), kdiff, vimdiff and so on. They do all the boring stuff for you, which can be a PITA in big files :)

edit: too late but posting anyways :p

edit2: you should read this too: http://git-scm.com/book/en/Git-and-Othe ... ing-to-Git
Git can import SVN repos and keep all the commits history.

Re: [INFO] Call for Maintainers and forum changes

Posted: Fri Jun 07, 2013 9:27 pm
by jscott
edit: too late but posting anyways :p


Never too late for another opinion! :D

Re: [INFO] Call for Maintainers and forum changes

Posted: Mon Jun 10, 2013 10:43 am
by Prof. Dr. YoMan
Hi Giovanni,

first of all: https://www.atlassian.com/git/ <= Another link (posted above) with a quit tutorial about git, which i like.
And I also recommend this, posted above: http://nvie.com/posts/a-successful-git-branching-model

Giovanni wrote:1) How do I branch release trees? do I need a different central repository for each branch? I need to keep history for each stable branch I am maintaining.

Any branch (even master == trunk) are equal in git. You simply branch your release branch and merge (backport) the stuff you want into it. All branches keep the COMPLETE history. Everything in one repository. Each repository has ALL information, even the cloned ones. You can not just clone a part of the tree as in svn. svn and git behave very different internally (patches <> snapshots http://git-scm.com/book/en/Getting-Started-Git-Basics). THE book is very nice for a start to understand the implications of the design of git http://git-scm.com/book.

2) Is the merge mechanism mandatory? I don't like potentially merging also unwanted changes. For example white space changed without noticing. I thing I especially like is to be able do make quick diffs before committing anything and see what is going in.

Git has something pre of merge. Its called index/stage. You bundle everything you want to commit into this stage/index. You can do this per line (and not as in svn per file). gitextension (ui) and other uis help you to stage single lines, to see what are only whitespace changes, ...
The UIs present you with the diff view, ... See e.g. https://code.google.com/p/gitextensions/ for screenshots.

3) Can I partially merge?

Yes, you can cherry-pick single commits, and don't need to merge complete branches. And you don't get a big pile of shit if you don't log excactly what you have done, because git handles it safely and correct for you.

EDIT:
A better way is to isolate every fix on master (trunk) into a seperate feature/fix-branch. You then only need to merge this branch to every release branch you want. It's safe. The way git does it (not only patches, but the complete history is know) there are lot less possibility for merge conflicts. I am often impressen how git manages to merge without a conflict although i have the fear before doing the merge, that i need to fix lots of stuff by hand. I veeeery seldom need. Looks like magic, but isnt.
EDITEND

4) How merge conflicts are managed?

Same as in svn. Help from "meld", svnmerge, ... same tools.

Feel free to ask more. But i urge to read the first two chapters of THE book and follow my above two links

Re: [INFO] Call for Maintainers and forum changes

Posted: Fri Aug 02, 2013 9:25 pm
by colin
Giovanni,

You can also import the full Subversion history from the current SourceForge repository into Git as well, branches and all. You don't have to lose it.

I used SVN for a few years but just a few months ago started using Git myself and it is SO GREAT. Subversion is so much more primitive in terms of its branching and merging support, and also for the ability for developers to work remotely and independently of the "official" project by having local repository copies.

Code Archaeology With Git - check out blame and pickaxe:
One of the coolest things I've seen in Git lately is how it actually infers not only which files were renamed/copied, in the "git blame" / "git gui blame" (AWESOME tool, like "svn annotate" but on steriods), but also where BLOCKS OF CODE where copied from! I don't know how it does it. If you look in the "blame" output it will show you the source of that block of code.

Git "pickaxe" is the ability for Git to tell you where a particular string/regex was added or removed from the code. It's super fast.

Once you figure out the basic Git commands (and particularly "add" differs from Subversion -- how the "index" is the staging area), it becomes super simple to use and it just works. It stays out of the way and does what you need.

Another KILLER feature in Git is "rebase -i". This has multiple uses, but it is especially great for re-organizing a series of recent commits on a branch (a local private branch, not one you've published or pushed to the mainline). You can edit commit messages to clean them up, you can "squash" several commits together (useful for those little fixups to a recent commit that just clutter history). You can re-order commits. You can delete commits.

Sorry for rambling, but Git is just about the most powerful tool in my toolbox of all. It makes life good.

Re: [INFO] Call for Maintainers and forum changes

Posted: Tue Aug 19, 2014 8:27 pm
by barthess
Giovanni wrote:100% pure unadulterated open source

Be careful. This statement can provocate flame war "what license is more unadulterater"

Giovanni wrote:4) Documentation (we will set up dedicated sections on the wiki for the various families.

Having section for useful libraries able to run on top of Chibios will be good too. Because it is hard to look such stuff at forum.