All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dim: Disallow remote branch deletions with 'dim push'
@ 2023-06-02  3:50 ` Ashutosh Dixit
  0 siblings, 0 replies; 7+ messages in thread
From: Ashutosh Dixit @ 2023-06-02  3:50 UTC (permalink / raw)
  To: intel-gfx, dri-devel

An inadvertent 'dim push -d' can delete remote branches. Disallow such
remote branch deletions.

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
+
 	git_push $remote $branch "$@"
 
 	update_linux_next $branch drm-intel-next drm-intel-next-fixes drm-intel-fixes
-- 
2.38.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Intel-gfx] [PATCH] dim: Disallow remote branch deletions with 'dim push'
@ 2023-06-02  3:50 ` Ashutosh Dixit
  0 siblings, 0 replies; 7+ messages in thread
From: Ashutosh Dixit @ 2023-06-02  3:50 UTC (permalink / raw)
  To: intel-gfx, dri-devel

An inadvertent 'dim push -d' can delete remote branches. Disallow such
remote branch deletions.

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
+
 	git_push $remote $branch "$@"
 
 	update_linux_next $branch drm-intel-next drm-intel-next-fixes drm-intel-fixes
-- 
2.38.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [Intel-gfx] ✗ Fi.CI.BUILD: failure for dim: Disallow remote branch deletions with 'dim push'
  2023-06-02  3:50 ` [Intel-gfx] " Ashutosh Dixit
  (?)
@ 2023-06-02  4:30 ` Patchwork
  -1 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2023-06-02  4:30 UTC (permalink / raw)
  To: Ashutosh Dixit; +Cc: intel-gfx

== Series Details ==

Series: dim: Disallow remote branch deletions with 'dim push'
URL   : https://patchwork.freedesktop.org/series/118744/
State : failure

== Summary ==

Error: patch https://patchwork.freedesktop.org/api/1.0/series/118744/revisions/1/mbox/ not applied
Applying: dim: Disallow remote branch deletions with 'dim push'
error: sha1 information is lacking or useless (dim).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 dim: Disallow remote branch deletions with 'dim push'
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Build failed, no error log produced



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] dim: Disallow remote branch deletions with 'dim push'
  2023-06-02  3:50 ` [Intel-gfx] " Ashutosh Dixit
@ 2023-06-02 10:16   ` Jani Nikula
  -1 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2023-06-02 10:16 UTC (permalink / raw)
  To: Ashutosh Dixit, intel-gfx, dri-devel

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.

BR,
Jani.


> +
>  	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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Intel-gfx] [PATCH] dim: Disallow remote branch deletions with 'dim push'
@ 2023-06-02 10:16   ` Jani Nikula
  0 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2023-06-02 10:16 UTC (permalink / raw)
  To: Ashutosh Dixit, intel-gfx, dri-devel

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.

BR,
Jani.


> +
>  	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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] dim: Disallow remote branch deletions with 'dim push'
  2023-06-02 10:16   ` [Intel-gfx] " Jani Nikula
@ 2023-06-02 20:54     ` Dixit, Ashutosh
  -1 siblings, 0 replies; 7+ messages in thread
From: Dixit, Ashutosh @ 2023-06-02 20:54 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, dri-devel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Intel-gfx] [PATCH] dim: Disallow remote branch deletions with 'dim push'
@ 2023-06-02 20:54     ` Dixit, Ashutosh
  0 siblings, 0 replies; 7+ messages in thread
From: Dixit, Ashutosh @ 2023-06-02 20:54 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx, dri-devel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-06-02 21:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02  3:50 [PATCH] dim: Disallow remote branch deletions with 'dim push' Ashutosh Dixit
2023-06-02  3:50 ` [Intel-gfx] " Ashutosh Dixit
2023-06-02  4:30 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
2023-06-02 10:16 ` [PATCH] " Jani Nikula
2023-06-02 10:16   ` [Intel-gfx] " Jani Nikula
2023-06-02 20:54   ` Dixit, Ashutosh
2023-06-02 20:54     ` [Intel-gfx] " Dixit, Ashutosh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.