gbs-devel手册

名称

gbs devel - 在分开打包分支模式下,为了便于包的管理者更好地在orphan-packaging分支管理打包的分支,我们提供以下操作:

  • start - 创建一个新的开发分支,并将上游版本内嵌在其名字中。
  • export - 将补丁从一个开发分支导出到对应的打包分支。
  • drop - 去除不需要的开发分支。
  • switch - 在打包分支和对应的开发分支之间切换。
  • convert - 将一个包转换到分开打包分支模式。

对于分开打包和联合打包两种管理模式的不同点,请参考GBS支持的维护模式。

一个工作流程的例子如下:

# maintainer: create upstream branch and packaging branch (initial packaging)
...
# maintainer: push packaging and upstream branches (and tags) to Git/Gerrit
$ git push --tags origin upstream master
 
# maintainer: start development branch
$ gbs devel start
 
# maintainer: push development branch to Git/Gerrit
$ git push origin development/master/1.0
 
# developer: clone package
$ gbs clone git://review.tizen.org/example.git
 
# developer: modify code, test, commit on development branch
$ ...
$ gbs build
 
# developer: push changes for review
$ git push origin development/master/1.0:refs/for/development/master/1.0
 
# maintainer: after review, merge changes in Gerrit
# maintainer: generate patches, update packaging/release branch
$ gbs devel export
$ git add .
$ git commit -m"New change"
 
# maintainer: push packaging branch for review
$ git push master:refs/for/master
 
# maintainer: once merged, submit for integration
$ gbs submit

简介

  • 子命令

    gbs devel <Second_Level_Subcommand> [Options]
    
  • 二级子命令

    gbs devel help
    gbs devel start
    gbs devel export
    gbs devel switch
    gbs devel drop
    gbs devel convert
    

描述

在分开打包分支模式下,这个命令使得包的管理者能更好地维护打包分支。 gbs devel由于具有大量的二级子命令,用户可以用其做以下工作:

  • gbs devel start

    通过以下操作创建一个新的开发分支:

    • 使用上游版本作为基础来创建一个本地的拷贝
    • 将打包分支的所有补丁都应用在本地分支的顶部
    • 从打包分支导入.gbs.conf文件

    上游版本内嵌在开发分支的名字中。 所以,在做版本时,我们必须使用gbs devel start创建一个新的开发分支。

    在使用 gbs devel start之前,除了其他的打包文件之外,包含所有本地改动的分开打包分支必须可用且已经准备好。

    一个示例如下所示:

    $ git branch
    * tizen
    upstream
    $ gbs devel start
    info: Using 'packaging/dbus.spec' from 'working copy'
    info: Switching to branch 'development/tizen/1.0'
    info: Importing additional file(s) from branch 'tizen' into 'development/tizen/1.0'
    info: Trying to apply patches from branch 'tizen' onto '159fdbf680d2dcdd5f80568c3305e93114caddfa'
    info: Patches listed in 'dbus.spec' imported on 'development/tizen/1.0'
    info: Updating local .gbs.conf
    info: Committing local .gbs.conf to git
    $ git branch
    * development/tizen/1.0
    tizen
    upstream
    

    :每个上游版本必须有一个专门的开发分支,在本示例中,development/tizen/1.0对应于上游版本1.0。

  • gbs devel export

    将补丁导出到打包分支:

    • 从开发分支产生补丁(每次提交一个)
    • 更新对应的spec文件

    :这个命令不会自动提交修改,代码包的维护者需要手动地验证这些修改并提交。

    一个示例如下所示:

    $ git branch
    * development/tizen/1.1
    upstream
    tizen
    $ gbs devel export
    info: Exporting patches to packaging branch
    info: On branch 'development/tizen/1.1', switching to 'tizen'
    info: Generating patches from git (6450890aa002b0868537ee50cc1aea177fdcc941..development/tizen/1.1)
    # On branch tizen
    # Changes not staged for commit:
    # (use "git add/rm <file>..." to update what will be committed)
    # (use "git checkout -- <file>..." to discard changes in working directory)
    #
    # modified: packaging/gbp-test.spec
    #
    # Untracked files:
    # (use "git add <file>..." to include in what will be committed)
    #
    # packaging/0004-New-commit.patch
    no changes added to commit (use "git add" and/or "git commit -a")
    
  • gbs devel switch

    在打包分支和对应的开发分支之间切换。

    一个示例如下所示:

    $ git branch
    development/tizen/1.1
    * tizen
    upstream
    $ gbs devel switch
    info: Switching to branch 'development/tizen/1.1'
    $ git branch
    * development/tizen/1.1
    tizen
    upstream
    $ gbs devel switch
    info: Switching to branch 'tizen'
    $ git branch
    development/tizen/1.1
    * tizen
    upstream
    
  • gbs devel drop

    删除上游版本指向的开发分支。

    用户必须在打包分支上删除对应的开发分支。 注意,只能去除当前版本所指示的开发分支,例如,当前的版本号是2.0,我们可获得的分支有development/tizen/1.0和development/tizen/2.0,只能删除development/tizen/2.0。

  • gbs convert

    将一个代码包从联合打包管理模式和git-layout转换到分开打包模式:

    • 将packaging目录下的内容作为基础
    • 自动产生补丁并将补丁放到一个新的分开打包分支下

    所以,它基本上包含了gbs export的输出减去源代码tarball。

    GBS使用 --retain-history,试着保存本地修改历史。 基本上,对于联合打包分支下的每一个提交,在新的分开打包分支下,都产生一个对应的提交。

    一个示例如下所示:

    $ git branch
    * tizen
    upstream
    $ gbs devel convert
    info: Converting package to orphan-packaging git layout
    info: Importing packaging files from branch 'tizen' to 'tizen-orphan'
    info: Generating patches from git (04e9d5867181807acae3b89f8ebc1f517c246933..d2ab912babf1ee161004b041ca2bd70f3ff7de0c)
    info: Package successfully converted to orphan-packaging.
    info: You're now on the new 'tizen-orphan' packaging branch (the old packaging branch 'tizen' was left intact).
    info: Please check all files and test building the package!
    info: You can now create the development branch with 'gbs devel start'
    $ git branch
    tizen
    * tizen-orphan
    upstream
    

    该转换操作仅创建分开打包分支。 所以,必须使用gbs devel start来创建开发分支。

参数

针对子命令的可选参数

--retain-history Preserve the history of the local changes.