[petsc-dev] Branch 'next' has been rewound
Satish Balay
balay at mcs.anl.gov
Wed May 15 14:01:39 CDT 2013
On Mon, 13 May 2013, Jed Brown wrote:
> Satish Balay <balay at mcs.anl.gov> writes:
>
> > On Mon, 13 May 2013, Jed Brown wrote:
> >
> >> == Users ==
> >>
> >> I have rewound the branch 'next' after the release, so it will
> >> not fast-forward (just this once). If you have a local 'next' branch,
> >> you should abandon it and check out a fresh one. You can do this with
> >>
> >> $ git checkout master
> >> $ git branch -D next # delete the old branch
> >> $ git pull
> >> $ git checkout next # revisit 'next' if you want
> >>
> >> If you are tracking 'master', 'git pull' will be sufficient.
> >
> >
> > hm. looks like I'll have to do this for all nightlybuild repos. Is it
> > ok to do it always everynight [and not just during release]?
>
> Yes, it's fine, but since you only need to check out states from
> upstream, you could just use 'git checkout origin/${BRANCH}' (giving you
> a detached HEAD -- nice for this sort of scripting where you have no use
> for "branch semantics").
>
> diff --git i/bin/maint/startnightly w/bin/maint/startnightly
> index e48bfe3..ace1ffc 100755
> --- i/bin/maint/startnightly
> +++ w/bin/maint/startnightly
> @@ -21,7 +21,7 @@ foreach TEST ($*)
> endif
> endif
> echo "Cleaning and updating clone at $USR@$MACH $LOC"
> - $SSH $USR@$MACH $DASHN "cd $LOC ; git checkout -f ${BRANCH}; git pull -q "
> + $SSH $USR@$MACH $DASHN "cd $LOC ; git fetch -q origin; git checkout -f origin/${BRANCH} "
> else
> rsync -e ssh -az --delete $pdir/ ${USR}@${MACH}:${LOC}
> endif
Looks like 'git pull' might not work for a detached head. Is there an
easy way to also have 'git pull' work?
thanks,
Satish
>
> > ------
> > $ git diff
> > diff --git a/bin/maint/startnightly b/bin/maint/startnightly
> > index e48bfe3..a9b31a1 100755
> > --- a/bin/maint/startnightly
> > +++ b/bin/maint/startnightly
> > @@ -21,7 +21,11 @@ foreach TEST ($*)
> > endif
> > endif
> > echo "Cleaning and updating clone at $USR@$MACH $LOC"
> > - $SSH $USR@$MACH $DASHN "cd $LOC ; git checkout -f ${BRANCH}; git pull -q "
> > + if ("${BRANCH}" == "master") then
> > + $SSH $USR@$MACH $DASHN "cd $LOC ; git checkout -f ${BRANCH}; git pull -q "
> > + else
> > + $SSH $USR@$MACH $DASHN "cd $LOC ; git checkout -f master; git branch -D ${BRANCH}; git pull -q ; git checkout -f ${BRANCH}"
> > + endif
> > else
> > rsync -e ssh -az --delete $pdir/ ${USR}@${MACH}:${LOC}
> > endif
>
More information about the petsc-dev
mailing list