[PATCH] dim: Create git_push helper

Daniel Vetter daniel.vetter at ffwll.ch
Wed Aug 7 16:32:25 UTC 2019


On Wed, Aug 7, 2019 at 5:32 PM Sam Ravnborg <sam at ravnborg.org> wrote:
>
> Hi Daniel.
>
> On Wed, Aug 07, 2019 at 04:18:42PM +0200, Daniel Vetter wrote:
> > Just a bit of ocd ... One functional change is the switch from $DRY to
> > the $DRY_RUN flag in dim_pull_request. That one didn't have a
> > justification, and the one for the other place in dim_create_branch
> > didn't seem to apply really.
> >
> > v2: don't substitute too much (Arek)
> >
> > Cc: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> > ---
> >  dim | 29 +++++++++++++++++------------
> >  1 file changed, 17 insertions(+), 12 deletions(-)
> >
> > diff --git a/dim b/dim
> > index f1b43552cb59..7ecbaacfbf87 100755
> > --- a/dim
> > +++ b/dim
> > @@ -385,6 +385,11 @@ function git_committer_email
> >       echo $committer_email
> >  }
> >
> > +function git_push
> > +{
> > +     git push $dim_fdo_cookie $DRY_RUN "$@"
> > +}
>
> How about a second variant:
> function git_push_silent
> {
>         git_push "$@" >& /dev/null
> }
>
> > +
> >  function check_for_updates
> >  {
> >       local stamp stampfile
> > @@ -531,14 +536,14 @@ function update_linux_next # branch next next-fixes fixes
> >
> >       # always update drm-intel-fixes
> >       echo -n "Pushing $linux_fixes to for-linux-next-fixes... "
> > -     git push $dim_fdo_cookie $DRY_RUN $remote +$remote/$linux_fixes:for-linux-next-fixes # >& /dev/null
> > +     git_push $remote +$remote/$linux_fixes:for-linux-next-fixes # >& /dev/null
> > +     git_push_silent $remote +$remote/$linux_fixes:for-linux-next-fixes # >& /dev/null
> >       echo "Done."
> >
> >       if git merge-base --is-ancestor $remote/$linux_next_fixes $remote/$linux_fixes ; then
> >               # -fixes has caught up to dinf, i.e. we're out of the merge
> >               # window. Push the next queue.
> >               echo -n "Out of merge window. Pushing $linux_next to for-linux-next... "
> > -             git push $dim_fdo_cookie $DRY_RUN $remote +$remote/$linux_next:for-linux-next >& /dev/null
> And then use:
> > +             git_push_silent $remote +$remote/$linux_next:for-linux-next
>
>
>
> When I look closer there are only three users of ">& /dev/null"
> as the first user has the redirect commented out since
> commit 0dee4cb65f405c8f32 ("dim: Make update_linux_next multi-repo compliant")
>
> So maybe not worth it...

Hm I think that was an oversight in that patch, with the multi-repo
architecture these pushes should never fail. I guess I commented one
out for testing and then promptly forgot about the others. I'll do
another patch to remedy this.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the dim-tools mailing list