[PATCH] dim: Ensure a branch doesn't exist before creating it

Sean Paul seanpaul at chromium.org
Wed Jan 31 18:22:29 UTC 2018


On Wed, Jan 31, 2018 at 07:12:13PM +0100, Daniel Vetter wrote:
> On Wed, Jan 31, 2018 at 11:24:07AM -0500, Sean Paul wrote:
> > Check the remote for the branch before creating it. Seems like this is
> > a noop if it does exist, aside from creating duplicate entries in the
> > integration config.
> > 
> > Signed-off-by: Sean Paul <seanpaul at chromium.org>
> 
> Thanks for fixing this.
> 
> Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> 
> I'll also push (note to self: really need to get maintaner-tools out of
> drm-intel.git).

Yes please! Although I just looked through the history and it's only had 8
non-intel people contribute for 18 (now 19) commits. I figured there would be
more, tbh.

Thanks for the review and push.

Sean

> -Daniel
> 
> > ---
> >  dim | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/dim b/dim
> > index 73936cea4869..3639ada1854b 100755
> > --- a/dim
> > +++ b/dim
> > @@ -1215,6 +1215,10 @@ function dim_create_branch
> >  	fi
> >  
> >  	remote=$(repo_to_remote $repo)
> > +	if [[ $(git branch -r | grep "$remote/$branch") ]]; then
> > +		echoerr "$branch already exists on $remote"
> > +		return 1
> > +	fi
> >  
> >  	$DRY git branch $branch $start
> >  	git push $DRY_RUN $remote +$branch --set-upstream
> > -- 
> > 2.16.0.rc1.238.g530d649a79-goog
> > 
> > _______________________________________________
> > dim-tools mailing list
> > dim-tools at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dim-tools
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
> _______________________________________________
> dim-tools mailing list
> dim-tools at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dim-tools

-- 
Sean Paul, Software Engineer, Google / Chromium OS


More information about the dim-tools mailing list