Re: git: 7392dc9d2683 - main - git-mfc: Let the upstream for PRERELEASE branches be main

From: Enji Cooper (yaneurabeya) <yaneurabeya_at_gmail.com>
Date: Sat, 25 Jul 2026 00:59:09 UTC
> On Jul 24, 2026, at 2:11 PM, Mark Johnston <markj@FreeBSD.org> wrote:
> 
> The branch main has been updated by markj:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=7392dc9d26830fe9d19e035d2e08f19dcca96591
> 
> commit 7392dc9d26830fe9d19e035d2e08f19dcca96591
> Author:     Mark Johnston <markj@FreeBSD.org>
> AuthorDate: 2026-07-24 21:09:48 +0000
> Commit:     Mark Johnston <markj@FreeBSD.org>
> CommitDate: 2026-07-24 21:09:48 +0000
> 
>    git-mfc: Let the upstream for PRERELEASE branches be main
> 
>    Such branches are in code slush but are the same as stable branches for
>    the purpose of MFCs.
> ---
> tools/tools/git/git-mfc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/tools/git/git-mfc b/tools/tools/git/git-mfc
> index 45a16a3bd5e4..431ed2ebc861 100755
> --- a/tools/tools/git/git-mfc
> +++ b/tools/tools/git/git-mfc
> @@ -59,7 +59,7 @@ def origin_branch():
>         err(1, f"could not determine BRANCH from {newvers}")
>     if branch == "CURRENT":
>         err(1, "this is a CURRENT tree, we do not MFC to CURRENT")
> -    if branch == "STABLE":
> +    if branch == "STABLE" or branch == "PRERELEASE":

	This is the preferred idiom:

```
if branch in (“STABLE”, “PREREALEASE”, ):
```

	It’s easier to read and results in less instructions
Cheers,
-Enji

```
>>> import dis
>>> def db1(a):
...     if a == "b" or a == "c":
...         return True
...     return False
…
>>> def db2(a):
...     if a in ("b", "c"):
...         return True
...     return False
...
>>> dis.dis(db1)
  1           RESUME                   0

  2           LOAD_FAST_BORROW         0 (a)
              LOAD_CONST               0 ('b')
              COMPARE_OP              88 (bool(==))
              POP_JUMP_IF_TRUE         8 (to L1)
              NOT_TAKEN
              LOAD_FAST_BORROW         0 (a)
              LOAD_CONST               1 ('c')
              COMPARE_OP              88 (bool(==))
              POP_JUMP_IF_FALSE        3 (to L2)
              NOT_TAKEN

  3   L1:     LOAD_CONST               2 (True)
              RETURN_VALUE

  4   L2:     LOAD_CONST               3 (False)
              RETURN_VALUE
>>> dis.dis(db2)
  1           RESUME                   0

  2           LOAD_FAST_BORROW         0 (a)
              LOAD_CONST               3 (('b', 'c'))
              CONTAINS_OP              0 (in)
              POP_JUMP_IF_FALSE        3 (to L1)
              NOT_TAKEN

  3           LOAD_CONST               1 (True)
              RETURN_VALUE

  4   L1:     LOAD_CONST               2 (False)
              RETURN_VALUE
```