diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 8cfec000c75..00000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,96 +0,0 @@ -referenced: - generate-hash-step: &generate-hash-step - run: - name: Generate external data hash - command: | - cd ITK - find . -name \*.md5 -o -name \*.sha512 -print0 | xargs -0 git log -n 1 | tee /home/circleci/external-data.hashable - restore-data-step: &restore-data-step - restore_cache: - keys: - - 'v1-external-data-{{ checksum "/home/circleci/external-data.hashable" }}' - - 'v1-external-data' - -version: 2 -jobs: - build: - docker: - - image: cimg/python:3.9 - working_directory: ~/ - resource_class: large - branches: - ignore: - - gh-pages - - dashboard - - hooks - environment: - CTEST_DASHBOARD_ROOT: /home/circleci - CTEST_SOURCE_DIRECTORY: /home/circleci/ITK - CTEST_BINARY_DIRECTORY: /home/circleci/ITK-build - DASHBOARD_BRANCH_DIRECTORY: /home/circleci/ITK-dashboard - ExternalData_OBJECT_STORES: /home/circleci/.ExternalData - steps: - - checkout: - path : ~/ITK - - *generate-hash-step - - *restore-data-step - - restore_cache: - keys: - - ccache-{{ arch }}-{{ .Branch }} - - ccache-{{ arch }}-master - - ccache-{{ arch }} - - run: - name: Cloning dashboard branch - command: | - git clone --single-branch ${CIRCLE_REPOSITORY_URL} -b dashboard ${DASHBOARD_BRANCH_DIRECTORY} - - run: - name: Dependencies - command: | - sudo apt-get update - sudo apt-get upgrade -y - sudo apt-get install -y rsync ninja-build ccache python3-pip - sudo pip3 install --upgrade pip - sudo pip3 install cmake==3.16.3 scikit-ci-addons numpy lxml - - run: - name: CCache initialization - command: | - ccache --show-stats - ccache --zero-stats - ccache --max-size=2.0G - - run: echo 'export DASHBOARD_MODEL=$( [[ "$CIRCLE_BRANCH" = "master" ]] && echo Continuous || echo Experimental )' >> $BASH_ENV - - run: - name: Build and Testing with CTest - environment: - ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS: 2 - CTEST_OUTPUT_ON_FAILURE: 1 - CTEST_CONFIGURATION_TYPE: "MinSizeRel" - CTEST_BUILD_FLAGS: "-j 5" - PARALLEL_LEVEL: 4 - CTEST_CMAKE_GENERATOR: "Ninja" - command: | - export PATH=/usr/lib/ccache:${PATH} - mkdir -p ${CTEST_BINARY_DIRECTORY} - ctest -V -Ddashboard_no_clean:BOOL=1 \ - -DCTEST_CUSTOM_WARNING_EXCEPTION:STRING="itkIndex.h:.*warning: array subscript is above array bounds" \ - -S "${DASHBOARD_BRANCH_DIRECTORY}/circleci.cmake" - - run: - name: ccache stats - when: always - command: | - ccache --show-stats - - run: - name: Formatting CTest for JUnit - when: always - command: | - env - mkdir -p /tmp/test-results - ci_addons ctest_junit_formatter ${CTEST_BINARY_DIRECTORY} > /tmp/test-results/JUnit-${CIRCLE_NODE_INDEX}.xml - - store_test_results: - path: /tmp/test-results - destination: ctest - - save_cache: - key: 'ccache-{{ arch }}-{{ .Branch }}-{{ epoch }}' - paths: [ "/home/circleci/.ccache" ] - - save_cache: - key: 'v1-external-data-{{ checksum "/home/circleci/external-data.hashable" }}' - paths: [ "/home/circleci/.ExternalData" ] diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 07d6809001e..a4375dab13c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -28,11 +28,11 @@ close a related issues using keywords (https://help.github.com/articles/closing- of the person or team responsible for reviewing proposed changes. --> ## PR Checklist -- [ ] No [API changes](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md#breaking-changes) were made (or the changes have been approved) -- [ ] No [major design changes](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md#design-changes) were made (or the changes have been approved) +- [ ] No [API changes](https://github.com/InsightSoftwareConsortium/ITK/blob/main/CONTRIBUTING.md#breaking-changes) were made (or the changes have been approved) +- [ ] No [major design changes](https://github.com/InsightSoftwareConsortium/ITK/blob/main/CONTRIBUTING.md#design-changes) were made (or the changes have been approved) - [ ] Added test (or behavior not changed) - [ ] Updated API documentation (or API not changed) -- [ ] Added [license](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/KWStyle/ITKHeader.h) to new files (if any) +- [ ] Added [license](https://github.com/InsightSoftwareConsortium/ITK/blob/main/Utilities/KWStyle/ITKHeader.h) to new files (if any) - [ ] Added Python wrapping to new files (if any) as described in [ITK Software Guide](https://itk.org/ItkSoftwareGuide.pdf) Section 9.5 - [ ] Added [ITK examples](https://github.com/InsightSoftwareConsortium/ITKSphinxExamples) for all new major features (if any) diff --git a/.github/workflows/first-interaction.yml b/.github/workflows/first-interaction.yml index 944d548d702..c2307df1cb7 100644 --- a/.github/workflows/first-interaction.yml +++ b/.github/workflows/first-interaction.yml @@ -20,7 +20,7 @@ jobs: **Welcome to the ITK community!** 🤗👋☀️ - We are glad you are here and appreciate your contribution. Please keep in mind our [community participation guidelines](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CODE_OF_CONDUCT.md). 📜 + We are glad you are here and appreciate your contribution. Please keep in mind our [community participation guidelines](https://github.com/InsightSoftwareConsortium/ITK/blob/main/CODE_OF_CONDUCT.md). 📜 Also, please check [existing open issues](https://github.com/InsightSoftwareConsortium/ITK/issues) and consider discussion on the [ITK Discourse](https://discourse.itk.org). 📖 This is an automatic message. Allow for time for the ITK community to be able to read the issue and comment on it. @@ -30,8 +30,8 @@ jobs: **Welcome to the ITK community!** 🤗👋☀️ - We are glad you are here and appreciate your contribution. Please keep in mind our [community participation guidelines](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CODE_OF_CONDUCT.md). 📜 - More support and guidance on the contribution process can be found in our [contributing guide](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md). 📖 + We are glad you are here and appreciate your contribution. Please keep in mind our [community participation guidelines](https://github.com/InsightSoftwareConsortium/ITK/blob/main/CODE_OF_CONDUCT.md). 📜 + More support and guidance on the contribution process can be found in our [contributing guide](https://github.com/InsightSoftwareConsortium/ITK/blob/main/CONTRIBUTING.md). 📖 This is an automatic message. Allow for time for the ITK community to be able to read the pull request and comment on it. diff --git a/.github/workflows/macos-arm.yml b/.github/workflows/macos-arm.yml index 36e84884618..c9bff63493b 100644 --- a/.github/workflows/macos-arm.yml +++ b/.github/workflows/macos-arm.yml @@ -3,7 +3,7 @@ name: ITK.macOS.Arm64 on: push: branches: - - master + - main - 'release*' paths-ignore: - '*.md' diff --git a/.github/workflows/pixi.yml b/.github/workflows/pixi.yml index 6caa5abb047..8399fcb5334 100644 --- a/.github/workflows/pixi.yml +++ b/.github/workflows/pixi.yml @@ -3,7 +3,7 @@ name: ITK.Pixi on: push: branches: - - master + - main - 'release*' paths-ignore: - '*.md' diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 2dd280ab66e..6fbf847e6fd 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -8,7 +8,7 @@ on: schedule: - cron: '42 23 * * 6' push: - branches: [ "master" ] + branches: [ "main" ] # Declare default permissions as read only. permissions: read-all diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e3c543378e7..cbdb2725712 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -53,7 +53,7 @@ repos: exclude: "\\/ThirdParty\\/" args: ['--pytest-test-first'] - id: no-commit-to-branch - args: ['--branch','dashboard','--branch','python-builds','--branch','release','--branch','hooks','--branch', 'main','--branch','master','--pattern','release-*'] + args: ['--branch','dashboard','--branch','python-builds','--branch','release','--branch','hooks','--branch', 'main','--branch','main','--pattern','release-*'] - id: trailing-whitespace exclude: "\\.(sha|sha512|svg|vtk|vtp)$|\\/ThirdParty\\/|\\/Data\\/" - repo: https://github.com/BlankSpruce/gersemi diff --git a/Documentation/Maintenance/Release.md b/Documentation/Maintenance/Release.md index fc9016eb4ba..487abf81e11 100644 --- a/Documentation/Maintenance/Release.md +++ b/Documentation/Maintenance/Release.md @@ -18,7 +18,7 @@ Release Life Cycle ------------------ The first release candidate (RC) is the initial branch point, so it does not have -special steps to create. However, as `master` moves fairly quickly, branches +special steps to create. However, as `main` moves fairly quickly, branches need to be corralled into the `release` branch afterwards. When releasing a new ITK version, the following steps are be taken: @@ -118,12 +118,12 @@ This ITK [blog post] describes the Linux distributions that package ITK. Integrate bug fixes in the release branch ----------------------------------------- -Update `master` and `release` branches: +Update `main` and `release` branches: ```bash git fetch upstream -git checkout master -git reset --hard upstream/master +git checkout main +git reset --hard upstream/main git checkout release git reset --hard upstream/release ``` @@ -146,10 +146,10 @@ Merge bug fix commits in release. The topic branch should be named `-for-release`: * If topic branch was created from the `release` branch, `checkout` topic in new branch. - * If topic branch was created on `master`, `cherry-pick` commit (see + * If topic branch was created on `main`, `cherry-pick` commit (see command line on [GitHub]) on a topic branch created off `release`. The commit will be visible twice in the history once release in merged into - `master`. + `main`. * Merge new branch on `release`: ```bash @@ -171,12 +171,12 @@ The following must be ensured before tagging the ITK repository: ### Increment the version number If the version number in `ITK/CMake/itkVersion.cmake` is not already set accordingly, -submit a pull request to update ITK's version number in the `master` branch to -what the new release is called. Any point beyond that in the `master` branch +submit a pull request to update ITK's version number in the `main` branch to +what the new release is called. Any point beyond that in the `main` branch could serve as the start of the new release branch. After creating the release branch, submit another merge request to update the -master branch's minor version number. +main branch's minor version number. Update Zenodo Citation Configuration ------------------------------------ @@ -339,7 +339,7 @@ maintainers after an ITK Confab. Use the command: ```bash -git checkout master +git checkout main git pull ``` @@ -350,7 +350,7 @@ tree that has been fully tested in the [Dashboard]. bump the `ITK_VERSION_PATCH` variable in the `CMake/itkVersion.cmake` file before tagging. * When tagging a **feature release**, make sure to bump the - `ITK_VERSION_MINOR` version on the `master` branch after tagging. + `ITK_VERSION_MINOR` version on the `main` branch after tagging. ### Tag with a branch point reference @@ -377,22 +377,22 @@ Note that only trusted GPG key holders may do this step. ### Update the release branch Update the `release` branch only during feature releases after the tag for the -release. Perform a `fast-forward` merge of `master` into release: +release. Perform a `fast-forward` merge of `main` into release: ```bash git checkout release git reset --hard upstream/release git merge --ff-only v$version git push upstream release -git checkout master +git checkout main ``` This will not create a new commit, only move the release branch to the tag, i.e. it will be fast forwarded. -For minor releases, merge the release branch into `master` branch as for a +For minor releases, merge the release branch into `main` branch as for a normal commit, and resolve conflicts (arising from mismatch in version number) -by keeping `master` branch versions. +by keeping `main` branch versions. Merge the `release` branch into the current named `$major_minor` version branch, e.g. `5.4`. @@ -424,14 +424,14 @@ the latest ITK tag, the following steps should be performed: 1. Update the ITK tag used in the `azure-pipelines.yml` CI configuration and the `setup.py` Python setup files, and update the remote module Python package -version to a new major version using the [UpdateRequiredITKVersionInRemoteModules.sh](https://github.com/InsightSoftwareConsortium/ITK/tree/master/Utilities/Maintenance/UpdateRequiredITKVersionInRemoteModules.sh) +version to a new major version using the [UpdateRequiredITKVersionInRemoteModules.sh](https://github.com/InsightSoftwareConsortium/ITK/tree/main/Utilities/Maintenance/UpdateRequiredITKVersionInRemoteModules.sh) script. This will involve merging a new pull request to each remote module repository. 2. Upload the new remote module Python wheel to [PyPI]. 3. Update the remote modules to their latest commits using the -[UpdateRemoteModules.sh](https://github.com/InsightSoftwareConsortium/ITK/tree/master/Utilities/Maintenance/UpdateRemoteModules.sh) +[UpdateRemoteModules.sh](https://github.com/InsightSoftwareConsortium/ITK/tree/main/Utilities/Maintenance/UpdateRemoteModules.sh) script. @@ -525,7 +525,7 @@ documentation for further information. First, merge the [ITKPythonPackage](https://github.com/InsightSoftwareConsortium/ITKPythonPackage) -`master` branch into the `release` branch. +`main` branch into the `release` branch. Next, update the `VERSION` variable in *ITKPythonPackage/itkVersion.py* and `ITK_GIT_TAG` in *ITKPythonPackage/CMakeLists.txt*. Commit the update locally @@ -792,7 +792,7 @@ version in `Superbuild/External-ITK.cmake`. Update the CMake minimum version in the example files if necessary. Rendered versions can be downloaded from the recent `build-test-publish` -[Documentation GitHub Artifact](https://github.com/InsightSoftwareConsortium/ITKSphinxExamples/actions/workflows/build-test-publish.yml?query=branch%3Amaster). +[Documentation GitHub Artifact](https://github.com/InsightSoftwareConsortium/ITKSphinxExamples/actions/workflows/build-test-publish.yml?query=branch%3Amain). These should be added to a new GitHub Release on the ITKSphinxExamples repository with the tag `v$version`. @@ -818,7 +818,7 @@ Release Notes Posts ------------------- To get started with the release notes, first use the download link -cookiecutter to generate [download page](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/docs/download.md) markdown: +cookiecutter to generate [download page](https://github.com/InsightSoftwareConsortium/ITK/blob/main/Documentation/docs/download.md) markdown: ```bash pip install cookiecutter @@ -956,7 +956,7 @@ For the final release, the release notes produced should be used to * Provide the release notes in the [ITK GitHub Releases] * Post a message in the [ITK discussion] * Create a post in the [Kitware blog] - * Add a release note doc in [ITK/Documentation/ReleaseNotes](https://github.com/InsightSoftwareConsortium/ITK/tree/master/Documentation/ReleaseNotes) + * Add a release note doc in [ITK/Documentation/ReleaseNotes](https://github.com/InsightSoftwareConsortium/ITK/tree/main/Documentation/ReleaseNotes) * Update [ITK's Wikipedia page](https://en.wikipedia.org/wiki/Insight_Segmentation_and_Registration_Toolkit). * Send out a summary to Arliss at NumFOCUS to announce the release in the NumFOCUS project update monthly newsletter. diff --git a/Documentation/docs/README.md b/Documentation/docs/README.md index fc67676dd22..626cd37d282 100644 --- a/Documentation/docs/README.md +++ b/Documentation/docs/README.md @@ -9,7 +9,7 @@ These are the sources for the [ITK docs](https://docs.itk.org) The contribution process generally follows our [contributing guidelines](./contributing/index.md). -Once merged into `master`, the documentation will be available in the `latest` +Once merged into `main`, the documentation will be available in the `latest` version of the ReadTheDocs documentation as https://docs.itk.org/. Note that `latest` is not the default version (`release` is). To change versions, use the links in the lower left of the page. diff --git a/Documentation/docs/conf.py b/Documentation/docs/conf.py index 0a92ba0365a..d7774cf877e 100644 --- a/Documentation/docs/conf.py +++ b/Documentation/docs/conf.py @@ -1,10 +1,10 @@ # Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html +# https://www.sphinx-doc.org/en/main/usage/configuration.html # -- Project information ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information +# https://www.sphinx-doc.org/en/main/usage/configuration.html#project-information import os from datetime import date @@ -58,6 +58,6 @@ html_theme_options = { "top_of_page_button": "edit", "source_repository": "https://github.com/InsightSoftwareConsortium/ITK/", - "source_branch": "master", + "source_branch": "main", "source_directory": "Documentation/docs", } diff --git a/Documentation/docs/contributing/GitCheatSheet.pdf b/Documentation/docs/contributing/GitCheatSheet.pdf index c6297107e42..990150fc481 100644 Binary files a/Documentation/docs/contributing/GitCheatSheet.pdf and b/Documentation/docs/contributing/GitCheatSheet.pdf differ diff --git a/Documentation/docs/contributing/GitCheatSheet.tex b/Documentation/docs/contributing/GitCheatSheet.tex index 22b6bc3df25..845ebd1dc97 100644 --- a/Documentation/docs/contributing/GitCheatSheet.tex +++ b/Documentation/docs/contributing/GitCheatSheet.tex @@ -78,7 +78,7 @@ \subsection*{Create and Configure Your Repository} \subsection*{Topic Branch Lifecycle} \begin{category}{Update} \parbox[t]{0.6\cvmain}{% - \texttt{git status\\ git checkout master\\ git pull --rebase upstream master} + \texttt{git status\\ git checkout main\\ git pull --rebase upstream main} } \parbox[t]{0.38\cvmain}{% Review local modifications, delete, stash or commit them. @@ -86,10 +86,10 @@ \subsection*{Topic Branch Lifecycle} \end{category} \begin{category}{New Topic Branch} \parbox[t]{0.6\cvmain}{% - \texttt{git checkout -b my-topic upstream/master} + \texttt{git checkout -b my-topic upstream/main} } \parbox[t]{0.38\cvmain}{% -Create branch off master. +Create branch off main. } \end{category} \begin{category}{Write Code} diff --git a/Documentation/docs/contributing/code_of_conduct.md b/Documentation/docs/contributing/code_of_conduct.md index 26d70f8a987..83dc31d3fbe 100644 --- a/Documentation/docs/contributing/code_of_conduct.md +++ b/Documentation/docs/contributing/code_of_conduct.md @@ -429,8 +429,8 @@ modification from * [Python](https://www.python.org/psf/codeofconduct/) * [Django](https://www.djangoproject.com/conduct/reporting/) * [Scipy](https://docs.scipy.org/doc/scipy//reference/dev/conduct/code_of_conduct.html) - * [Nipype](https://github.com/nipy/nipype/blob/master/CODE_OF_CONDUCT.md) - * [Jupyter](https://github.com/jupyter/governance/blob/master/conduct/code_of_conduct.md) + * [Nipype](https://github.com/nipy/nipype/blob/main/CODE_OF_CONDUCT.md) + * [Jupyter](https://github.com/jupyter/governance/blob/main/conduct/code_of_conduct.md) * [The Linux Foundation](https://www.linuxfoundation.org/events/code-of-conduct/) * [Ubuntu](https://www.ubuntu.com/about/about-ubuntu/conduct) * [Brainhack](https://www.brainhack.org/code-of-conduct.html) diff --git a/Documentation/docs/contributing/data.md b/Documentation/docs/contributing/data.md index fb58cb4709e..81eb8dc4eda 100644 --- a/Documentation/docs/contributing/data.md +++ b/Documentation/docs/contributing/data.md @@ -131,7 +131,7 @@ Discussion An ITK test data file is not stored in the main source tree under version control. Instead the source tree contains a "content link" that refers to a data object by a hash of its content. At build time the the -[`ExternalData.cmake`](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CMake/ExternalData.cmake) +[`ExternalData.cmake`](https://github.com/InsightSoftwareConsortium/ITK/blob/main/CMake/ExternalData.cmake) module fetches data needed by enabled tests. This allows arbitrarily large data to be added and removed without bloating the version control history. diff --git a/Documentation/docs/contributing/document_itk.md b/Documentation/docs/contributing/document_itk.md index 562783d3320..bdcbe4c8976 100644 --- a/Documentation/docs/contributing/document_itk.md +++ b/Documentation/docs/contributing/document_itk.md @@ -142,7 +142,7 @@ It is used as, e.g. ``` where the first argument to `\sphinxexample` points to the relative -path of the example at the [ITK Examples source code](https://github.com/InsightSoftwareConsortium/ITKSphinxExamples/tree/master/src), +path of the example at the [ITK Examples source code](https://github.com/InsightSoftwareConsortium/ITKSphinxExamples/tree/main/src), and the second one being the title of the example in the `Documentation.rst` file of the example at issue. diff --git a/Documentation/docs/contributing/index.md b/Documentation/docs/contributing/index.md index 388b66e7b8a..8665b5d18f8 100644 --- a/Documentation/docs/contributing/index.md +++ b/Documentation/docs/contributing/index.md @@ -17,7 +17,7 @@ Setup Before you begin, perform initial setup: 1. [Register for a GitHub](https://github.com/join) account. - 2. Optionally download our [one page PDF desk reference](https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/master/Documentation/docs/contributing/GitCheatSheet.pdf). + 2. Optionally download our [one page PDF desk reference](https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/main/Documentation/docs/contributing/GitCheatSheet.pdf). 3. Follow the [download instructions] to create a local ITK clone: ```bash @@ -72,10 +72,10 @@ three main steps: Update ------ -Update your local `master` branch: +Update your local `main` branch: ```bash -git checkout master +git checkout main git pullall ``` @@ -93,10 +93,10 @@ To start a new topic branch: git fetch upstream ``` -For new development, start the topic from `upstream/master`: +For new development, start the topic from `upstream/main`: ```bash -git checkout -b my-topic upstream/master +git checkout -b my-topic upstream/main ``` For release branch fixes, start the topic from `upstream/release`: @@ -325,7 +325,7 @@ comment on the pull request which states the topic should be merged to the `release` and `release-X.X` maintenance branch, where `X.X` are the current maintenance version, e.g. `5.4`. -Here are the recommended steps to merge a topic to both `release` and `master` +Here are the recommended steps to merge a topic to both `release` and `main` branches, assuming the topic branch is forked off the `release` branch: ```bash @@ -347,13 +347,13 @@ git push upstream release then: ```bash -git checkout master -git pull --ff-only upstream master +git checkout main +git pull --ff-only upstream main git merge --no-ff release -git push upstream master +git push upstream main ``` -to merge the `release` branch back to `master`. +to merge the `release` branch back to `main`. (delete-a-topic)= Delete a Topic @@ -361,10 +361,10 @@ Delete a Topic After a topic has been merged upstream, delete your local branch for the topic. -Checkout and update the `master` branch: +Checkout and update the `main` branch: ```bash -git checkout master +git checkout main git pullall ``` @@ -392,12 +392,12 @@ Branches At the time of this writing the `ITK` repository has the following branches: - * `master`: Development (default) + * `main`: Development (default) * `release`: Maintenance of latest release * `release-3.20`: Maintenance of the ITKv3 series * `release-4.13`: Maintenance of the ITKv4 series * `release-5.4`: Maintenance of the ITKv5 series. - * `nightly-master`: Follows master, updated at 01:00 UTC for nightly dashboard build consistency. + * `nightly-main`: Follows main, updated at 01:00 UTC for nightly dashboard build consistency. * `hooks`: Local commit hooks (place in `.git/hooks`) * `dashboard`: Dashboard script (setup a CDash client) @@ -416,7 +416,7 @@ module_workflows.md ITK Software Guide, Book 1, Part III: Development Guidelines git_help.md GitHub flow guide -ITK Git Cheatsheet +ITK Git Cheatsheet CDash Dashboard dashboard.md updating_third_party.md @@ -429,8 +429,8 @@ python_packaging.md [Updating Third Party]: ./updating_third_party.md [build and test ITK]: ./build_test_itk.md -[`SetupForDevelopment.sh`]: https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/SetupForDevelopment.sh -[`setup-git-aliases`]: https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/GitSetup/setup-git-aliases +[`SetupForDevelopment.sh`]: https://github.com/InsightSoftwareConsortium/ITK/blob/main/Utilities/SetupForDevelopment.sh +[`setup-git-aliases`]: https://github.com/InsightSoftwareConsortium/ITK/blob/main/Utilities/GitSetup/setup-git-aliases [ITK's Discourse]: https://discourse.itk.org/ diff --git a/Documentation/docs/contributing/python_packaging.md b/Documentation/docs/contributing/python_packaging.md index 65f4f539322..af742232aca 100644 --- a/Documentation/docs/contributing/python_packaging.md +++ b/Documentation/docs/contributing/python_packaging.md @@ -28,7 +28,7 @@ The following sections outline how to use the ITKPythonPackage project to build ### Linux -On any linux distribution with docker and bash installed, running the script [dockcross-manylinux-build-wheels.sh](https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/master/scripts/dockcross-manylinux-build-wheels.sh) will create 64-bit wheels for Python 3.x in the `dist` directory. A Python version to target may be passed as a trailing argument, or passing no arguments will target all default Python versions. +On any linux distribution with docker and bash installed, running the script [dockcross-manylinux-build-wheels.sh](https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/main/scripts/dockcross-manylinux-build-wheels.sh) will create 64-bit wheels for Python 3.x in the `dist` directory. A Python version to target may be passed as a trailing argument, or passing no arguments will target all default Python versions. In addition, the environment variables `MANYLINUX_VERSION` and `IMAGE_TAG` may be set before calling the script to control the [dockcross](https://github.com/dockcross/dockcross) Docker image and target a specific platform type. See ITKPythonPackage for more information. @@ -55,7 +55,7 @@ First, install the Python.org macOS Python distributions. This step requires sud ./scripts/macpython-install-python.sh ``` -Then, run [macpython-build-wheels.sh](https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/master/scripts/macpython-build-wheels.sh) to build the wheels. A Python version may be targetd by passing a trailing argument to the script. See ITKPythonPackage for environment variables used by `macpython-build-wheels.sh`. +Then, run [macpython-build-wheels.sh](https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/main/scripts/macpython-build-wheels.sh) to build the wheels. A Python version may be targetd by passing a trailing argument to the script. See ITKPythonPackage for environment variables used by `macpython-build-wheels.sh`. ```bash git clone https://github.com/InsightSoftwareConsortium/ITKPythonPackage.git @@ -77,7 +77,7 @@ Open a PowerShell terminal as Administrator, and install Python: ```pwsh PS C:\> Set-ExecutionPolicy Unrestricted PS C:\> $pythonArch = "64" -PS C:\> iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) +PS C:\> iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/main/windows/install-python.ps1')) ``` Clone the ITKPythonPackage project into a short directory to avoid path length limitations on Windows. Also, it is necessary to disable antivirus checking on the C:\IPP directory. Otherwise, the build system conflicts with the antivirus when many files are created and deleted quickly, which can result in Access Denied errors. Windows 10 ships with an antivirus application, Windows Defender, that is enabled by default. @@ -88,7 +88,7 @@ PS C:\> git clone https://github.com/InsightSoftwareConsortium/ITKPythonPackage. PS C:\> cd IPP ``` -Then run the [windows_build_wheels.py](https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/master/scripts/windows_build_wheels.py) script. The `--help` argument may be used to list available build options, including target Python versions and CMake options. +Then run the [windows_build_wheels.py](https://github.com/InsightSoftwareConsortium/ITKPythonPackage/blob/main/scripts/windows_build_wheels.py) script. The `--help` argument may be used to list available build options, including target Python versions and CMake options. ```pwsh PS C:\IPP> .\scripts\windows_build_wheels.py diff --git a/Documentation/docs/contributing/updating_third_party.md b/Documentation/docs/contributing/updating_third_party.md index f88e99a5f09..8fa21892ccd 100644 --- a/Documentation/docs/contributing/updating_third_party.md +++ b/Documentation/docs/contributing/updating_third_party.md @@ -18,7 +18,7 @@ repository specified in its `UpdateFromUpstream.sh` script. Once the upstream changes are merged, pulling the changes involves running the `UpdateFromUpstream.sh` script. This will update the local copy of the project to the version specified in `UpdateFromUpstream.sh` (usually a `for/foo` -branch, like `for/itk` for example, but may be `master` or any other Git +branch, like `for/itk` for example, but may be `main` or any other Git reference) and merge it into the main tree. This requires a Git 2.5 or higher due the `worktree` tool being used to @@ -50,7 +50,7 @@ Porting a Project When converting a project, if there are any local patches, a project should be created on -[GitHub](https://github.com/InsightSoftwareConsortium/ITK/tree/master/Modules/ThirdParty) +[GitHub](https://github.com/InsightSoftwareConsortium/ITK/tree/main/Modules/ThirdParty) to track it. If the upstream project does not use Git, it should be imported into Git (there may be existing conversions available on GitHub already). The project's description should indicate where the source repository lives. @@ -116,4 +116,4 @@ if necessary. -[update-third-party.bash]: https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/Maintenance/update-third-party.bash +[update-third-party.bash]: https://github.com/InsightSoftwareConsortium/ITK/blob/main/Utilities/Maintenance/update-third-party.bash diff --git a/Documentation/docs/download.md b/Documentation/docs/download.md index 3483b9f930b..1fc421305b1 100644 --- a/Documentation/docs/download.md +++ b/Documentation/docs/download.md @@ -121,8 +121,8 @@ Users that have made no local changes and simply want to update a clone with the latest changes may run ```bash -git checkout master -git pull --rebase upstream master +git checkout main +git pull --rebase upstream main ``` Avoid making local changes unless you have read our [developer @@ -131,7 +131,7 @@ instructions](contributing/index.md). ### Checkout After cloning, your local repository will be configured to follow the upstream -`master` branch by default. This means you will have access to cutting edge +`main` branch by default. This means you will have access to cutting edge features, but along with these may come cutting edge bugs :grimacing:. One may create a local branch to track the upstream `release` branch instead, which should guarantee only bug fixes to the functionality available in the latest diff --git a/Documentation/docs/index.md b/Documentation/docs/index.md index 102fff14845..7d24c433e6f 100644 --- a/Documentation/docs/index.md +++ b/Documentation/docs/index.md @@ -10,7 +10,7 @@ We invite you to join the ITK community and explore our documentation to find ou [![Commit Activity](https://img.shields.io/github/commit-activity/y/InsightSoftwareConsortium/ITK)](https://github.com/InsightSoftwareConsortium/ITK) [![PyPI](https://img.shields.io/pypi/v/itk.svg)](https://pypi.python.org/pypi/itk) -[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/InsightSoftwareConsortium/ITK/blob/master/LICENSE) +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/InsightSoftwareConsortium/ITK/blob/main/LICENSE) [![DOI](https://zenodo.org/badge/800928.svg)](https://zenodo.org/badge/latestdoi/800928) [![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org) diff --git a/Documentation/docs/learn/courses.md b/Documentation/docs/learn/courses.md index 41176189225..82b8bdf1988 100644 --- a/Documentation/docs/learn/courses.md +++ b/Documentation/docs/learn/courses.md @@ -18,7 +18,7 @@ Kitware also offers periodic [short online courses given by expert instructors]( - A [Digital Image Processing course](https://www.ee.columbia.edu/~xlx/ee4830/) at Columbia University introduces fundamental technologies for digital image and video representation, compression, analysis, and processing. Students will gain understanding of algorithm and system design, analytical tools, and practical implementations of various digital image applications. - The [Applied Medical Image Analysis course](https://catalog.odu.edu/courses/bme/) at Old Dominion University explores hands-on exposure to state-of-the-art algorithms in medical image analysis, which builds on open-source software (Insight Segmentation and Registration Toolkit – ITK), as well as the principles of medical image acquisition in the modalities of clinical interest. Medical imaging modalities – X-rays, CT, and MRI/ITK image pipeline; image enhancement, feature detection; segmentation – basic techniques, feature-based classification and clustering, graph cuts, active contour and surface models; surface and volume meshing; registration – transformations, similarity criteria; shape and appearance models are all explored and discussed in this course. - The [Introduction to Pattern Recognition](https://www5.cs.fau.de/lectures/ws-1516/introduction-to-pattern-recognition-intropr/exercises/) at Technische Fakultat course covers the Fourier Transform, Fourier Series, k-Means clustering, histogram equalization, image filtering, threshold, edge detection, simple segmentation, morphological operations, normalization, walsh transform, wavelets, eigenfaces. -- [Programming for Medical Imaging](https://www.uu.nl/en/masters/medical-imaging/study-programme) at Utrecht University is a course that teaches the theoretical knowledge and practical skills required for medical imaging. The focus is on C++ and Python. +- [Programming for Medical Imaging](https://www.uu.nl/en/master/medical-imaging/study-programme) at Utrecht University is a course that teaches the theoretical knowledge and practical skills required for medical imaging. The focus is on C++ and Python. - [Biomedical Imaging and Analysis](https://www.justcallharry.com/bia-fall-2014.html) at Sun Yat-sen course’s goals are to familiarize students with biological and medical imaging data from various imaging modalities (eg: Magnetic Resonance Imaging (MRI), X-ray Computed Tomography (CT), Fluoroscopy, Ultrasound and Optical Systems for Microscopy), how these data are acquired as well as how to process 2D, 3D and 4D (3D + time) data for quantification and visualization purposes using contemporary software tools and open-source libraries (including, SimpleITK, ITK, VTK). - The National Technical University of Athens offers an [Introduction to Biomedical Engineering, Biological Signal Analysis, and Processing](https://biomig.ntua.gr/courses.html) whose lectures include methods and processing techniques, design and implementation of digital filters together with specific applications. - Professor Owen Carmichael provided video recordings from his course on [Image Processing and Analysis](http://www.infocobuild.com/education/audio-video-courses/computer-science/ecs173-fall2010-uc-davis.html). This course deals with techniques for automated extraction of high-level information from images generated by cameras, three-dimensional surface sensors, and medical devices. diff --git a/Documentation/docs/learn/faq.md b/Documentation/docs/learn/faq.md index 75f5e1c5ece..afd1295a5b1 100644 --- a/Documentation/docs/learn/faq.md +++ b/Documentation/docs/learn/faq.md @@ -128,7 +128,7 @@ in case of desperation. It has the broadest support and is the easiest to use. 1. Use the [`itk::ImageSeriesReader`](https://docs.itk.org/projects/doxygen/en/stable/classitk_1_1ImageSeriesReader.html) in combination with the `DicomSeriesFileNames`. For a full example on how to do this, - please look at the [`DicomSeriesReadImageWrite2.cxx`](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Examples/IO/DicomSeriesReadImageWrite2.cxx) + please look at the [`DicomSeriesReadImageWrite2.cxx`](https://github.com/InsightSoftwareConsortium/ITK/blob/main/Examples/IO/DicomSeriesReadImageWrite2.cxx) code. 1. Write a MetaImage header. This is a small text file holding information about the image: spacing, dimensions, pixel type, etc. @@ -162,7 +162,7 @@ can reconfigure ITK by running CMake in your ITK build, going into the advanced options and enabling `USE_GDCM`. For a code example on how to use GDCM for reading and writing DICOM -series, please refer to the source code in [`DicomSeriesReadImageWrite2.cxx`](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Examples/IO/DicomSeriesReadImageWrite2.cxx). +series, please refer to the source code in [`DicomSeriesReadImageWrite2.cxx`](https://github.com/InsightSoftwareConsortium/ITK/blob/main/Examples/IO/DicomSeriesReadImageWrite2.cxx). You can always use the latest and greatest of GDCM, simply use an installed version of GDCM and link ITK to it using `ITK_USE_SYSTEM_GDCM`. @@ -308,7 +308,7 @@ url = {} See [https://zenodo.org/record/3592082](https://zenodo.org/record/3592082). If you have a publication that used ITK, please create a pull request to -add it to [`ITKBibliography.bib`](https://github.com/InsightSoftwareConsortium/insightsoftwareconsortium.org/blob/master/static/citations-visualization/ITKBibliography.bib). +add it to [`ITKBibliography.bib`](https://github.com/InsightSoftwareConsortium/insightsoftwareconsortium.org/blob/main/static/citations-visualization/ITKBibliography.bib). If you want to include ITK in an acknowledgment section, a phrase similar to the following may be used: @@ -351,7 +351,7 @@ For mode details see the page [FDA guidelines for software development](fda_sw_d ### How do I configure Vim for ITK coding style? -ITK provides a [`clang-format` configuration file](https://github.com/InsightSoftwareConsortium/ITK/blob/master/.clang-format) +ITK provides a [`clang-format` configuration file](https://github.com/InsightSoftwareConsortium/ITK/blob/main/.clang-format) that ensures that the code being typed follows the ITK coding style. It suffices to tell Vim to use such configuration file. @@ -372,7 +372,7 @@ Please see this page: [ITK/Testing](https://insightsoftwareconsortium.github.io/ ### How do I iterate through all the pixels in an image? -Please see the [`ImageRegionIterator.cxx`](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Examples/Iterators/ImageRegionIterator.cxx) +Please see the [`ImageRegionIterator.cxx`](https://github.com/InsightSoftwareConsortium/ITK/blob/main/Examples/Iterators/ImageRegionIterator.cxx) example. ### What are Hounsfield Units? @@ -508,7 +508,7 @@ particular, you will find interesting the section where the mutual information metric is described. Examples on multimodality registration are available in -[Examples/RegistrationITKv4](https://github.com/InsightSoftwareConsortium/ITK/tree/master/Examples/RegistrationITKv4). +[Examples/RegistrationITKv4](https://github.com/InsightSoftwareConsortium/ITK/tree/main/Examples/RegistrationITKv4). It is strongly recommended that you read the chapter on "Geometric Transformations" section, where resampling is explained, before you get diff --git a/Documentation/docs/migration_guides/itk_5_migration_guide.md b/Documentation/docs/migration_guides/itk_5_migration_guide.md index 37716bfd41e..f0690605489 100644 --- a/Documentation/docs/migration_guides/itk_5_migration_guide.md +++ b/Documentation/docs/migration_guides/itk_5_migration_guide.md @@ -627,6 +627,6 @@ To resolve these errors, update the remote module's dependency specification in Update scripts -------------- -[Utilities/ITKv5Preparation](https://github.com/InsightSoftwareConsortium/ITK/tree/master/Utilities/ITKv5Preparation) directory contains +[Utilities/ITKv5Preparation](https://github.com/InsightSoftwareConsortium/ITK/tree/main/Utilities/ITKv5Preparation) directory contains bash scripts which have been used to update ITK to version 5. These scripts can assist with updating external code bases to ITK 5 content and style. diff --git a/Documentation/docs/migration_guides/itk_6_migration_guide.md b/Documentation/docs/migration_guides/itk_6_migration_guide.md index 815d9684650..5e7dfb45eac 100644 --- a/Documentation/docs/migration_guides/itk_6_migration_guide.md +++ b/Documentation/docs/migration_guides/itk_6_migration_guide.md @@ -25,7 +25,7 @@ All contents of the Deprecated module were removed. This includes TreeContainer and related classes; atomic primitives, mutexes and related classes which are now part of C++ standard; specialized Vector filters - specialized versions are no longer needed, as regular filters can work with vector images. For details, see -[ITKv5 Migration Guide](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/docs/migration_guides/itk_5_migration_guide.md). +[ITKv5 Migration Guide](https://github.com/InsightSoftwareConsortium/ITK/blob/main/Documentation/docs/migration_guides/itk_5_migration_guide.md). Prefer standard CXX language features rather than ITK macros ------------------------------------------------------------- diff --git a/README.md b/README.md index 5adb92d8c31..631abbffc07 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,18 @@ ITK: The Insight Toolkit [![GitHub release](https://img.shields.io/github/release/InsightSoftwareConsortium/ITK.svg)](https://github.com/InsightSoftwareConsortium/ITK/releases/latest) [![PyPI](https://img.shields.io/pypi/v/itk.svg)](https://pypi.python.org/pypi/itk) [![Wheels](https://img.shields.io/pypi/wheel/itk.svg)](https://pypi.org/project/itk) -[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/InsightSoftwareConsortium/ITK/blob/master/LICENSE) +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/InsightSoftwareConsortium/ITK/blob/main/LICENSE) [![DOI](https://zenodo.org/badge/800928.svg)](https://zenodo.org/badge/latestdoi/800928) [![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org) | | | C++ | Python | |:------:|:------:|:--------:|:--------:| -| Azure Pipelines | Linux | [![Build Status](https://dev.azure.com/itkrobotlinux/ITK.Linux/_apis/build/status/ITK.Linux?branchName=master)](https://dev.azure.com/itkrobotlinux/ITK.Linux/_build/latest?definitionId=2&branchName=master) | [![Build Status](https://dev.azure.com/itkrobotlinuxpython/ITK.Linux.Python/_apis/build/status/ITK.Linux.Python?branchName=master)](https://dev.azure.com/itkrobotlinuxpython/ITK.Linux.Python/_build/latest?definitionId=3&branchName=master) | -| Azure Pipelines | Windows | [![Build Status](https://dev.azure.com/itkrobotwindow/ITK.Windows/_apis/build/status/ITK.Windows?branchName=master)](https://dev.azure.com/itkrobotwindow/ITK.Windows/_build/latest?definitionId=2&branchName=master) | [![Build Status](https://dev.azure.com/itkrobotwindowpython/ITK.Windows.Python/_apis/build/status/ITK.Windows.Python?branchName=master)](https://dev.azure.com/itkrobotwindowpython/ITK.Windows.Python/_build/latest?definitionId=1) | -| Azure Pipelines | macOS | [![Build Status](https://dev.azure.com/itkrobotmacos/ITK.macOS/_apis/build/status/ITK.macOS?branchName=master)](https://dev.azure.com/itkrobotmacos/ITK.macOS/_build/latest?definitionId=2&branchName=master) | [![Build Status](https://dev.azure.com/itkrobotmacospython/ITK.macOS.Python/_apis/build/status/ITK.macOS.Python?branchName=master)](https://dev.azure.com/itkrobotmacospython/ITK.macOS.Python/_build/latest?definitionId=2&branchName=master) | +| Azure Pipelines | Linux | [![Build Status](https://dev.azure.com/itkrobotlinux/ITK.Linux/_apis/build/status/ITK.Linux?branchName=main)](https://dev.azure.com/itkrobotlinux/ITK.Linux/_build/latest?definitionId=2&branchName=main) | [![Build Status](https://dev.azure.com/itkrobotlinuxpython/ITK.Linux.Python/_apis/build/status/ITK.Linux.Python?branchName=main)](https://dev.azure.com/itkrobotlinuxpython/ITK.Linux.Python/_build/latest?definitionId=3&branchName=main) | +| Azure Pipelines | Windows | [![Build Status](https://dev.azure.com/itkrobotwindow/ITK.Windows/_apis/build/status/ITK.Windows?branchName=main)](https://dev.azure.com/itkrobotwindow/ITK.Windows/_build/latest?definitionId=2&branchName=main) | [![Build Status](https://dev.azure.com/itkrobotwindowpython/ITK.Windows.Python/_apis/build/status/ITK.Windows.Python?branchName=main)](https://dev.azure.com/itkrobotwindowpython/ITK.Windows.Python/_build/latest?definitionId=1) | +| Azure Pipelines | macOS | [![Build Status](https://dev.azure.com/itkrobotmacos/ITK.macOS/_apis/build/status/ITK.macOS?branchName=main)](https://dev.azure.com/itkrobotmacos/ITK.macOS/_build/latest?definitionId=2&branchName=main) | [![Build Status](https://dev.azure.com/itkrobotmacospython/ITK.macOS.Python/_apis/build/status/ITK.macOS.Python?branchName=main)](https://dev.azure.com/itkrobotmacospython/ITK.macOS.Python/_build/latest?definitionId=2&branchName=main) | | GitHub Actions | Linux, Windows, macOS | [![ITK.Pixi](https://github.com/InsightSoftwareConsortium/ITK/actions/workflows/pixi.yml/badge.svg)](https://github.com/InsightSoftwareConsortium/ITK/actions/workflows/pixi.yml) | | | GitHub Actions | macOS (Apple Silicon)| [![ITK.macOS.Arm64](https://github.com/InsightSoftwareConsortium/ITK/actions/workflows/macos-arm.yml/badge.svg)](https://github.com/InsightSoftwareConsortium/ITK/actions/workflows/macos-arm.yml)| | -| Azure Pipelines | Linux (Code coverage)| [![Build Status](https://dev.azure.com/itkrobotbatch/ITK.Coverage/_apis/build/status/ITK.Coverage?branchName=master)](https://dev.azure.com/itkrobotbatch/ITK.Coverage/_build/latest?definitionId=3&branchName=master) | | +| Azure Pipelines | Linux (Code coverage)| [![Build Status](https://dev.azure.com/itkrobotbatch/ITK.Coverage/_apis/build/status/ITK.Coverage?branchName=main)](https://dev.azure.com/itkrobotbatch/ITK.Coverage/_build/latest?definitionId=3&branchName=main) | | Links ----- @@ -59,7 +59,7 @@ pay for developer time, professional services, travel, workshops, and a variety @@ -94,9 +94,9 @@ software in teaching, research, and commercial applications, and maintaining webpages and user and developer communities. ITK is distributed under a license that enables use for both non-commercial and commercial applications. See -[LICENSE](https://github.com/InsightSoftwareConsortium/ITK/blob/master/LICENSE) +[LICENSE](https://github.com/InsightSoftwareConsortium/ITK/blob/main/LICENSE) and -[NOTICE](https://github.com/InsightSoftwareConsortium/ITK/blob/master/NOTICE) +[NOTICE](https://github.com/InsightSoftwareConsortium/ITK/blob/main/NOTICE) files for details. Supporting ITK @@ -143,7 +143,7 @@ To cite ITK, please reference, as appropriate: Once your work has been published, please create a pull request to add the publication to the -[ITKBibliography.bib](https://github.com/InsightSoftwareConsortium/insightsoftwareconsortium.org/blob/master/static/citations-visualization/ITKBibliography.bib) +[ITKBibliography.bib](https://github.com/InsightSoftwareConsortium/insightsoftwareconsortium.org/blob/main/static/citations-visualization/ITKBibliography.bib) file. [![Alt](https://repobeats.axiom.co/api/embed/e2194d411e086b1a9a9db4336692fdb302612295.svg "Repobeats analytics image")](https://github.com/InsightSoftwareConsortium/ITK/pulse/monthly) diff --git a/Testing/ContinuousIntegration/AzurePipelinesBatch.yml b/Testing/ContinuousIntegration/AzurePipelinesBatch.yml index 80da2bb4627..2e3f098220d 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesBatch.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesBatch.yml @@ -1,4 +1,4 @@ -# Build triggered on a rolling or batch basis on the master and release branches. They may take longer than the standard CI configurations. +# Build triggered on a rolling or batch basis on the main and release branches. They may take longer than the standard CI configurations. name: ITK.Batch @@ -6,7 +6,7 @@ trigger: batch: true branches: include: - - master + - main - release* pr: none diff --git a/Testing/ContinuousIntegration/AzurePipelinesLinux.yml b/Testing/ContinuousIntegration/AzurePipelinesLinux.yml index 9232aaaa65c..52d0442c0dd 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesLinux.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesLinux.yml @@ -3,7 +3,7 @@ name: ITK.Linux trigger: branches: include: - - master + - main - release* paths: exclude: diff --git a/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml b/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml index 01bac9d122c..efed1800d5a 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesLinuxPython.yml @@ -3,7 +3,7 @@ name: ITK.Linux.Python trigger: branches: include: - - master + - main - release* paths: exclude: diff --git a/Testing/ContinuousIntegration/AzurePipelinesMacOS.yml b/Testing/ContinuousIntegration/AzurePipelinesMacOS.yml index 6d212520487..063ab95d783 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesMacOS.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesMacOS.yml @@ -3,7 +3,7 @@ name: ITK.macOS trigger: branches: include: - - master + - main - release* paths: exclude: diff --git a/Testing/ContinuousIntegration/AzurePipelinesMacOSPython.yml b/Testing/ContinuousIntegration/AzurePipelinesMacOSPython.yml index 66c955669d1..32d5e76336c 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesMacOSPython.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesMacOSPython.yml @@ -3,7 +3,7 @@ name: ITK.macOS.Python trigger: branches: include: - - master + - main - release* paths: exclude: diff --git a/Testing/ContinuousIntegration/AzurePipelinesWindows.yml b/Testing/ContinuousIntegration/AzurePipelinesWindows.yml index bda43e8b1e8..9f590de69b6 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesWindows.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesWindows.yml @@ -3,7 +3,7 @@ name: ITK.Windows trigger: branches: include: - - master + - main - release* paths: exclude: diff --git a/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml b/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml index 66fce7ace2d..d5bea0a1855 100644 --- a/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml +++ b/Testing/ContinuousIntegration/AzurePipelinesWindowsPython.yml @@ -3,7 +3,7 @@ name: ITK.Windows.Python trigger: branches: include: - - master + - main - release* paths: exclude: diff --git a/Utilities/GitSetup/git-review-push b/Utilities/GitSetup/git-review-push index 3530c69fd42..81d06c1de6b 100755 --- a/Utilities/GitSetup/git-review-push +++ b/Utilities/GitSetup/git-review-push @@ -55,7 +55,7 @@ test -n "$remote" || remote="origin" if test -z "$no_topic"; then # Identify and validate the topic branch name. topic="$(git symbolic-ref HEAD | sed -e 's|^refs/heads/||')" - if test "$topic" = "master"; then + if test "$topic" = "main"; then die 'Please name your topic: git checkout -b descriptive-name' fi @@ -68,11 +68,11 @@ if test -z "$refspecs"; then exit 0 fi -# Fetch the current upstream master branch head. +# Fetch the current upstream main branch head. # This helps the computation of a minimal pack to push. if test -z "$upstream_remote"; then - echo "Fetching $upstream_remote master" - fetch_out=$(git fetch "$upstream_remote" master 2>&1) || die "$fetch_out" + echo "Fetching $upstream_remote main" + fetch_out=$(git fetch "$upstream_remote" main 2>&1) || die "$fetch_out" fi # Push. Save output and exit code. diff --git a/Utilities/GitSetup/setup-git-aliases b/Utilities/GitSetup/setup-git-aliases index 9eeb519535b..cc0840d7c0d 100755 --- a/Utilities/GitSetup/setup-git-aliases +++ b/Utilities/GitSetup/setup-git-aliases @@ -3,7 +3,7 @@ # Alias to checkout a pull request by its numerical id git config alias.pr "!bash Utilities/GitSetup/git-pr" # Remove previously checked out pull request -git config alias.pr-clean '!git checkout master ; git for-each-ref refs/heads/pr/* --format="%(refname)" | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done' +git config alias.pr-clean '!git checkout main ; git for-each-ref refs/heads/pr/* --format="%(refname)" | while read ref ; do branch=${ref#refs/heads/} ; git branch -D $branch ; done' # Alias to push the current topic branch to GitHub git config alias.review-push "!bash Utilities/GitSetup/git-review-push" @@ -12,5 +12,5 @@ git config alias.gerrit-push \ "!bash -c 'echo \\\"git gerrit-push\\\" is deprecated. Please use \\\"git review-push\\\" instead.'" # Useful alias to see what commits are on the current branch with respect to -# upstream/master -git config alias.prepush 'log --graph --stat upstream/master..' +# upstream/main +git config alias.prepush 'log --graph --stat upstream/main..' diff --git a/Utilities/ITKMigrationPreparation/update_remote_hash.sh b/Utilities/ITKMigrationPreparation/update_remote_hash.sh index b54e2d16924..7aa4356de09 100755 --- a/Utilities/ITKMigrationPreparation/update_remote_hash.sh +++ b/Utilities/ITKMigrationPreparation/update_remote_hash.sh @@ -44,10 +44,10 @@ fi pushd ${remoteCache} git fetch origin -git rebase origin/master +git rebase origin/main HEAD_HASH=$(git rev-parse --verify HEAD) sed -i"" "s/GIT_TAG .*/GIT_TAG ${HEAD_HASH}/g" ../${remoteFile} -MASTER_HASH=$(git rev-parse --verify origin/master) +MASTER_HASH=$(git rev-parse --verify origin/main) if [[ "${HEAD_HASH}" != "${MASTER_HASH}" ]]; then CURR_BRANCH=$(git rev-parse --abbrev-ref HEAD) if [[ "${CURR_BRANCH}" != "${branchName}" ]]; then @@ -65,8 +65,8 @@ ${COMMIT_MSG} "; else ## HEAD_HASH == MASTER_HASH - git checkout master - git rebase origin/master + git checkout main + git rebase origin/main fi if [[ $? -ne 0 ]]; then echo "*** ERROR---------------- -------- $(pwd)"; diff --git a/Utilities/Maintenance/ApplyScriptToRemotes.sh b/Utilities/Maintenance/ApplyScriptToRemotes.sh index a65370169f9..c1f38f33afd 100755 --- a/Utilities/Maintenance/ApplyScriptToRemotes.sh +++ b/Utilities/Maintenance/ApplyScriptToRemotes.sh @@ -30,7 +30,7 @@ # remote module repository. # # Please, review the commit message directives at: -# https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md +# https://github.com/InsightSoftwareConsortium/ITK/blob/main/CONTRIBUTING.md # Utility functions @@ -49,7 +49,7 @@ commits them using the provided commit message, and pushes the commit to the remote module repository. Please, review the commit message directives at: -https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md +https://github.com/InsightSoftwareConsortium/ITK/blob/main/CONTRIBUTING.md EOF } @@ -121,8 +121,8 @@ function list_candidate_remotes() { # Get the latest git commit hash of the remote module. # Remotes will usually not be tagged. - latest_commit=$(git ls-remote https://github.com/$repository refs/heads/master) - latest_commit=${latest_commit/[[:space:]]refs\/heads\/master/} + latest_commit=$(git ls-remote https://github.com/$repository refs/heads/main) + latest_commit=${latest_commit/[[:space:]]refs\/heads\/main/} # Skip remotes whose current commit in ITK differs from the latest if [ $curr_commit != $latest_commit ]; then @@ -170,8 +170,8 @@ function apply_script_and_push_remotes() { repository_basename=$(basename -s .git `git config --get remote.origin.url`) - git checkout main || git checkout master - git checkout -b $feature_branch origin/main || git checkout -b $feature_branch origin/master || git checkout $feature_branch + git checkout main || git checkout main + git checkout -b $feature_branch origin/main || git checkout -b $feature_branch origin/main || git checkout $feature_branch $script # Add the files, adding filters if necessary, and redirecting stdout and diff --git a/Utilities/Maintenance/clang-format.bash b/Utilities/Maintenance/clang-format.bash index 502a1b9257c..104a583ab91 100755 --- a/Utilities/Maintenance/clang-format.bash +++ b/Utilities/Maintenance/clang-format.bash @@ -50,7 +50,7 @@ Example to format the current topic: git filter-branch \ --tree-filter "Utilities/Maintenance/clang-format.bash --tracked" \ - master.. + main.. ' die() { diff --git a/Utilities/Maintenance/cmake-format.bash b/Utilities/Maintenance/cmake-format.bash index 37d19c5f37c..9318828308f 100755 --- a/Utilities/Maintenance/cmake-format.bash +++ b/Utilities/Maintenance/cmake-format.bash @@ -50,7 +50,7 @@ Example to format the current topic: git filter-branch \ --tree-filter "Utilities/Maintenance/cmake-format.bash --tracked" \ - master.. + main.. ' die() { diff --git a/Utilities/SetupForDevelopment.sh b/Utilities/SetupForDevelopment.sh index 1fab7ddb48c..8c4c1b75fce 100755 --- a/Utilities/SetupForDevelopment.sh +++ b/Utilities/SetupForDevelopment.sh @@ -29,9 +29,9 @@ Utilities/GitSetup/setup-git-aliases && echo && Utilities/GitSetup/tips && Utilities/GitSetup/github-tips -# Rebase master by default +# Rebase main by default git config rebase.stat true -git config branch.master.rebase true +git config branch.main.rebase true # Disable old Gerrit hooks hook=$(git config --get hooks.GerritId) && @@ -105,9 +105,60 @@ elif test ${git_version_arr[0]} -eq $git_required_major_version; then fi echo -e "Git version $git_version is OK.\n" +# Check if master branch exists and prompt to rename to main +if git show-ref --verify --quiet refs/heads/master; then + current_branch=$(git branch --show-current 2>/dev/null || git symbolic-ref --short HEAD 2>/dev/null) + echo "A 'master' branch exists in this repository." + echo "ITK has transitioned to using 'main' as the default branch name." + echo "" + + if test "$current_branch" = "master"; then + echo "You are currently on the 'master' branch." + else + echo "You are currently on the '$current_branch' branch." + fi + + read -p "Would you like to rename 'master' to 'main'? [y/N]: " -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + echo "Renaming master branch to main..." + + # Switch to master branch if not already there + if test "$current_branch" != "master"; then + echo "Switching to master branch..." + git checkout master + fi + + git branch -m master main + + # Update the upstream tracking if it exists + if git config --get branch.master.remote > /dev/null 2>&1; then + remote_name=$(git config --get branch.master.remote) + git config branch.main.remote "$remote_name" + git config branch.main.merge refs/heads/main + git config --unset branch.master.remote 2>/dev/null || true + git config --unset branch.master.merge 2>/dev/null || true + + echo "Updated upstream tracking to $remote_name/main" + echo "Note: You may need to update the default branch on your remote repository." + fi + + # Switch back to the original branch if it wasn't master + if test "$current_branch" != "master" && test "$current_branch" != ""; then + echo "Switching back to '$current_branch' branch..." + git checkout "$current_branch" + fi + + echo "Successfully renamed master to main." + else + echo "Keeping master branch name. Consider renaming to main in the future." + fi + echo +fi + (Utilities/GitSetup/setup-precommit || echo 'Failed to setup pre-commit.') && echo && # Record the version of this setup so Hooks/pre-commit can check it. -SetupForDevelopment_VERSION=11 +SetupForDevelopment_VERSION=12 git config hooks.SetupForDevelopment ${SetupForDevelopment_VERSION}