[PATCH 5/7] qf: Don't check baseline on qf pull.

Rodrigo Vivi rodrigo.vivi at intel.com
Tue Jan 23 19:35:23 UTC 2018


On Tue, Jan 23, 2018 at 07:01:50PM +0000, Lucas De Marchi wrote:
> On Tue, Jan 23, 2018 at 10:56:17AM -0800, Rodrigo Vivi wrote:
> > On Tue, Jan 23, 2018 at 06:50:23PM +0000, Lucas De Marchi wrote:
> > > On Mon, Jan 22, 2018 at 12:00:38PM -0800, Rodrigo Vivi wrote:
> > > > At this point we are only pulling the branches so in a
> > > > distributed environment it is expected that you don't
> > > > have the latest baseline on your environment yet.
> > > > 
> > > > For years, all qf users were doing the initial pull
> > > > manually or with other wrap scripts. so, let's fix
> > > > it now and properly just use qf for initial pull and
> > > > start the rebase process.
> > > > 
> > > > Cc: Paulo Zanoni <paulo.r.zanoni at intel.com>
> > > > Cc: Michel Thierry <michel.thierry at intel.com>
> > > > Cc: James Ausmus <james.ausmus at intel.com>
> > > > Cc: Lucas De Marchi <lucas.demarchi at intel.com>
> > > > Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> > > > ---
> > > >  qf | 10 +++++++---
> > > >  1 file changed, 7 insertions(+), 3 deletions(-)
> > > > 
> > > > diff --git a/qf b/qf
> > > > index 4989f3691e04..1e8ae75b4f46 100755
> > > > --- a/qf
> > > > +++ b/qf
> > > > @@ -74,7 +74,7 @@ function quiet_pop_all
> > > >  	quilt pop -a -q "$@" > /dev/null || test $? = 2
> > > >  }
> > > >  
> > > > -function repo_check # allow-detached
> > > > +function repo_start # allow-detached
> > > >  {
> > > >  	cd patches
> > > >  	quilt_branch=$(git rev-parse --abbrev-ref HEAD)
> > > > @@ -98,6 +98,11 @@ function repo_check # allow-detached
> > > >  
> > > >  	# shellcheck source=/dev/null
> > > >  	baseline=$(source patches/config ; echo ${BASELINE:-})
> > > > +}
> > > > +
> > > > +function repo_check # allow-detached
> > > > +{
> > > > +	repo_start $1
> > > >  
> > > >  	if [[ $(git rev-parse HEAD) != "$baseline" ]] ; then
> > > 
> > > does this really work? You split the functions but $baseline is not
> > > global so I guess here you are actually comparing to an empty string?
> > 
> > 
> > I asked myself the same question... so I opened a new .sh here and did some experiments to convince myself.
> > 
> > if that didn't work many things on qf would be broken because $branch would be empty everywhere
> > so git commands would fail...
> 
> 
> oh, nm. For a moment I thought baseline was local to repo_start. In bash
> the variables pollute the env if not declared as local, and the entire
> qf script relies on that.

yeap... I thought the same...
apparently a lot of room for improvemente there ;)

> 
> So
> 
> Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>

thanks

> 
> Lucas De Marchi


More information about the dim-tools mailing list