From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] dim: Disallow remote branch deletions with 'dim push'
Date: Fri, 02 Jun 2023 13:54:19 -0700 [thread overview]
Message-ID: <87o7lxlh50.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <878rd2f9u3.fsf@intel.com>
On Fri, 02 Jun 2023 03:16:20 -0700, Jani Nikula wrote:
>
> On Thu, 01 Jun 2023, Ashutosh Dixit <ashutosh.dixit@intel.com> wrote:
> > An inadvertent 'dim push -d' can delete remote branches. Disallow such
> > remote branch deletions.
>
> Please see https://drm.pages.freedesktop.org/maintainer-tools/CONTRIBUTING.html
>
> >
> > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > ---
> > dim | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/dim b/dim
> > index 126568e..e5899e6 100755
> > --- a/dim
> > +++ b/dim
> > @@ -1029,6 +1029,12 @@ function dim_push_branch
> > fi
> > fi
> >
> > + # Disallow remote branch deletions, say with 'dim push -d'
> > + if [[ "$@" == *"-d"* ]]; then
> > + echoerr "Attempt to delete remote branch, aborting."
> > + return 1
> > + fi
>
> I'm working on adding a server side git pre-receive hook to tackle this
> too, but I guess there's no harm in adding this. The choice of -d for
> dry run was unfortunate, and this helps with the 'dim -d foo' vs 'dim
> foo -d' mistake.
Yup, understood. I thought I'd just send out the patch anyway in case it
was useful.
I have created a merge request for the patch here:
https://gitlab.freedesktop.org/drm/maintainer-tools/-/merge_requests/21
Thanks.
--
Ashutosh
> > +
> > git_push $remote $branch "$@"
> >
> > update_linux_next $branch drm-intel-next drm-intel-next-fixes drm-intel-fixes
>
> --
> Jani Nikula, Intel Open Source Graphics Center
prev parent reply other threads:[~2023-06-02 21:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-02 3:50 [Intel-gfx] [PATCH] dim: Disallow remote branch deletions with 'dim push' Ashutosh Dixit
2023-06-02 4:30 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
2023-06-02 10:16 ` [Intel-gfx] [PATCH] " Jani Nikula
2023-06-02 20:54 ` Dixit, Ashutosh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o7lxlh50.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox