bsgit can now also import and export source links, and can now be used as a
fully-featured client for manipulating package sources. There are still a few
rough edges here and there though; don't expect things to be perfect just
In the openSUSE build service, bsgit can be found here:
the git sources have moved to:
Functions beyond source code version control, like accessing status
information and logs, manipulating project and package configurations, are not
supported and should need to be done in osc as before.
SOURCE LINKS, EXPANSION, AND MERGES
There is an important difference between osc and bsgit for source links: Osc
always automatically checks out the latest "expanded version" of the link. To
do that, it merges the latest revision of the source link with the latest
revision of its parent (recursively when the parent is a source link itself).
This has the following effects:
* Checking out a specific revision of a source link will lead to different
results as new parent revisions are made.
* The osc user interface does not offer a way to check which revisions of
which parents have been merged (or not). Changes in a parent do not show
up in "osc log".
* There is no (realistic) way to verify that a merge is correct.
* When a merge fails, the "expanded version" of the source link cannot be
checked out anymore; the merge conflict first has to be resolved (i.e.,
the link first has to be "repaired" with the osc repairlink command).
In contrast, bsgit never automatically merges revisions when checking out a
package; revisions always stays the same no matter if parents have changed.
However, bsgit will tell when a parent has changed so that those merges can be
The merges themselves can then be done manually; for conflict free merges, a
simple "git merge <revision>" will be enough. (In case of conflicts, all
power of git is available.)
BUILD TIME MERGES
Of course we do want to keep the core functionality of source links, which is
to allow changes in parents to propagate and trigger rebuilds of link
packages. The build service will continue to automatically merge the most
recent revisions of source links and their parents for building, and merge
conflicts will lead to build failures just like they do now.
ARBITRARY MERGES, LOSS OF INFORMATION
The build service backend is not capable of storing some of the information
that git knows about: merges are only possible in the form of source links as
described above, there is no distinction between author and commiter, file
modes are not stored, timestamps are computed on the server, there is no
support for non-regular files or subdirectories.
When pushing a commit to the build service, some information is always lost.
Checking out the new revision will lead to the same source files, but with
different meta-information. Therefore, a push to the build service always also
results in a rewrite of the local git repository (so that the local version
matches the build service version).
This is unfortunate as it breaks merging across build service instances and
makes exchanging commits between build service instances much harder, but this
breakage is unavoidable with the current backend.
EXAMPLE 1: ORDINARY PACKAGE
Here is an example of making a change to a normal (non-source link) package.
$ mkdir obs
$ cd obs
$ git init
Initialized empty Git repository
$ bsgit fetch home:agruen:Factory/bsgit
Fetching home:agruen:Factory/bsgit (1)
Fetching home:agruen:Factory/bsgit (2)
Fetching home:agruen:Factory/bsgit (3)
Fetching home:agruen:Factory/bsgit (4)
Fetching home:agruen:Factory/bsgit (5)
Fetching home:agruen:Factory/bsgit (6)
Branch 'bsgit' created.
# change something
# git commit
$ bsgit push
Cannot map email 'agruen(a)suse.de' to a build service account name. Please use
the usermap command.
$ bsgit usermap agruen agruen(a)novell.com agruen(a)suse.de
$ bsgit push
Pushing 1 commit
Fetching home:agruen:Factory/bsgit (7)
Branch 'bsgit' rebased from 51cbd2c to ed5842a.
Note that pushing the local changes back to the build service results in a
rebase of the local git repository (see ARBITRARY MERGES, INFORMATION LOSS
EXAMPLE 2: SOURCE LINK AS FORK
$ osc linkpac home:agruen:Factory/bsgit home:agruen/mybsgit
$ bsgit fetch home:agruen/mybsgit
Warning: home:agruen/mybsgit (1): link target guessed as \
bsgit(4f929e86345b9bd90364eec685756a98) based on timestamps.
Fetching home:agruen/mybsgit (1)
Branch 'mybsgit' created.
This warning indicates that the build service meta-data do not define which
revision of home:agruen:Factory/bsgit revision 1 of home:agruen/mybsgit is
based on. (This has been reported as bug https://bugzilla.novell.com/516795
$ git checkout mybsgit
# change something, git commit
$ bsgit push
$ osc submitrequest home:agruen/mybsgit home:agruen:Factory/bsgit
created request id 15351
$ osc request accept 15351 --message="reviewed ok."
<status code="ok" />
$ bsgit pull home:agruen:Factory/bsgit
Fetching home:agruen:Factory/bsgit (9)
Branch 'bsgit' updated.
EXAMPLE 3: SOURCE LINK AND MERGE
$ osc linkpac home:agruen:Factory/bsgit home:agruen/mybsgit2
$ bsgit fetch home:agruen/mybsgit2
$ git checkout mybsgit2
# Change something in mybsgit2
# Commit something to home:agruen:Factory/bsgit
$ bsgit pull home:agruen/mybsgit2
Package home:agruen/mybsgit2 not based on the latest expansion of \
home:agruen:Factory/bsgit (commit 9cd5476); \
you may want to merge.
$ git merge
Merge made by recursive.
$ bsgit push
Pushing 1 commit
Fetching home:agruen/mybsgit2 (3)
Branch 'mybsgit2' rebased from ac4bc7b to 79760ba.
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-buildservice+help(a)opensuse.org