[PATCH 2/2] Drop the -s/--source branch argument in mkbranch

Dennis Gilmore dennis at ausil.us
Mon Jan 12 22:22:08 UTC 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tue,  4 Nov 2014 12:23:34 +0100
Pierre-Yves Chibon <pingou at pingoured.fr> wrote:

> In the process of automating the git branch creation based on fedmsg
> message we can no longer rely on passing a -s/--source branch argument
> to the mkbranch script.
> As decided in https://fedorahosted.org/rel-eng/ticket/5931 the
> branches will be created with the first commit of the master branch.
> 
> This commit thus drops the use of -s/--source and SRC_BRANCH in favor
> of creating the branch with the first commit of the master branch:
> git branch --no-track $BRANCH `git rev-list --max-parents=0 master`
> ---
>  roles/distgit/files/mkbranch | 20 +++-----------------
>  1 file changed, 3 insertions(+), 17 deletions(-)
> 
> diff --git a/roles/distgit/files/mkbranch
> b/roles/distgit/files/mkbranch index 29888a8..2752680 100644
> --- a/roles/distgit/files/mkbranch
> +++ b/roles/distgit/files/mkbranch
> @@ -41,8 +41,6 @@ Usage:
>      The /master suffix on branch names is assumed.
>  
>  Options:
> -    -s,--source=<src_branch>    Use <src_branch> as the source
> branch.
> -                Defaults is master
>                                  /master suffix on other branches
> assumed -n,--test           Don't do nothing, only test
>      -i,--ignore                 Ignore erroneous modules
> @@ -71,10 +69,6 @@ while [ -n "$1" ] ; do
>          TEST="yes"
>          ;;
>  
> -    -s | --source )
> -        shift
> -        SRC_BRANCH=$1
> -        ;;
>  
>      -b | --branch )
>          shift
> @@ -107,14 +101,6 @@ for p in $PACKAGES ; do
>      echo "ERROR: Package module $p is invalid" >&2
>      [ "$IGNORE" = "yes" ] && continue || exit -1
>      fi
> -    if [ -z "$(GIT_DIR=$GITROOT/$p.git git rev-parse -q --verify
> $SRC_BRANCH)" ] ; then \
> -        echo "ERROR: Invalid source branch '$SRC_BRANCH' for package
> $p" >&2; \
> -        if [ $SRC_BRANCH == 'master' ]; then
> -           [ "$IGNORE" = "yes" ] && continue
> -        else
> -           SRC_BRANCH=master
> -        fi
> -    fi
>      $(GIT_DIR=$GITROOT/$p.git git rev-parse -q --verify \
>        $BRANCH >/dev/null) && \
>      (echo "IGNORING: Package module $p already has a branch $BRANCH"
> >&2; \ @@ -152,7 +138,7 @@ fi
>  # For every module, "create" the branch
>  for NAME in $PACKAGES ; do
>      echo
> -    echo "Creating new module branch '$BRANCH' for '$NAME' from
> branch '$SRC_BRANCH'..."
> +    echo "Creating new module branch '$BRANCH' for '$NAME'..."
>  
>      # permissions checks for this particular module
>      if [ ! -w $GITROOT/$NAME.git/refs/heads/  ] ; then
> @@ -167,9 +153,9 @@ for NAME in $PACKAGES ; do
>      #echo "ERROR: Branch split tag for $NAME/$SRC_BRANCH could not
> be created" >&2 #exit -2
>      #}
> -    [ $VERBOSE -gt 0 ] && echo "Creating $NAME $BRANCH from $NAME
> $SRC_BRANCH..."
> +    [ $VERBOSE -gt 0 ] && echo "Creating $NAME $BRANCH from
> $NAME ..." $(pushd $GITROOT/$NAME.git >/dev/null && \
> -    git branch --no-track $BRANCH $SRC_BRANCH && \
> +    git branch --no-track $BRANCH `git rev-list --max-parents=0
> master` && \ popd >/dev/null) || {
>      echo "ERROR: Branch $NAME $BRANCH could not be created" >&2
>          popd >/dev/null

ACK
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJUtEkQAAoJEH7ltONmPFDRI38P/iFnnN+DB79FfmpPxd8ZBOz3
IE6u0uvmOTZBy+QysT40m9H5//gYWf/zxk9sL1w3AHd7tObpV8LIazGvCd2ZohNF
QbPgfas+mjwmLxjZDp5p3r9dSOWWebLK3TpRXU7U/6LsvX4N/moF15lGjRjPcILI
fPKrmZL88+xA8UzGFMefT69qpY5kNrESsubs2pGUONKH5cys9qXP4ySobMGNNtVC
G+Sq5fJk8C5T1vF4usaAgkc/TJJnprKhUZQXnD7h050P/jL43uIIc5OAyNyrI2Nw
HYHORw0/kUj4eWnfVpdbZC5NMXC7Q7OCbzZzDu+/fJnbg8ohWht5jl3WCfvEuuUj
LwShJxA+YqLHKnBTVgOboxAV3G1dNoCtcjGIds3opQtILdB7w4Tqq/L5ugMmbe9l
v1dbMmIf8S+zFbTsPXI9sv5rpWD3b7WkFyy75Pa2TO09dxgUJV0BaXEbmFpjTvgM
ZDfyB9qm8UUBu0XZcDH108m93vy4weIhvcgnKZ2vhUbiT6BDH52uqD8Y3dHiVv71
AFlm/59XrxVrbGdCyPC9FsFoD1oykxLfjsLA7X2NDfmzAyvsxyA5yjgNDTg+TXce
dx5kZm/5mvAp9nnf093xCprIhVVg0Tc+/OUNIAaT7vAX0tE4JR8D+bvbMaZfhHnp
4tNYVTtZ1Gdb4UsLKtb7
=HJiz
-----END PGP SIGNATURE-----


More information about the rel-eng mailing list