From: Ashutosh Dixit <ashutosh.dixit@intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH] dim: Disallow remote branch deletions with 'dim push'
Date: Thu, 1 Jun 2023 20:50:10 -0700 [thread overview]
Message-ID: <20230602035010.1517899-1-ashutosh.dixit@intel.com> (raw)
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
next reply other threads:[~2023-06-02 3:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-02 3:50 Ashutosh Dixit [this message]
2023-06-02 4:30 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for dim: Disallow remote branch deletions with 'dim push' Patchwork
2023-06-02 10:16 ` [Intel-gfx] [PATCH] " Jani Nikula
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=20230602035010.1517899-1-ashutosh.dixit@intel.com \
--to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox