Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select/exclude a branch from processing #69

Merged
merged 12 commits into from
Mar 19, 2024
Merged

Conversation

devanshshukla99
Copy link
Owner

@devanshshukla99 devanshshukla99 commented Mar 3, 2024

By default, sphinx-versioned-docs will try to build all tags and branches present in the git repo.
However, this behaviour can be augmented using the --branch command-line-argument, to select/exclude particular branch(s) and tag(s).

They can be specified in the --branch argument as:

  • For selecting a branch:
    Mention the branch/tag name in the CLI arugment like:
        $ sphinx-versioned --branch "main,v2.0"
        $ sphinx-versioned --branch "+main,+v2.0"

Either of the two options above will select main, v2.0 and will only build these.

  • For excluding a branch:
    Mention the branch/tag name with - in the CLI argument like:
        $ sphinx-versioned --branch "-main,-v2.0"

The above command will build all available branches and tags except main, v2.0

  • For selecting and excluding simultaneously:
    Mention the branch/tag name with - in the CLI argument like:

        $ sphinx-versioned --branch "main,-v2.0"
    

The above command will only build main and will exclude -v2.0 (untouched because the package was only building main).

Some caveats while selecting/excluding branches:

  • When selecting some branches, the extension will only build these.

  • When excluding some branches, the extension will exclude those and build all other branches/tags present.

  • Excluding a branch will always take precedence over selecting a branch.

  • Build tests passed

  • Codestyle tests passed

  • Added test coverage for new features

  • Documentation updated to reflect the changes


Fixes #68

@devanshshukla99 devanshshukla99 marked this pull request as ready for review March 17, 2024 21:23
@devanshshukla99 devanshshukla99 added the documentation Improvements or additions to documentation label Mar 19, 2024
Copy link
Owner Author

@devanshshukla99 devanshshukla99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@devanshshukla99 devanshshukla99 merged commit 24bd344 into main Mar 19, 2024
13 checks passed
@devanshshukla99 devanshshukla99 deleted the exclude-branch branch March 19, 2024 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation feature refactor testing-infrastructure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow an option to exclude branches from processing
1 participant