Hi all,
Here is a proposed set of changes to the mkbranch script. The first patch is just replacing all tabs in the file by spaces (simple clean-up).
The second is the more important one. It drops the use/support of the -s/--source argument. This argument is currently used to specify from which point to branch when creating a branch in the repo. We argeed that instead of pointing to a specific branch (which would require keeping a mapping somewhere of which branch should be branched from which other branch), we would create the new branch by pointing them to the first commit in the repository. That's what this commit (hopefully) does :)
Thanks, Pierre
Pierre-Yves Chibon (2): Replace tab with spaces Drop the -s/--source branch argument in mkbranch
roles/distgit/files/mkbranch | 102 +++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 58 deletions(-)
--- roles/distgit/files/mkbranch | 94 ++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 47 deletions(-)
diff --git a/roles/distgit/files/mkbranch b/roles/distgit/files/mkbranch index 4e73495..29888a8 100644 --- a/roles/distgit/files/mkbranch +++ b/roles/distgit/files/mkbranch @@ -41,53 +41,53 @@ Usage: The /master suffix on branch names is assumed.
Options: - -s,--source=<src_branch> Use <src_branch> as the source branch. - Defaults is master + -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 + -n,--test Don't do nothing, only test -i,--ignore Ignore erroneous modules - -h,--help This help message - -v,--verbose Increase verbosity + -h,--help This help message + -v,--verbose Increase verbosity EOF }
# parse the arguments while [ -n "$1" ] ; do case "$1" in - -h | --help ) - Usage - exit 0 - ;; - - -v | --verbose ) - VERBOSE=$(($VERBOSE + 1)) - ;; - - -i | --ignore ) - IGNORE="yes" - ;; - - -n | --test ) - TEST="yes" - ;; - - -s | --source ) - shift - SRC_BRANCH=$1 - ;; - - -b | --branch ) - shift - BRANCH=$1/master - ;; - - * ) - if [ -z "$BRANCH" ] ; then - BRANCH="$1" - else - PACKAGES="$PACKAGES $1" - fi - ;; + -h | --help ) + Usage + exit 0 + ;; + + -v | --verbose ) + VERBOSE=$(($VERBOSE + 1)) + ;; + + -i | --ignore ) + IGNORE="yes" + ;; + + -n | --test ) + TEST="yes" + ;; + + -s | --source ) + shift + SRC_BRANCH=$1 + ;; + + -b | --branch ) + shift + BRANCH=$1/master + ;; + + * ) + if [ -z "$BRANCH" ] ; then + BRANCH="$1" + else + PACKAGES="$PACKAGES $1" + fi + ;; esac shift done @@ -104,8 +104,8 @@ NEWP= for p in $PACKAGES ; do [ $VERBOSE -gt 1 ] && echo "Checking package $p..." if [ ! -d $GITROOT/$p.git ] ; then - echo "ERROR: Package module $p is invalid" >&2 - [ "$IGNORE" = "yes" ] && continue || exit -1 + 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; \ @@ -117,8 +117,8 @@ for p in $PACKAGES ; do 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; \ - [ "$IGNORE" = "yes" ] && continue || exit -1) + (echo "IGNORING: Package module $p already has a branch $BRANCH" >&2; \ + [ "$IGNORE" = "yes" ] && continue || exit -1) NEWP="$NEWP $p" done PACKAGES="$(echo $NEWP)" @@ -164,16 +164,16 @@ for NAME in $PACKAGES ; do #[ $VERBOSE -gt 0 ] && echo "Creating $BRANCH-split tag for $NAME/$SRC_BRANCH..." # Is the above needed? #cvs -Q rtag -f "$BRANCH-split" $TOPLEVEL/$NAME/$SRC_BRANCH || { - #echo "ERROR: Branch split tag for $NAME/$SRC_BRANCH could not be created" >&2 - #exit -2 + #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..." $(pushd $GITROOT/$NAME.git >/dev/null && \ git branch --no-track $BRANCH $SRC_BRANCH && \ popd >/dev/null) || { - echo "ERROR: Branch $NAME $BRANCH could not be created" >&2 + echo "ERROR: Branch $NAME $BRANCH could not be created" >&2 popd >/dev/null - exit -2 + exit -2 } done
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 4 Nov 2014 12:23:33 +0100 Pierre-Yves Chibon pingou@pingoured.fr wrote:
roles/distgit/files/mkbranch | 94 ++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 47 deletions(-)
diff --git a/roles/distgit/files/mkbranch b/roles/distgit/files/mkbranch index 4e73495..29888a8 100644 --- a/roles/distgit/files/mkbranch +++ b/roles/distgit/files/mkbranch @@ -41,53 +41,53 @@ Usage: The /master suffix on branch names is assumed.
Options:
- -s,--source=<src_branch> Use <src_branch> as the source
branch.
Defaults is master
- -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
- -n,--test Don't do nothing, only test -i,--ignore Ignore erroneous modules
- -h,--help This help message
- -v,--verbose Increase verbosity
- -h,--help This help message
- -v,--verbose Increase verbosity
EOF }
# parse the arguments while [ -n "$1" ] ; do case "$1" in
- -h | --help )
Usage
exit 0
;;
- -v | --verbose )
VERBOSE=$(($VERBOSE + 1))
;;
- -i | --ignore )
IGNORE="yes"
;;
- -n | --test )
TEST="yes"
;;
- -s | --source )
shift
SRC_BRANCH=$1
;;
- -b | --branch )
shift
BRANCH=$1/master
;;
- )
if [ -z "$BRANCH" ] ; then
BRANCH="$1"
else
PACKAGES="$PACKAGES $1"
fi
;;
- -h | --help )
Usage
exit 0
;;
- -v | --verbose )
VERBOSE=$(($VERBOSE + 1))
;;
- -i | --ignore )
IGNORE="yes"
;;
- -n | --test )
TEST="yes"
;;
- -s | --source )
shift
SRC_BRANCH=$1
;;
- -b | --branch )
shift
BRANCH=$1/master
;;
- )
if [ -z "$BRANCH" ] ; then
BRANCH="$1"
else
PACKAGES="$PACKAGES $1"
fi
esac shift;;
done @@ -104,8 +104,8 @@ NEWP= for p in $PACKAGES ; do [ $VERBOSE -gt 1 ] && echo "Checking package $p..." if [ ! -d $GITROOT/$p.git ] ; then
- echo "ERROR: Package module $p is invalid" >&2
- [ "$IGNORE" = "yes" ] && continue || exit -1
- 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; \ @@ -117,8 +117,8 @@ for p in $PACKAGES ; do 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; \
- [ "$IGNORE" = "yes" ] && continue || exit -1)
- (echo "IGNORING: Package module $p already has a branch $BRANCH"
&2; \
- [ "$IGNORE" = "yes" ] && continue || exit -1) NEWP="$NEWP $p"
done PACKAGES="$(echo $NEWP)" @@ -164,16 +164,16 @@ for NAME in $PACKAGES ; do #[ $VERBOSE -gt 0 ] && echo "Creating $BRANCH-split tag for $NAME/$SRC_BRANCH..." # Is the above needed? #cvs -Q rtag -f "$BRANCH-split" $TOPLEVEL/$NAME/$SRC_BRANCH || {
- #echo "ERROR: Branch split tag for $NAME/$SRC_BRANCH could
not be created" >&2
- #exit -2
- #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..." $(pushd $GITROOT/$NAME.git >/dev/null && \ git branch --no-track $BRANCH $SRC_BRANCH && \ popd >/dev/null) || {
- echo "ERROR: Branch $NAME $BRANCH could not be created" >&2
- echo "ERROR: Branch $NAME $BRANCH could not be created" >&2 popd >/dev/null
- exit -2
- exit -2 }
done
ACK
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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 4 Nov 2014 12:23:34 +0100 Pierre-Yves Chibon pingou@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
On Tue, Nov 04, 2014 at 12:23:32PM +0100, Pierre-Yves Chibon wrote:
Hi all,
Here is a proposed set of changes to the mkbranch script. The first patch is just replacing all tabs in the file by spaces (simple clean-up).
The second is the more important one. It drops the use/support of the -s/--source argument. This argument is currently used to specify from which point to branch when creating a branch in the repo. We argeed that instead of pointing to a specific branch (which would require keeping a mapping somewhere of which branch should be branched from which other branch), we would create the new branch by pointing them to the first commit in the repository. That's what this commit (hopefully) does :)
Thanks, Pierre
Pierre-Yves Chibon (2): Replace tab with spaces Drop the -s/--source branch argument in mkbranch
roles/distgit/files/mkbranch | 102 +++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 58 deletions(-)
Any thoughts on these changes?
Thanks, Pierre
On Thu, Nov 20, 2014 at 01:22:47PM +0100, Pierre-Yves Chibon wrote:
On Tue, Nov 04, 2014 at 12:23:32PM +0100, Pierre-Yves Chibon wrote:
Hi all,
Here is a proposed set of changes to the mkbranch script. The first patch is just replacing all tabs in the file by spaces (simple clean-up).
The second is the more important one. It drops the use/support of the -s/--source argument. This argument is currently used to specify from which point to branch when creating a branch in the repo. We argeed that instead of pointing to a specific branch (which would require keeping a mapping somewhere of which branch should be branched from which other branch), we would create the new branch by pointing them to the first commit in the repository. That's what this commit (hopefully) does :)
Thanks, Pierre
Pierre-Yves Chibon (2): Replace tab with spaces Drop the -s/--source branch argument in mkbranch
roles/distgit/files/mkbranch | 102 +++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 58 deletions(-)
Any thoughts on these changes?
Nothing? :)
Thanks, Pierre
On Sun, Dec 07, 2014 at 01:40:54AM +0100, Pierre-Yves Chibon wrote:
On Thu, Nov 20, 2014 at 01:22:47PM +0100, Pierre-Yves Chibon wrote:
On Tue, Nov 04, 2014 at 12:23:32PM +0100, Pierre-Yves Chibon wrote:
Hi all,
Here is a proposed set of changes to the mkbranch script. The first patch is just replacing all tabs in the file by spaces (simple clean-up).
The second is the more important one. It drops the use/support of the -s/--source argument. This argument is currently used to specify from which point to branch when creating a branch in the repo. We argeed that instead of pointing to a specific branch (which would require keeping a mapping somewhere of which branch should be branched from which other branch), we would create the new branch by pointing them to the first commit in the repository. That's what this commit (hopefully) does :)
Thanks, Pierre
Pierre-Yves Chibon (2): Replace tab with spaces Drop the -s/--source branch argument in mkbranch
roles/distgit/files/mkbranch | 102 +++++++++++++++++++------------------------ 1 file changed, 44 insertions(+), 58 deletions(-)
Any thoughts on these changes?
Nothing? :)
Ping?
Thanks, Pierre
rel-eng@lists.fedoraproject.org