Skip to content

Commit

Permalink
Use main as new name for default git branch
Browse files Browse the repository at this point in the history
  • Loading branch information
xdelaruelle committed Oct 30, 2022
1 parent 9d5f77f commit cbb9a2d
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down Expand Up @@ -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/

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/source/cookbook/modulefiles-in-git.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
2 changes: 1 addition & 1 deletion script/mpub
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion script/mrel
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit cbb9a2d

Please sign in to comment.