openSUSE:Build Service Git

Jump to: navigation, search
Icon-trash.png This article is being considered for deletion!
Reason:

The content of this page is outdated and not referenced in the OBS docu anymore.

Please do not blank, merge, or move this article, or remove this notice. Refer to this article's discussion page and our deletion policy for more information.

Get Build Service Code

Deploy needed parts from github

The Build Service is hosted in the openSUSE github project in multiple repositories:

  • osc -- the osc command line client
  • build -- the build script for doing builds

Server components:

  • OBS -- the build service itself
  • obs-sign -- the sign daemon


Additional repositories

The following pieces are not officially part of OBS, but may be helpfull for certain tasks:

  • yabsc -- A GUI Client, reusing osc libs.

Checking out

The clone can be done by everyone via the following command. Replace $MODULE for example with osc, build or build-service:

git clone git://github.com/openSUSE/$MOBDULE.git

Some of the repositories incorporate further repos, so you should also run

git submodule init
git submodule update

inside of the pulled directory.

Client components, like osc or build will work directly after pulling. To run server components you need to continue to read.

Run webui only

This tutorial explains step by step how to check out the webui code, how to get it running locally, and how to contribute back source code changes to the main project.

Run the entire server

Run backend

Run api

Example git commands for developers

Config settings

Some useful settings that get written to your ~/.gitconfig:

 git config --global branch.master.merge refs/heads/master
 git config --global branch.master.remote origin
 git config --global user.name "FirstName LastName"
 git config --global user.email "user@example.com"

Example commands

Some example commands to work on the code. Local commits even work when you have no push rights.

Checkout readonly:

 git clone git://github.com/openSUSE/osc.git
 cd osc
 ./osc-wrapper.py -h

Checkout read/write (needs ssh-key uploaded):

 git clone git@github.com/openSUSE/osc.git

Update:

 git pull

Commit to your repository:

 git commit -a  # -a for all files

Upload your changes (needs remote write access):

 git push

Show the last commit:

 git show HEAD

Show all branches:

coolo@desdemona#osc>git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/jw
  remotes/origin/master

Checkout a branch (first time):

 # note that this is all locally, no server contacted
 git checkout -t origin/jw

Switch between branches:

 # all inplace
 git checkout master
 git checkout jw

Merge another branch (the short way):

git merge origin/master

Merge another branch (the long way):

coolo@desdemona#osc>git merge origin/jw
Auto-merging NEWS
CONFLICT (content): Merge conflict in NEWS
coolo@desdemona#osc>eclipse NEWS
coolo@desdemona#osc>git diff NEWS # see diffs against merge point
coolo@desdemona#osc>git add NEWS # mark as resolved
coolo@desdemona#osc>git commit # commit manual merge

Note the "origin", every remote repository has a name. There can be more than one. As you can clone repositories, you can also register more than one repository "clone" and then merge the changes locally in your repository and push it to a 3rd repository - as I said in the beginning: git is powerful and complex. So start with simple things and get used to the commands. You can also clone the repositories on gitorious and play around as much as you like in those clones - they can be discarded in a second if something went wrong :)


git diff questions

  • how do I make sure, I do not revert a fix in origin/master?
    • Should not happen unless you explicitly do git revert.
  • diff point of my last merge with current branch head
    • git diff abcdef1234 using the commit id of last merge from git log
  • diff point of my last merge with origin/master head
    • git diff abcdef1234..origin/master using the commit id of last merge from git log
  • diff current branch head against current origin/master head
    • just git diff origin/master