From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id EABFE1F8C1 for ; Thu, 7 May 2020 12:25:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726625AbgEGMZv (ORCPT ); Thu, 7 May 2020 08:25:51 -0400 Received: from cloud.peff.net ([104.130.231.41]:40082 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1725923AbgEGMZv (ORCPT ); Thu, 7 May 2020 08:25:51 -0400 Received: (qmail 31209 invoked by uid 109); 7 May 2020 12:25:50 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Thu, 07 May 2020 12:25:50 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 16407 invoked by uid 111); 7 May 2020 12:25:53 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Thu, 07 May 2020 08:25:53 -0400 Authentication-Results: peff.net; auth=none Date: Thu, 7 May 2020 08:25:49 -0400 From: Jeff King To: Junio C Hamano Cc: =?utf-8?B?xJBvw6BuIFRy4bqnbiBDw7RuZw==?= Danh , Taylor Blau , git@vger.kernel.org, Jeff Hostetler , Johannes Schindelin Subject: Re: [PATCH v2 1/2] CI: limit GitHub Actions to designated branches Message-ID: <20200507122549.GB3057274@coredump.intra.peff.net> References: <20200504233634.GB39798@coredump.intra.peff.net> <20200505002055.GC64230@syl.local> <20200505164326.GA64077@coredump.intra.peff.net> <20200505182418.GA66702@coredump.intra.peff.net> <20200505210451.GA645290@coredump.intra.peff.net> <20200506004612.GE927@danh.dev> <20200506142500.GA2429@danh.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, May 06, 2020 at 09:31:25AM -0700, Junio C Hamano wrote: > Đoàn Trần Công Danh writes: > > > On 2020-05-05 20:56:58-0700, Junio C Hamano wrote: > >> Đoàn Trần Công Danh writes: > >> > +-------------- > >> > +$ git checkout --orphan ci-config > >> > +$ cp contrib/ci-config-allow-ref allow-ref > >> > +$ $EDITOR allow-ref > >> > +$ git rm -rf . > >> > >> This sounds horrible. You just nuked the entire files in the > >> working tree you use for your everyday Git hacking to edit a > >> single file. > > > > It isn't that horrible as it sounds. It only removes the files that are > > currently added in index, which is the same with tracked files in old > > branch, and we can get it back by switching back to old branch. > > > > I decided to make an orphanage branch because I would like to save > > time and network bandwidth for the "check-ci" jobs. > > I didn't say it is wrong to record a tree with a single file > (allow-ref) in a commit that is pointed by the ci-config ref. > > I would have expected you to create such a commit in an otherwise > empty repository, and push into your fork of Git at GitHub. That > way, you won't have to checkout and/or refresh the index all of the > 3800+ files. Yeah, I agree that all of the mechanisms for dealing with the unrelated history are somewhat awkward. Another issue is that you can't just: git clone --single-branch -b refs/ci/config my-config to work on it, because "-b" wants only heads or tags (we could address that by putting it in refs/heads/ci-config or similar). If we do go the javascript route, perhaps it would make sense for refs/ci/config to be a single blob containing a snippet of javascript with several functions. And then we could just eval() that and call the appropriate functions (if defined). Then a sample can live in the main repo with something like: # This file contains functions which will be run by the GitHub # Actions CI script. # # You may customize it for your own fork by modifying it on any branch # you like, and installing with: # # git push $(git rev-parse HEAD:ci/config):refs/ci/config # # [allow_ref() sample definition and documentation....] That sidesteps most of those issues. -Peff