All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ashutosh Dixit <ashutosh.dixit@intel.com>,
	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:16:20 +0300	[thread overview]
Message-ID: <878rd2f9u3.fsf@intel.com> (raw)
In-Reply-To: <20230602035010.1517899-1-ashutosh.dixit@intel.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ashutosh Dixit <ashutosh.dixit@intel.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] dim: Disallow remote branch deletions with 'dim push'
Date: Fri, 02 Jun 2023 13:16:20 +0300	[thread overview]
Message-ID: <878rd2f9u3.fsf@intel.com> (raw)
In-Reply-To: <20230602035010.1517899-1-ashutosh.dixit@intel.com>

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

  parent reply	other threads:[~2023-06-02 10:16 UTC|newest]

Thread overview: 7+ 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  3:50 ` Ashutosh Dixit
2023-06-02  4:30 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
2023-06-02 10:16 ` Jani Nikula [this message]
2023-06-02 10:16   ` [PATCH] " Jani Nikula
2023-06-02 20:54   ` [Intel-gfx] " Dixit, Ashutosh
2023-06-02 20:54     ` Dixit, Ashutosh

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=878rd2f9u3.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 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.