Re: [PATCH v2 1/2] CI: limit GitHub Actions to designated branches
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 6, 2020, 16:31 UTC
- Message-ID
- <xmqqa72l81pe.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200506142500.GA2429@danh.dev>
Đoàn Trần Công Danh <congdanhqx@gmail.com> writes:
Show 18 quoted lines
> On 2020-05-05 20:56:58-0700, Junio C Hamano <gitster@pobox.com> wrote: >> Đoàn Trần Công Danh <congdanhqx@gmail.com> 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.
> I wonder whether the "git rm -rf ." makes that block sounds horrible? > If that is the case, we can use the experimental git-switch(1) > instead, it's doing more-or-less the same (or is it the same?) with > "git checkout --orphan" and "git rm -rf ."
That does not change anything, as abuse of your primary repository is what offends me.