Re: main != master at github.com/git/git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 15, 2023 at 08:29:43PM +0100, Andy Koppe wrote:
> On 15/08/2023 20:01, Junio C Hamano wrote:
> > > See [1], where main currently is at v2.41.0.
> > >
> > > [1] https://github.com/git/git/tree/main
> >
> > Ah, that one.  The CI job is unfortunately attached to that tree and
> > updating 'master' and 'main' with the same commit at the same time
> > wastes CI cycles, so I had to tentatively stop updating it.
> >
> > It used to be that 'main' was set to lag behind 'master' by 24 hours
> > or so to prevent the problem---CI notices that the commit updated
> > 'main' has been already dealt with 24 hours ago at 'master' and
> > refrains from wasting time on it.  But resurrecting it would still
> > make folks confused about how 'main' is different from 'master'.
> > Perhaps it is a good time to remove stale 'main' and keep only
> > 'master' there?
>
> An alternative might be to exclude one of the branches in the workflow file,
> as per [1].

I think that this should be relatively straightforward to do, and would
be preferable to dropping 'main'.

Here's an (untested) patch that should do the trick:

--- >8 ---
diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml
index a58e2dc8ad..764f46b21f 100644
--- a/.github/workflows/check-whitespace.yml
+++ b/.github/workflows/check-whitespace.yml
@@ -8,6 +8,8 @@ name: check-whitespace
 on:
   pull_request:
     types: [opened, synchronize]
+    branches_ignore:
+      - main

 # Avoid unnecessary builds. Unlike the main CI jobs, these are not
 # ci-configurable (but could be).
diff --git a/.github/workflows/l10n.yml b/.github/workflows/l10n.yml
index 6c3849658a..f6767a73d2 100644
--- a/.github/workflows/l10n.yml
+++ b/.github/workflows/l10n.yml
@@ -1,6 +1,12 @@
 name: git-l10n

-on: [push, pull_request_target]
+on:
+  push:
+    branches_ignore:
+      - main
+  pull_request_target:
+    branches_ignore:
+      - main

 # Avoid unnecessary builds. Unlike the main CI jobs, these are not
 # ci-configurable (but could be).
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 079645b776..eaaf6a9151 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1,6 +1,12 @@
 name: CI

-on: [push, pull_request]
+on:
+  push:
+    branches-ignore:
+      - main
+  pull_request:
+    branches-ignore:
+      - main

 env:
   DEVELOPER: 1
--- 8< ---

> [1] https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-excluding-branches

Thanks,
Taylor



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux