Use main as new name for default git branch

This commit is contained in:
Xavier Delaruelle
2022-10-30 12:09:28 +01:00
parent 9d5f77fd23
commit 3b1faeb181
13 changed files with 19 additions and 17 deletions

View File

@@ -4,7 +4,7 @@
name: Differential ShellCheck
on:
pull_request:
branches: [master]
branches: [main]
permissions:
contents: read

View File

@@ -3,7 +3,7 @@ name: lint-tests
on:
push:
branches-ignore:
- c-master
- c-main
- c-3.2
pull_request:

View File

@@ -3,7 +3,7 @@ name: linux-tests
on:
push:
branches-ignore:
- c-master
- c-main
- c-3.2
pull_request:

View File

@@ -3,7 +3,7 @@ name: windows-tests
on:
push:
branches-ignore:
- c-master
- c-main
- c-3.2
pull_request:

View File

@@ -157,7 +157,7 @@ releases and current branch are built. Different tests are run against each
version and the execution time of each test is reported in millisecond::
$ script/mb
| v4.1.4 | v4.3.1 | v4.5.3 | v4.7.1 | v5.1.1 | master |
| v4.1.4 | v4.3.1 | v4.5.3 | v4.7.1 | v5.1.1 | main |
----------+----------+----------+----------+----------+----------+----------+
help | 9 | 12 | 12 | 15 | 16 | 16 |
avail | 61 | 67 | 76 | 82 | 91 | 86 |

View File

@@ -141,7 +141,7 @@ MODULES_RELEASE := $(subst v,,$(GIT_CURRENT_TAG))
MODULES_BUILD_DATE := $(shell git log -1 --format=%cd --date=short)
ifeq ($(GIT_CURRENT_TAG),$(GIT_CURRENT_DESC))
MODULES_BUILD :=
else ifeq ($(GIT_CURRENT_BRANCH),master)
else ifeq ($(GIT_CURRENT_BRANCH),main)
MODULES_BUILD := +$(subst $(GIT_CURRENT_TAG)-,,$(GIT_CURRENT_DESC))
else
MODULES_BUILD := +$(GIT_CURRENT_BRANCH)$(subst $(GIT_CURRENT_TAG),,$(GIT_CURRENT_DESC))
@@ -168,7 +168,7 @@ MODULES_BUILD_REFS := $(subst $(comma),,$(MODULES_BUILD_REFS))
ifeq ($(filter v$(MODULES_RELEASE),$(MODULES_BUILD_REFS)),v$(MODULES_RELEASE))
MODULES_BUILD :=
else ifeq ($(filter master,$(MODULES_BUILD_REFS)),master)
else ifeq ($(filter main,$(MODULES_BUILD_REFS)),main)
MODULES_BUILD := +XX-g$(MODULES_BUILD_HASH)
else ifeq ($(MODULES_BUILD_REFS),%D)
MODULES_BUILD := +XX-g$(MODULES_BUILD_HASH)

View File

@@ -140,6 +140,8 @@ Modules 5.2.0 (not yet released)
if :option:`--all` option is set.
* Doc: ensure current user environment does not break logging system in
:ref:`log-module-command` recipe. (fix issue #475)
* Rename the default git branch from *master* to *main* to use inclusive
terminology.
.. _Nagelfar: http://nagelfar.sourceforge.net/
.. _ShellCheck: https://www.shellcheck.net/
@@ -397,7 +399,7 @@ Modules 5.1.0 (2022-04-30)
* Mention tagging evaluation of a module, when tag list of an already loaded
module is updated.
.. _Code of conduct: https://github.com/cea-hpc/modules/blob/master/CODE_OF_CONDUCT.md
.. _Code of conduct: https://github.com/cea-hpc/modules/blob/main/CODE_OF_CONDUCT.md
.. _codespell: https://github.com/codespell-project/codespell
.. _Aspell: http://aspell.net/

View File

@@ -1,9 +1,9 @@
# <img src="https://raw.githubusercontent.com/cea-hpc/modules/master/doc/img/modules_red.svg" height="180" alt="Modules"/>
# <img src="https://raw.githubusercontent.com/cea-hpc/modules/main/doc/img/modules_red.svg" height="180" alt="Modules"/>
[![Linux Build Status](https://github.com/cea-hpc/modules/workflows/linux-tests/badge.svg)](https://github.com/cea-hpc/modules/actions?query=workflow:linux-tests)
[![Windows Build Status](https://github.com/cea-hpc/modules/workflows/windows-tests/badge.svg)](https://github.com/cea-hpc/modules/actions?query=workflow:windows-tests)
[![FreeBSD/OS X/Linux Build Status](https://api.cirrus-ci.com/github/cea-hpc/modules.svg)](https://cirrus-ci.com/github/cea-hpc/modules)
[![Coverage Status](https://codecov.io/gh/cea-hpc/modules/branch/master/graph/badge.svg)](https://codecov.io/gh/cea-hpc/modules)
[![Coverage Status](https://codecov.io/gh/cea-hpc/modules/branch/main/graph/badge.svg)](https://codecov.io/gh/cea-hpc/modules)
[![Documentation Status](https://readthedocs.org/projects/modules/badge/?version=latest)](https://modules.readthedocs.io/en/latest/?badge=latest)
[![Packaging status](https://repology.org/badge/tiny-repos/environment-modules.svg)](https://repology.org/metapackage/environment-modules/versions)
[![Twitter](https://img.shields.io/twitter/url/https/twitter.com/EnvModules.svg?style=social&label=Follow)](https://twitter.com/EnvModules)

4
configure vendored
View File

@@ -984,7 +984,7 @@ if [ -e '.git' ]; then
gitcurbranch=$(git rev-parse --abbrev-ref HEAD)
if [ "$gitcurtag" = "$gitcurdesc" ]; then
build=''
elif [ "$gitcurbranch" = 'master' ]; then
elif [ "$gitcurbranch" = 'main' ]; then
build="+${gitcurdesc#${gitcurtag}-}"
else
build="+${gitcurbranch}${gitcurdesc#${gitcurtag}}"
@@ -995,7 +995,7 @@ elif [ "$build_hash" = '$Format:%h' ]; then
# or compute it from these information as if working from git repository
elif [[ " $build_refs " =~ " v$release " ]]; then
build=''
elif [[ " $build_refs " =~ " master " ]]; then
elif [[ " $build_refs " =~ " main " ]]; then
build="+XX-g$build_hash"
# %D placeholder may not be known by old version of git
elif [ "$build_refs" = "%D" ]; then

View File

@@ -73,8 +73,8 @@ def get_version_release_from_git():
else:
branch = git_current_branch.rstrip()
tags = git_current_desc.lstrip(git_current_tag + '-').rstrip()
# workaround for RTD, where master branch is not detected
if branch == 'master' or os.environ.get('READTHEDOCS', None) == 'True':
# workaround for RTD, where main branch is not detected
if branch == 'main' or os.environ.get('READTHEDOCS', None) == 'True':
return version, version + '+' + tags
else:
return version, version + '+' + branch + '-' + tags

View File

@@ -87,7 +87,7 @@ Copy the ``localmodules`` file from the Modules source tree to your
repo::
cd /home/modules/modulefiles
curl --output localmodules https://raw.githubusercontent.com/cea-hpc/modules/master/doc/example/modulefiles-in-git/modulefiles/localmodules
curl --output localmodules https://raw.githubusercontent.com/cea-hpc/modules/main/doc/example/modulefiles-in-git/modulefiles/localmodules
Edit paths in the top of ``localmodules``, if your installation
differs from the assumptions, then::

View File

@@ -91,7 +91,7 @@ set logfid [open $logfile w]
# get current branch
set relbranch [exec git branch --show-current]
if {[regexp {^(master|v\d+.\d+.x)$} $relbranch]} {
if {[regexp {^(main|v\d+.\d+.x)$} $relbranch]} {
reportInfo "Found branch '$relbranch'"
} else {
error "git branch '$relbranch' is not a valid release branch"

View File

@@ -114,7 +114,7 @@ set logfid [open $logfile w]
# get current branch
set relbranch [exec git branch --show-current]
if {[regexp {^(master|v\d+.\d+.x)$} $relbranch]} {
if {[regexp {^(main|v\d+.\d+.x)$} $relbranch]} {
reportInfo "Found branch '$relbranch'"
} else {
error "git branch '$relbranch' is not a valid release branch"