Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] dim: Disallow remote branch deletions with 'dim push'
@ 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 ` [Intel-gfx] [PATCH] " Jani Nikula
  0 siblings, 2 replies; 4+ 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] 4+ messages in thread

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox