Editing Mer/Build/UsingGitorious

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
{{Mer}}
 
-
 
== Packaging ==
== Packaging ==
-
Note that the detailed cut'n'paste instructions on this page assume a '''very''' up-to-date git : ~1.6.3.x;  even 1.6.0.4 is too old and [[#Older Git Versions|will need tweaks]] - though they can still be used.
+
The Mer DVCS packaging process looks like this:
-
===Initial Setup===
+
[[Image:Mer_workflow.png]]
-
The initial Mer DVCS packaging process looks like this:
+
-
 
+
-
[[Image:Mer_workflow_init.png]]
+
An upstream package is unpacked and the <code>debian/</code> directory is removed.
An upstream package is unpacked and the <code>debian/</code> directory is removed.
Line 13: Line 8:
[http://kitenet.net/~joey/code/pristine-tar/ pristine-tar] is used to ensure that the upstream tarball can be recreated perfectly.
[http://kitenet.net/~joey/code/pristine-tar/ pristine-tar] is used to ensure that the upstream tarball can be recreated perfectly.
 +
 +
master is the main branch and the only non-merge commits directly on this branch should be packaging-based and in <code>debian/</code>
All features or bug fixes are broken out to additional branches; 1 branch per feature or fix. The main difference is that features are not likely to go upstream whilst fixes are. This is very similar to quilt.
All features or bug fixes are broken out to additional branches; 1 branch per feature or fix. The main difference is that features are not likely to go upstream whilst fixes are. This is very similar to quilt.
-
 
-
master is the main code branch and there should only be merge commits on this branch; the only non-merge commits should be in <code>./ChangeLog</code>
 
-
 
-
Mer should be packaging-based and the only non-merge commits should be in <code>debian/</code>
 
-
 
-
===Local Updates===
 
-
A local update simply adds a commit to one or more feature branches, merges to master, tags, merges to Mer, tags and releases.
 
-
 
-
===Upstream Updates===
 
-
[[Image:Mer_workflow_upstream.png]]
 
-
 
-
An upstream update loads the new upstream into the upstream branch and replaces any code there.
 
-
 
-
Then it is merged into each feature branch in turn. This ensures the feature branch is updated ready for the next upstream release (which wouldn't happen if the feature branch was merged into upstream).
 
-
 
-
Since master contains all the features; any attempt to merge upstream into master will result in the same conflicts arising en-masse. Instead a local branch is created from upstream HEAD and all features/patches are staged into this branch before being merged and tagged in master.
 
-
 
-
Finally master is merged into Mer and any packaging modifications are made.
 
-
 
-
===Maintenance Releases===
 
-
[[Image:Mer_workflow_maint.png]]
 
-
 
-
[ Note this is still theoretical. ]
 
-
 
-
Maintenance releases are made by branching master and patching or cherry picking commits. There is no attempt to maintain or integrate feature branches.
 
-
 
-
Once a tag is made in master, the Mer branch is branched, merged and tagged.
 
-
 
-
===Overall===
 
-
[[Image:Mer_workflow.png]]
 
== Developing ==
== Developing ==
Line 64: Line 31:
Get the upstream source unpacked
Get the upstream source unpacked
-
   mkdir gitify
+
   mkdir $PKG
-
   cd gitify
+
   cd $PKG
-
either:
+
  mkdir _tmp
-
   tar xf ../$TARBALL
+
  cd _tmp
-
or
+
   tar xf ../../$TARBALL
-
  dpkg-source -x ../$PKG*.dsc
+
   mv */* ../
-
   rm -f *
+
-
(rm -f * removes the dpkg-source cruft)
+
-
 
+
-
Then
+
-
  mv * ../$PKG
+
   cd ..
   cd ..
-
   rm -rf gitify
+
   rm -rf _tmp
-
  cd $PKG
+
Cleanse the install
Cleanse the install
Line 175: Line 136:
on gitorious goto 'Edit Repository' and set default to Mer
on gitorious goto 'Edit Repository' and set default to Mer
-
 
-
== Updating a feature branch ==
 
-
===python-hildon===
 
-
 
-
Setup some variables
 
-
PKG=python-hildon
 
-
GPKG=$PKG
 
-
FEATURE=codegen-in-gobject
 
-
TAG=0.9.0-1maemo4mer2
 
-
 
-
First go and get the source from gitorious or update your copy
 
-
git clone git@gitorious.org:mer/$GPKG.git
 
-
or
 
-
git fetch
 
-
 
-
Get the branch you want to work on
 
-
git checkout mer/$FEATURE
 
-
 
-
make changes and commit
 
-
git add $FILES
 
-
git commit -m"Fix to build on debian"
 
-
 
-
Merge into Mer branch via local and master
 
-
git checkout upstream
 
-
git checkout  -b local
 
-
 
-
Merge all features and patches
 
-
git merge mer/$FEATURE
 
-
 
-
Get the master branch
 
-
git checkout --track origin/master -b master
 
-
or
 
-
git checkout master
 
-
 
-
Then merge into Mer
 
-
git merge local
 
-
 
-
Make a comment in the toplevel Changelog
 
-
git add ChangeLog
 
-
git commit -m"$TAG"
 
-
git tag $TAG
 
-
git checkout Mer
 
-
 
-
Make a comment in the debian changelog
 
-
git add debian/changeLog
 
-
git commit -m"Mer_$TAG"
 
-
git tag Mer_$TAG
 
-
 
-
Then
 
-
git push
 
== Handling new upstream ==
== Handling new upstream ==
Line 242: Line 153:
   git clone git@gitorious.org:mer/$GPKG.git
   git clone git@gitorious.org:mer/$GPKG.git
   cd $GPKG
   cd $GPKG
-
   git checkout --track origin/upstream -b upstream
+
   git checkout --track origin/upstream
-
   mv .git ../git-safe
+
   git rm -r *
-
  cd ..
+
-
  rm -rf $GPKG
+
replace the upstream code
replace the upstream code
-
   mkdir gitify
+
   mkdir _tmp
-
   cd gitify
+
   cd _tmp
-
   tar xf ../$TARBALL
+
   tar xf ../../$TARBALL
-
   mv * ../$GPKG
+
   mv */* ../
   cd ..
   cd ..
-
   rm -rf gitify
+
   rm -rf _tmp
-
  mv git-safe ${GPKG}/.git
+
-
  cd $GPKG
+
-
  mv debian ../
+
   git add .
   git add .
-
 
-
Sanity check to ensure no files are removed etc. If so you need to make sure to <code>git rm</code> them
 
-
  git status
 
Now we have a clean upstream release
Now we have a clean upstream release
Line 266: Line 169:
   git tag $UPVER
   git tag $UPVER
   pristine-tar commit ../$TARBALL
   pristine-tar commit ../$TARBALL
-
 
-
If there are no mer/* branches then you get to skip to [[#HIM-Merge-Branches]]
 
Now to merge it into the branches
Now to merge it into the branches
for each mer/* branch
for each mer/* branch
-
   git checkout --track origin/mer/buttonwidth -b mer/buttonwidth
+
   git checkout --track origin/mer/buttonwidth
   git merge upstream
   git merge upstream
-
   git checkout --track origin/mer/him-arabic -b mer/him-arabic
+
   git checkout --track origin/mer/him-arabic
   git merge upstream
   git merge upstream
This fails:
This fails:
Line 349: Line 250:
Carry on:
Carry on:
-
   git checkout --track origin/mer/keyboard-available -b mer/keyboard-available
+
   git checkout --track origin/mer/keyboard-available
   git merge upstream
   git merge upstream
Line 374: Line 275:
Finally:
Finally:
-
   git checkout --track origin/mer/werror -b mer/werror
+
   git checkout --track origin/mer/werror
Once again we see that the old branch simply wanted to remove -Werror so edit and
Once again we see that the old branch simply wanted to remove -Werror so edit and
   git add configure.ac
   git add configure.ac
Line 388: Line 289:
   git merge mer/werror
   git merge mer/werror
-
Once the conflicting branches are consolidated, they can be merged;
+
Once the conflicting branches are consolidated, they can be merged:
-
   git checkout --track origin/master -b master
+
   git checkout --track origin/master
   git merge local
   git merge local
-
 
-
=====HIM-Merge-Branches=====
 
-
If there were no mer/branches then you would :
 
-
  git checkout --track origin/master -b master
 
-
  git merge upstream
 
And tagged for release:
And tagged for release:
Line 404: Line 300:
   git checkout Mer
   git checkout Mer
   git merge master
   git merge master
-
 
-
At this point, if the upstream is a native package, you should look at ../debian if present to decide how it may impact the packaging branch. Otherwise ensure any modified files are added.
 
   git add debian/changelog debian/control
   git add debian/changelog debian/control
   git commit
   git commit
Line 444: Line 338:
   git clone git@gitorious.org:~lbt/mer/glib2_0-mer.git
   git clone git@gitorious.org:~lbt/mer/glib2_0-mer.git
   cd glib2_0-mer/
   cd glib2_0-mer/
-
   git checkout --track origin/upstream -b upstream
+
   git checkout --track origin/upstream
   git rm -r *
   git rm -r *
Line 495: Line 389:
    
    
Now to create a Mer glib from a master
Now to create a Mer glib from a master
-
   git checkout --track origin/master -b master
+
   git checkout --track origin/master
Upgrade entire glib
Upgrade entire glib
Line 522: Line 416:
And a new Mer release
And a new Mer release
-
   git checkout --track origin/Mer -b Mer
+
   git checkout --track origin/Mer
   git merge master
   git merge master
   editor debian/changelog
   editor debian/changelog
Line 541: Line 435:
Read upwards to progress in time. Note how on the right is the 'upstream' branch tagged at 2.20.1 then you see the Mer patches being applied to master which is then merged into Mer.
Read upwards to progress in time. Note how on the right is the 'upstream' branch tagged at 2.20.1 then you see the Mer patches being applied to master which is then merged into Mer.
(There is slight complexity here since the upstream changed to the *real* upstream).
(There is slight complexity here since the upstream changed to the *real* upstream).
-
 
-
==Git based upstream==
 
-
 
-
Working with a git based upstream is similar but we need to track the main origin branch as upstream. We'll do two things to make this sane:
 
-
 
-
# rename <code>origin</code> to <code>Upstream</code> (differentiate from the branch)
 
-
# to stay in keeping with the process above we'll track the <code>Upstream/master</code> as <code>upstream</code>
 
-
 
-
usually that will be:
 
-
 
-
  git remote rename origin Upstream
 
-
  git branch --track  upstream Upstream/master -b master
 
-
 
-
Then create a local master (it may be necessary to remove the debian/ directory)
 
-
  git checkout -b master
 
-
  git rm -r debian/
 
-
  git commit -am"Cleaned up debian/"
 
-
 
 
-
It may however, be useful as a base for packaging:
 
-
  git checkout upstream
 
-
  mv debian/ ..
 
-
  git checkout master
 
-
  git checkout -b Mer master
 
-
  mv ../debian .
 
-
  <hack on debian/>
 
-
  git add debian
 
-
  git commit -am "initial debianize based on upstream"
 
-
 
-
Push this to the gitorious origin:
 
-
  git remote add origin git@gitorious.org:mer/$GPKG.git
 
-
  git push --mirror origin
 
-
 
-
For updates:
 
-
  git fetch Upstream
 
-
 
-
==SVN based upstream==
 
-
 
-
Working with an svn based upstream is similar again but it's easier to track the svn upstream.
 
-
 
-
git svn clone https://svn.tinymail.org/svn/tinymail/trunk
 
-
mv trunk $PKG
 
-
git branch -m master upstream
 
-
 
-
Then create a local master (it may be necessary to remove the debian/ directory)
 
-
  git checkout -b master
 
-
  git rm -r debian/
 
-
  git commit -am"Cleaned up debian/"
 
-
 
 
-
It may however, be useful as a base for packaging:
 
-
  git checkout upstream
 
-
  mv debian/ ..
 
-
  git checkout master
 
-
  git checkout -b Mer master
 
-
  mv ../debian .
 
-
  <hack on debian/>
 
-
  git add debian
 
-
  git commit -am "initial debianize based on upstream"
 
-
 
-
Push this to the gitorious origin:
 
-
  git remote add origin git@gitorious.org:mer/$GPKG.git
 
-
  git push --mirror origin
 
-
 
-
For updates:
 
-
  git fetch Upstream
 
== Working from Gitorious ==
== Working from Gitorious ==
Line 613: Line 443:
Essentially
Essentially
   git clone git@gitorious.org:mer/$GPKG.git
   git clone git@gitorious.org:mer/$GPKG.git
-
   git checkout --track origin/Mer -b Mer
+
   git checkout --track origin/Mer
determine which feature or branch needs work. Then:
determine which feature or branch needs work. Then:
-
   git checkout --track origin/mer/<feature> -b mer/<feature>
+
   git checkout --track origin/mer/<feature>
hack...
hack...
Line 629: Line 459:
If this works OK then clean up your mer/<feature> branch... probably doing a <code>--squash</code> and push the branch to gitorious.
If this works OK then clean up your mer/<feature> branch... probably doing a <code>--squash</code> and push the branch to gitorious.
-
==Older Git Versions==
 
-
Older git versions don't guess -b correctly when using --track.
 
-
Newer git will take:
 
-
  git checkout --track origin/master
 
-
and create the obvious local branch: master. Older gits need to be explicitly told:
 
-
  git checkout --track origin/master -b master
 
-
So if you have a newer git you don't need to add the right "-b <branch>" to each of the --track options.
+
[[Category:Mer]]

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: