Skip to contentSkip to conversation

main: Use inbox.sourceware.org for repos hosted there

PATCH In review Jonathan Wakely 3 participants 5 messages May 23, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 main: Use inbox.sourceware.org for repos hosted there

Like the kernel, the GNU toolchain projects hosted on sourceware.org all use email-based patch submission/review processes, and a number of people are using b4 with inbox.sourceware.org now. This streamlines things for those people.

I don't know if this patch would be acceptable for b4. It's obviously very specific to sourceware projects, but then the existing default is very specific to the kernel! :)

Of course this wouldn't scale if every public-inbox installation wanted to hack b4 to work for their case too, but maybe GCC, Glibc etc. are significant enough to deserve this special case.

-- >8 --

This adjusts the default config to use inbox.sourceware.org instead of lore.kernel.org if the git repo's 'origin' remote is hosted on sourceware.org (e.g., GCC, Glibc, etc.)

This avoids needing to override the b4.midmask and b4.linkmask config for every sourceware-hosted repo, which helps people who contribute to both the kernel and toolchain projects (so don't want to override b4.midmask globally).

An explicit midmask or linkmask setting in .b4-config or git config will still override this default.

The change only works if the remote 'origin' exists in the repo, and assumes that if it does then it's meaningful, so somebody hasn't configured remote.origin to point to sourceware in a repo that isn't actually hosted there. This seems like a reasonable assumption.

---
 src/b4/__init__.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)
src/b4/__init__.py +12 -0
index fea7498..2b20ad6 100644
@@ -2861,6 +2861,18 @@ def _setup_main_config(cmdargs: Optional[argparse.Namespace] = None) -> None:
     global MAIN_CONFIG
 
     defcfg = copy.deepcopy(DEFAULT_CONFIG)
+
+    # If origin is a repo hosted on sourceware.org then use its public-inbox
+    # as the default instead of lore.kernel.org. This will be overridden by
+    # any explicit setting in .b4-config or the git config.
+    originurl = get_config_from_git(r'remote.origin').get('url')
+    if originurl is not None:
+        if "//gcc.gnu.org/git/" in originurl or "//sourceware.org/git/" in originurl:
+            logger.debug('Using inbox.sourceware.org as default host')
+            defcfg['midmask'] = 'https://inbox.sourceware.org/%s'
+            defcfg['linkmask'] = 'https://inbox.sourceware.org/%s'
+
+
     # some options can be provided via the toplevel .b4-config file,
     # so load them up and use as defaults
     topdir = git_get_toplevel()
Signature · 1 line
2.45.1
#1 lore raw

Hi,

Quoted 8 lines · Jonathan Wakely

Like the kernel, the GNU toolchain projects hosted on sourceware.org all use email-based patch submission/review processes, and a number of people are using b4 with inbox.sourceware.org now. This streamlines things for those people.

I don't know if this patch would be acceptable for b4. It's obviously very specific to sourceware projects, but then the existing default is very specific to the kernel! :)

Thanks! I would really appreciate this this could be accepted. It would be really convenient, not just for the four GNU toolchain projects hosted at sourceware but also the other 20+ core toolchain and developer tools (annobin, bzip2, elfutils, libabigail, newlib, systemtap, valgrind, ...) https://sourceware.org/projects.html

Quoted 3 lines

Of course this wouldn't scale if every public-inbox installation wanted to hack b4 to work for their case too, but maybe GCC, Glibc etc. are significant enough to deserve this special case.

This is probably overdesign, but maybe we can implement a standerd DNS (c)name for a git domains providing a public-inbox instance? So you could lookup if public-inbox.<git-origin-url> exists?

Cheers,

Mark

#2 lore raw
In reply to Jonathan Wakely
Quoted 8 lines · Jonathan Wakely

Like the kernel, the GNU toolchain projects hosted on sourceware.org all use email-based patch submission/review processes, and a number of people are using b4 with inbox.sourceware.org now. This streamlines things for those people.

I don't know if this patch would be acceptable for b4. It's obviously very specific to sourceware projects, but then the existing default is very specific to the kernel! :)

I understand the reason for this, but I'd much rather this was set in .b4-config, as it would obviously scale much better than hardcoding more and more projects into the source. Especially if origin URLs happen to change in the future.

Have you considered submitting a change that includes a .b4-config into the repos?

-K

#3 lore raw
Quoted 11 lines · Konstantin Ryabitsev
Quoted 8 lines · Jonathan Wakely

Like the kernel, the GNU toolchain projects hosted on sourceware.org all use email-based patch submission/review processes, and a number of people are using b4 with inbox.sourceware.org now. This streamlines things for those people.

I don't know if this patch would be acceptable for b4. It's obviously very specific to sourceware projects, but then the existing default is very specific to the kernel! :)

Quoted 7 lines

I understand the reason for this, but I'd much rather this was set in .b4-config, as it would obviously scale much better than hardcoding more and more projects into the source. Especially if origin URLs happen to change in the future.

Have you considered submitting a change that includes a .b4-config into the repos?

I have now, at least for GCC:
https://inbox.sourceware.org/[email protected]

Thanks for considering the patch anyway.

#4 lore raw
Quoted 9 lines · Jonathan Wakely
Quoted 9 lines
Quoted 3 lines

I don't know if this patch would be acceptable for b4. It's obviously very specific to sourceware projects, but then the existing default is very specific to the kernel! :)

I understand the reason for this, but I'd much rather this was set in .b4-config, as it would obviously scale much better than hardcoding more and more projects into the source. Especially if origin URLs happen to change in the future.

Quoted 5 lines
Quoted 2 lines

Have you considered submitting a change that includes a .b4-config into the repos?

I have now, at least for GCC:
https://inbox.sourceware.org/[email protected]

Great.

You should also consider including:

send-series-to = [email protected]

This would make it easy to use b4 prep to submit patches to gcc.

-K