From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6A94AC77B7A for ; Fri, 2 Jun 2023 21:03:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A1B7910E066; Fri, 2 Jun 2023 21:03:01 +0000 (UTC) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8BD1D10E066; Fri, 2 Jun 2023 21:02:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685739779; x=1717275779; h=date:message-id:from:to:cc:subject:in-reply-to: references:mime-version; bh=0U1ah8nSu1lBPePwPLyTAl4eLT52mJQyko6Uw982z8o=; b=gFOBPQXGWmRc2xlwuVlLK89+dpJrI+UJKYXgykIKjnIxZH/Y3WqXTd10 EeFgVK/MeDT12teUugS1uuBreRwdF9U+GLXi2FaBwZn2JNfRRLuZZ/3dg QGhFqfXKccXk7VDY1jjUZ+JO0fCzwyfkVyS637Le8V7tFaJThFbpQSrHZ gPTb+saoMgIfaOlt2ir6prHK+9uoa1jqxpI+zatQXj24G5iu3Hal5vJct Mq9IQLrtXMq3PPwB5CDFtH5fpDk2lkO0LrP8H6fxa8a4Pb4WPwB4z33AE Mgi8zn3G9QUNYY3Kb5mmlgwMpGTtD+Jlkyi9J6W5Oz80u3HXFBVWO6bva g==; X-IronPort-AV: E=McAfee;i="6600,9927,10729"; a="335584666" X-IronPort-AV: E=Sophos;i="6.00,214,1681196400"; d="scan'208";a="335584666" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2023 14:02:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10729"; a="820420014" X-IronPort-AV: E=Sophos;i="6.00,214,1681196400"; d="scan'208";a="820420014" Received: from adixit-mobl.amr.corp.intel.com (HELO adixit-arch.intel.com) ([10.209.18.212]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2023 14:02:58 -0700 Date: Fri, 02 Jun 2023 13:54:19 -0700 Message-ID: <87o7lxlh50.wl-ashutosh.dixit@intel.com> From: "Dixit, Ashutosh" To: Jani Nikula In-Reply-To: <878rd2f9u3.fsf@intel.com> References: <20230602035010.1517899-1-ashutosh.dixit@intel.com> <878rd2f9u3.fsf@intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Subject: Re: [Intel-gfx] [PATCH] dim: Disallow remote branch deletions with 'dim push' X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, 02 Jun 2023 03:16:20 -0700, Jani Nikula wrote: > > On Thu, 01 Jun 2023, Ashutosh Dixit 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 > > --- > > 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