├── .github ├── codeowners ├── funding.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.md │ └── bug_report.md ├── pull_request_template.md ├── workflows │ ├── super-linter.yml │ └── changelog.yml ├── dependabot.yml └── code_of_conduct.md ├── renovate.json ├── .whitesource ├── citation.cff ├── .gitignore ├── gunstage.plugin.zsh ├── bin └── git-unstage ├── readme.adoc ├── changelog.md └── license.adoc /.github/codeowners: -------------------------------------------------------------------------------- 1 | * @LucasLarson 2 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:base" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /.whitesource: -------------------------------------------------------------------------------- 1 | { 2 | "scanSettings": { 3 | "baseBranches": [] 4 | }, 5 | "checkRunSettings": { 6 | "vulnerableCheckRunConclusionLevel": "failure", 7 | "displayMode": "diff" 8 | }, 9 | "issueSettings": { 10 | "minSeverityLevel": "LOW" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.github/funding.yml: -------------------------------------------------------------------------------- 1 | --- 2 | github: LucasLarson 3 | patreon: lucaslarson 4 | open_collective: lucaslarson 5 | ko_fi: lucaslarson 6 | tidelift: # 1 Tidelift platform-name/package-name like `npm/babel` 7 | community_bridge: # 1 Community Bridge project-name like `cloud-foundry` 8 | liberapay: LucasLarson 9 | issuehunt: lucaslarson 10 | otechie: # 1 Otechie username 11 | custom: # ≤ 4 custom sponsorship URLs like `['link1', 'link2']` 12 | -------------------------------------------------------------------------------- /citation.cff: -------------------------------------------------------------------------------- 1 | --- 2 | cff-version: 1.2.0 3 | message: "Cite this software by using this metadata." 4 | title: gunstage 5 | abstract: | 6 | `gunstage` or `git unstage` is a command-line tool for unstaging files in a 7 | Git repository without the need to memorize the many ways Git recommends it 8 | be done and when. 9 | authors: 10 | - given-names: Lucas 11 | family-names: Larson 12 | orcid: https://orcid.org/0000-0002-0317-5426 13 | version: 1.9.1 14 | date-released: 2022-10-30 15 | license: GPL-3.0-or-later 16 | url: https://github.com/LucasLarson/gunstage 17 | repository-code: https://github.com/LucasLarson/gunstage 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Issue template 3 | # https://bit.ly/github-configuring-the-template-chooser 4 | blank_issues_enabled: true 5 | contact_links: 6 | - name: Bug report 7 | url: bug_report.md 8 | about: Please report project-specific bugs here. 9 | - name: Feature request 10 | url: feature_request.md 11 | about: Please submit new feature ideas here. 12 | - name: GitHub Community Support 13 | url: https://github.community/ 14 | about: Please ask and answer questions here. 15 | - name: GitHub Security Bug Bounty 16 | url: https://bounty.github.com/ 17 | about: Please report security vulnerabilities here. 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project. 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. For example, “I’m 9 | always frustrated when...”. 10 | 11 | **Describe the solution you’d like** 12 | A clear and concise description of what you want to happen. 13 | 14 | **Describe alternatives you’ve considered** 15 | A clear and concise description of any alternative solutions or features you’ve considered. 16 | 17 | **Additional context** 18 | Add any other context or screenshots about the feature request here. 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Zsh ### 2 | # Zsh compiled script + zrecompile backup 3 | *.zwc 4 | *.zwc.old 5 | 6 | # Zsh completion-optimization dumpfile 7 | *zcompdump* 8 | 9 | # Zsh zcalc history 10 | .zcalc_history 11 | 12 | # A popular plugin manager’s files 13 | ._zplugin 14 | .zplugin_lstupd 15 | 16 | # zdharma/zshelldoc tool’s files 17 | zsdoc/data 18 | 19 | # robbyrussell/oh-my-zsh/plugins/per-directory-history plugin’s files 20 | # (when set-up to store the history in the local directory) 21 | .directory_history 22 | 23 | # MichaelAquilina/zsh-autoswitch-virtualenv plugin’s files 24 | # (for Zsh plugins using Python) 25 | .venv 26 | 27 | # Zunit test output 28 | /tests/_output/* 29 | !/tests/_output/.gitkeep 30 | -------------------------------------------------------------------------------- /gunstage.plugin.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # 3 | # ╭╮ 4 | # ╭╯╰╮ 5 | # ╭──┬╮╭┬─╮╭──┼╮╭┼──┬──┬──╮ 6 | # │╭╮││││╭╮┤ ─┤│││╭╮│╭╮││─┤ 7 | # │╰╯│╰╯│││├──││╰┤╭╮│╰╯││─┤ 8 | # ╰─╮├──┴╯╰┴──╯╰─┴╯╰┴─╮├──╯ 9 | # ╭─╯│ ╭─╯│ 10 | # ╰──╯ ╰──╯ 11 | # 12 | # 13 | # gunstage 14 | # 🔫 `git unstage` as a service 15 | # author: Lucas Larson 16 | # license: GPLP 1.0 or later (GPL-compatible) 17 | # https://github.com/LucasLarson/gunstage 18 | # 19 | 20 | # enable `git unstage` in addition to `gunstage` 21 | # by adding `bin` directory to `PATH` 22 | export PATH="${0%/*}"'/bin'"${PATH:+:${PATH-}}" 23 | 24 | # keep backwards compatibility 25 | alias gunstage='git-unstage' 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve. 4 | 5 | --- 6 | 7 | # Bug report 8 | 9 | 15 | 16 | ## Summary 17 | 18 | 21 | 22 | ## To reproduce 23 | 24 | 27 | 1. 28 | 2. 29 | 3. 30 | 4. See error 31 | 32 | ## Expected results 33 | 34 | What I expected to see was . . . 35 | 38 | 39 | ## Actual results 40 | 41 | 44 | 45 | 50 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ### Description 5 | 6 | 7 | ### Motivation and context 8 | 9 | 10 | 11 | ### How this pull was tested 12 | 13 | 14 | 15 | 16 | 17 | ### Types of changes 18 | 19 | 20 | - [ ] Bug fix (non-breaking change which fixes an issue) 21 | - [ ] New feature (non-breaking change which adds functionality) 22 | - [ ] Breaking change (fix or feature that would change existing functionality) 23 | 24 | ### Checklist 25 | 26 | 27 | 28 | - [ ] My code follows the code style of this project. 29 | - [ ] My change requires a change to the documentation. 30 | - [ ] I have updated the documentation accordingly. 31 | - [ ] I have added tests to cover my changes. 32 | - [ ] All new and existing tests passed. 33 | 34 | 35 | -------------------------------------------------------------------------------- /.github/workflows/super-linter.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ######################### 3 | ######################### 4 | ## GitHub Super-Linter ## 5 | ######################### 6 | ######################### 7 | name: Super-Linter 8 | # https://bit.ly/git-io_workflow-syntax-for-github-actions 9 | 10 | ############################# 11 | # Start the job on all push # 12 | ############################# 13 | on: 14 | push: 15 | 16 | ############################ 17 | # Ensure safer permissions # 18 | ############################ 19 | permissions: 20 | contents: write 21 | 22 | ############### 23 | # Set the Job # 24 | ############### 25 | jobs: 26 | build: 27 | # Name the Job 28 | name: Lint Code Base 29 | # Set the agent to run on 30 | runs-on: ubuntu-latest 31 | 32 | ################## 33 | # Load all steps # 34 | ################## 35 | steps: 36 | ########################## 37 | # Checkout the code base # 38 | ########################## 39 | - name: Checkout Code 40 | uses: actions/checkout@v6 41 | with: 42 | # Super-Linter requires full repository history for analysis 43 | fetch-depth: 0 44 | persist-credentials: false 45 | 46 | ################################ 47 | # Run Linter against code base # 48 | ################################ 49 | - name: Lint Code Base 50 | uses: super-linter/super-linter@v8 # zizmor: ignore[unpinned-uses] 51 | env: 52 | VALIDATE_ALL_CODEBASE: false 53 | VALIDATE_BIOME_FORMAT: false 54 | DEFAULT_BRANCH: main 55 | # Super-Linter requires this variable even if it is unset 56 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 57 | -------------------------------------------------------------------------------- /bin/git-unstage: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # 3 | # ╭╮ 4 | # ╭╯╰╮ 5 | # ╭──┬╮╭┬─╮╭──┼╮╭┼──┬──┬──╮ 6 | # │╭╮││││╭╮┤ ─┤│││╭╮│╭╮││─┤ 7 | # │╰╯│╰╯│││├──││╰┤╭╮│╰╯││─┤ 8 | # ╰─╮├──┴╯╰┴──╯╰─┴╯╰┴─╮├──╯ 9 | # ╭─╯│ ╭─╯│ 10 | # ╰──╯ ╰──╯ 11 | # 12 | # 13 | # gunstage 14 | # 🔫 `git unstage` as a service 15 | # author: Lucas Larson 16 | # license: GPLP 1.0 or later (GPL-compatible) 17 | # https://github.com/LucasLarson/gunstage 18 | # 19 | 20 | gunstage() { 21 | 22 | # check whether we’re in a Git repository 23 | # https://stackoverflow.com/a/53809163 24 | if command git rev-parse --is-inside-work-tree >/dev/null 2>&1; then 25 | 26 | case $1 in 27 | -A | --all) 28 | 29 | # get top-level directory 30 | top_level_directory="$(command git rev-parse --show-toplevel)" 31 | 32 | # unstage everything 33 | command git reset --quiet HEAD -- "${top_level_directory-}" 34 | command git status 35 | ;; 36 | 37 | --new) 38 | # unstage only new files 39 | command git diff --cached --diff-filter=A --name-only --relative | while IFS='' read -r -- file; do 40 | command git reset --quiet HEAD -- "${file-}" 41 | done && command git status 42 | ;; 43 | 44 | -V | --version) 45 | command git --git-dir="$( 46 | command -v -- git-unstage | 47 | command sed -e 's/\(.*\)bin\/git-unstage/\1.git/' 48 | )" describe --tags 49 | exit 0 50 | ;; 51 | 52 | *) 53 | # run the same command against each argument, if any 54 | # otherwise use `.` for everything in the current directory and below 55 | for file in "${@:-.}"; do 56 | 57 | # https://github.com/gggritso/site/commit/a07b620 58 | command git reset --quiet HEAD -- "${file}" 59 | 60 | # perform a `git status` only if the loop was successful 61 | done && command git status 62 | 63 | ;; 64 | esac 65 | 66 | else 67 | # we’re not in a Git repository 68 | # store the failed if as a return status 69 | # https://github.com/ohmyzsh/ohmyzsh/pull/9238#discussion_r484806772 70 | return_value="$?" 71 | 72 | # if called from outside a Git repository, then 73 | # provide instructions on how to use it 74 | printf -- 'gunstage must be called from within a Git repository\n' >&2 75 | printf -- 'create a file and a repository, then stage and gunstage:\n 76 | touch file && # create a file called ' >&2 77 | printf -- '\342\200\234file\342\200\235 \134 78 | git init && # make a Git repository if necessary \134 79 | git add file && git status # stage the file you just created 80 | 81 | # now use \140gunstage\140 to unstage the file 82 | gunstage file # huzzah.\n\n 83 | gunstage # \360\237\224\253 \140git unstage\140 as a service 84 | https://github.com/LucasLarson/gunstage\n\n' >&2 85 | return "${return_value}" 86 | fi 87 | 88 | unset top_level_directory file return_value 89 | } 90 | 91 | gunstage "$@" 92 | -------------------------------------------------------------------------------- /.github/workflows/changelog.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Changelog 3 | 4 | on: 5 | push: 6 | branches: 7 | - main 8 | 9 | permissions: 10 | contents: write 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | timeout-minutes: 4 16 | if: "!contains(github.event.head_commit.message, 'update changelog')" 17 | steps: 18 | - uses: actions/checkout@v6 19 | with: 20 | persist-credentials: false 21 | - name: Set up Ruby 22 | uses: ruby/setup-ruby@v1 # zizmor: ignore[unpinned-uses] 23 | with: 24 | ruby-version: 3.4.7 25 | - name: Install `github_changelog_generator` 26 | run: | 27 | command gem install github_changelog_generator 28 | - name: Install `markdownlint` 29 | run: | 30 | command npm install markdownlint 31 | command npm install markdownlint-cli 32 | - name: Create local changes 33 | run: | 34 | command github_changelog_generator \ 35 | --user "$( 36 | command git config --get-regexp -- 'remote.*url' | 37 | command sed -E \ 38 | -e 's/(git@|https:\/\/)//' \ 39 | -e 's/:/\//' \ 40 | -e 's/\.git$//' | 41 | command awk -F '/' '{print $2}' | 42 | command head -n 1 43 | )" \ 44 | --project "$( 45 | command git remote get-url "$( 46 | { 47 | command git config --get --worktree checkout.defaultRemote || 48 | command git config --get --local checkout.defaultRemote || 49 | command git config --get --system checkout.defaultRemote || 50 | command git config --get --global checkout.defaultRemote 51 | } 2>/dev/null || 52 | printf 'origin' 53 | )" | 54 | command tr -d '[:space:]' | 55 | command xargs basename | 56 | command sed -e 's/\.git$//' 57 | )" \ 58 | --token ${{ secrets.GITHUB_TOKEN || secrets.PAT }} \ 59 | --exclude-labels 'duplicate,question,invalid,wontfix,nodoc' \ 60 | --output "$( 61 | command find -- . \ 62 | -maxdepth 1 \ 63 | -type f \ 64 | -name '*.m*d*' \ 65 | '(' \ 66 | -name 'change*log*' -o \ 67 | -name 'CHANGE*LOG*' \ 68 | ')' | 69 | command sed -e 's/^.\///' 70 | )" 71 | - name: Repair changelog credit 72 | run: | 73 | command find -- . \ 74 | -maxdepth 1 \ 75 | -type f \ 76 | -name '*.m*d*' \ 77 | '(' \ 78 | -name 'change*log*' -o \ 79 | -name 'CHANGE*LOG*' \ 80 | ')' \ 81 | -print \ 82 | -exec sed -i \ 83 | -e 's/This Changelog/This changelog/' \ 84 | -e 's/automatically generated/\[automatically generated\]()/' \ 85 | -e 's/\]()/\](.\/.github\/workflows\/changelog.yml)/' \ 86 | -e 's/generator)\*/generator).\*/' '{}' '+' 87 | - name: Lint changelog 88 | run: | 89 | command find -- . \ 90 | -maxdepth 1 \ 91 | -type f \ 92 | -name '*.m*d*' \ 93 | '(' \ 94 | -name 'change*log*' -o \ 95 | -name 'CHANGE*LOG*' \ 96 | ')' \ 97 | -print \ 98 | -exec npm exec -- markdownlint --fix -- '{}' ';' 99 | - name: Commit files 100 | run: | 101 | command git config -- user.email 'actions@github.com' 102 | command git config -- user.name 'GitHub' 103 | command find -- . \ 104 | -maxdepth 1 \ 105 | -type f \ 106 | -name '*.m*d*' \ 107 | '(' \ 108 | -name 'change*log*' -o \ 109 | -name 'CHANGE*LOG*' \ 110 | ')' \ 111 | -print \ 112 | -exec git add --verbose -- '{}' ';' 113 | command git commit --verbose \ 114 | --message='update changelog' || 115 | exit 0 116 | - name: Push changes 117 | uses: ad-m/github-push-action@v1.0.0 # zizmor: ignore[unpinned-uses] 118 | with: 119 | github_token: ${{ secrets.GITHUB_TOKEN || secrets.PAT }} 120 | branch: ${{ github.ref }} 121 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # Dependabot 3 | 4 | version: 2 5 | enable-beta-ecosystems: true 6 | updates: 7 | 8 | # Bundler 9 | - package-ecosystem: "bundler" 10 | directory: "/" 11 | schedule: 12 | interval: "daily" 13 | ignore: 14 | # ignore patch updates for all dependencies 15 | - dependency-name: "*" 16 | update-types: ["version-update:semver-minor"] 17 | 18 | # Cargo 19 | - package-ecosystem: "cargo" 20 | directory: "/" 21 | schedule: 22 | interval: "daily" 23 | ignore: 24 | # ignore patch updates for all dependencies 25 | - dependency-name: "*" 26 | update-types: ["version-update:semver-minor"] 27 | 28 | # Composer 29 | - package-ecosystem: "composer" 30 | directory: "/" 31 | schedule: 32 | interval: "daily" 33 | ignore: 34 | # ignore patch updates for all dependencies 35 | - dependency-name: "*" 36 | update-types: ["version-update:semver-minor"] 37 | 38 | # Docker 39 | - package-ecosystem: "docker" 40 | directory: "/" 41 | schedule: 42 | interval: "daily" 43 | ignore: 44 | # ignore patch updates for all dependencies 45 | - dependency-name: "*" 46 | update-types: ["version-update:semver-minor"] 47 | 48 | # Elm 49 | - package-ecosystem: "elm" 50 | directory: "/" 51 | schedule: 52 | interval: "daily" 53 | ignore: 54 | # ignore patch updates for all dependencies 55 | - dependency-name: "*" 56 | update-types: ["version-update:semver-minor"] 57 | 58 | # git submodules 59 | - package-ecosystem: "gitsubmodule" 60 | directory: "/" 61 | schedule: 62 | interval: "daily" 63 | ignore: 64 | # ignore patch updates for all dependencies 65 | - dependency-name: "*" 66 | update-types: ["version-update:semver-minor"] 67 | 68 | # GitHub Actions 69 | - package-ecosystem: "github-actions" 70 | directory: "/" 71 | schedule: 72 | interval: "daily" 73 | ignore: 74 | # ignore patch updates for all dependencies 75 | - dependency-name: "*" 76 | update-types: ["version-update:semver-minor"] 77 | 78 | # Go modules 79 | - package-ecosystem: "gomod" 80 | directory: "/" 81 | schedule: 82 | interval: "daily" 83 | ignore: 84 | # ignore patch updates for all dependencies 85 | - dependency-name: "*" 86 | update-types: ["version-update:semver-minor"] 87 | 88 | # Gradle 89 | - package-ecosystem: "gradle" 90 | directory: "/" 91 | schedule: 92 | interval: "daily" 93 | ignore: 94 | # ignore patch updates for all dependencies 95 | - dependency-name: "*" 96 | update-types: ["version-update:semver-minor"] 97 | 98 | # Maven 99 | - package-ecosystem: "maven" 100 | directory: "/" 101 | schedule: 102 | interval: "daily" 103 | ignore: 104 | # ignore patch updates for all dependencies 105 | - dependency-name: "*" 106 | update-types: ["version-update:semver-minor"] 107 | 108 | # Mix 109 | - package-ecosystem: "mix" 110 | directory: "/" 111 | schedule: 112 | interval: "daily" 113 | ignore: 114 | # ignore patch updates for all dependencies 115 | - dependency-name: "*" 116 | update-types: ["version-update:semver-minor"] 117 | 118 | # npm 119 | - package-ecosystem: "npm" 120 | directory: "/" 121 | schedule: 122 | interval: "daily" 123 | ignore: 124 | # ignore patch updates for all dependencies 125 | - dependency-name: "*" 126 | update-types: ["version-update:semver-minor"] 127 | 128 | # NuGet 129 | - package-ecosystem: "nuget" 130 | directory: "/" 131 | schedule: 132 | interval: "daily" 133 | ignore: 134 | # ignore patch updates for all dependencies 135 | - dependency-name: "*" 136 | update-types: ["version-update:semver-minor"] 137 | 138 | # pip 139 | - package-ecosystem: "pip" 140 | directory: "/" 141 | schedule: 142 | interval: "daily" 143 | ignore: 144 | # ignore patch updates for all dependencies 145 | - dependency-name: "*" 146 | update-types: ["version-update:semver-minor"] 147 | 148 | # pub 149 | - package-ecosystem: "pub" 150 | directory: "/" 151 | schedule: 152 | interval: "daily" 153 | ignore: 154 | # ignore patch updates for all dependencies 155 | - dependency-name: "*" 156 | update-types: ["version-update:semver-minor"] 157 | 158 | # Terraform 159 | - package-ecosystem: "terraform" 160 | directory: "/" 161 | schedule: 162 | interval: "daily" 163 | ignore: 164 | # ignore patch updates for all dependencies 165 | - dependency-name: "*" 166 | update-types: ["version-update:semver-minor"] 167 | -------------------------------------------------------------------------------- /.github/code_of_conduct.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment‑free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socioeconomic status, 9 | nationality, personal appearance, race, caste, color, religion, or sexual 10 | identity and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | - [Our Standards](#our-standards) 16 | - [Enforcement Responsibilities](#enforcement-responsibilities) 17 | - [Scope](#scope) 18 | - [Enforcement](#enforcement) 19 | - [Enforcement Guidelines](#enforcement-guidelines) 20 | 1. [Correction](#1-correction) 21 | 1. [Warning](#2-warning) 22 | 1. [Temporary Ban](#3-temporary-ban) 23 | 1. [Permanent Ban](#4-permanent-ban) 24 | - [Attribution](#attribution) 25 | 26 | ## Our Standards 27 | 28 | Examples of behavior that contributes to a positive environment for our 29 | community include: 30 | 31 | - Demonstrating empathy and kindness toward other people 32 | - Being respectful of differing opinions, viewpoints, and experiences 33 | - Giving and gracefully accepting constructive feedback 34 | - Accepting responsibility and apologizing to those affected by our mistakes, 35 | and learning from the experience 36 | - Focusing on what is best not just for us as individuals, but for the 37 | overall community 38 | 39 | Examples of unacceptable behavior include: 40 | 41 | - The use of sexualized language or imagery, and sexual attention or advances 42 | of any kind 43 | - Trolling, insulting or derogatory comments, and personal or 44 | political attacks 45 | - Public or private harassment 46 | - Publishing others’ private information, such as a physical or email address, 47 | without their explicit permission 48 | - Other conduct which could reasonably be considered inappropriate in a 49 | professional setting 50 | 51 | ## Enforcement Responsibilities 52 | 53 | Community leaders are responsible for clarifying and enforcing our standards of 54 | acceptable behavior and will take appropriate and fair corrective action in 55 | response to any behavior that they deem inappropriate, threatening, offensive, 56 | or harmful. 57 | 58 | Community leaders have the right and responsibility to remove, edit, or reject 59 | comments, commits, code, wiki edits, issues, and other contributions that are 60 | not aligned to this Code of Conduct, and will communicate reasons for 61 | moderation decisions when appropriate. 62 | 63 | ## Scope 64 | 65 | This Code of Conduct applies within all community spaces, and also applies when 66 | an individual is officially representing the community in public spaces. 67 | Examples of representing our community include using an official email address, 68 | posting via an official social media account, or acting as an appointed 69 | representative at an online or offline event. 70 | 71 | ## Enforcement 72 | 73 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 74 | reported to the community leaders responsible for enforcement 75 | at [github@LucasLarson.net](mailto:github@LucasLarson.net). All complaints 76 | will be reviewed and investigated promptly and fairly. 77 | 78 | All community leaders are obligated to respect the privacy and security of the 79 | reporter of any incident. 80 | 81 | ## Enforcement Guidelines 82 | 83 | Community leaders will follow these Community Impact Guidelines in determining 84 | the consequences for any action they deem in violation of this Code 85 | of Conduct: 86 | 87 | ### 1. Correction 88 | 89 | **Community Impact**: Use of inappropriate language or other behavior deemed 90 | unprofessional or unwelcome in the community. 91 | 92 | **Consequence**: A private, written warning from community leaders, providing 93 | clarity around the nature of the violation and an explanation of why the 94 | behavior was inappropriate. A public apology may be requested. 95 | 96 | ### 2. Warning 97 | 98 | **Community Impact**: A violation through a single incident or series 99 | of actions. 100 | 101 | **Consequence**: A warning with consequences for continued behavior. No 102 | interaction with the people involved, including unsolicited interaction with 103 | those enforcing the Code of Conduct, for a specified period of time. This 104 | includes avoiding interactions in community spaces as well as external channels 105 | like social media. Violating these terms may lead to a temporary or 106 | permanent ban. 107 | 108 | ### 3. Temporary Ban 109 | 110 | **Community Impact**: A serious violation of community standards, including 111 | sustained inappropriate behavior. 112 | 113 | **Consequence**: A temporary ban from any sort of interaction or public 114 | communication with the community for a specified period of time. No public 115 | or private interaction with the people involved is allowed during this period, 116 | including unsolicited interaction with those enforcing the Code 117 | of Conduct. Violating these terms may lead to a permanent ban. 118 | 119 | ### 4. Permanent Ban 120 | 121 | **Community Impact**: Demonstrating a pattern of violation of community 122 | standards, including sustained inappropriate behavior, harassment of an 123 | individual, or aggression toward or disparagement of classes 124 | of individuals. 125 | 126 | **Consequence**: A permanent ban from any sort of public interaction within 127 | the community. 128 | 129 | ## Attribution 130 | 131 | This Code of Conduct is adapted from the [Contributor 132 | Covenant](https://contributor-covenant.org), 133 | [version 2.1](https://contributor-covenant.org/version/2/1). 134 | 135 | Community Impact Guidelines were inspired by [Mozilla’s code of conduct 136 | enforcement ladder](https://github.com/mozilla/inclusion). 137 | 138 | For answers to common questions about this code of conduct, see 139 | [the FAQ](https://contributor-covenant.org/faq). [Translations 140 | are available](https://contributor-covenant.org/translations). 141 | -------------------------------------------------------------------------------- /readme.adoc: -------------------------------------------------------------------------------- 1 | gunstage 2 | -------- 3 | 4 | 🔫 `git unstage` as a service 5 | 6 | https://github.com/unixorn/awesome-zsh-plugins[image:https://github.com/sindresorhus/awesome/raw/a90737eb91368b3be912d1759f9573203ef9e70d/media/mentioned-badge.svg[🕶 7 | Mentioned in Awesome,title="🕶 Mentioned in Awesome"]] 8 | https://github.com/LucasLarson/gunstage/actions?query=workflow:Super-Linter[image:https://github.com/LucasLarson/gunstage/workflows/Super-Linter/badge.svg[GitHub 9 | Super-Linter]] 10 | https://github.com/LucasLarson/gunstage/blob/main/license.adoc[image:https://shields.io/badge/license-GPLP-blue[GPLP,title="GNU 11 | General Public License for Pedants"]] 12 | https://doi.org/10.5281/zenodo.6581323[image:https://zenodo.org/badge/DOI/10.5281/zenodo.6581323.svg[doi:10.5281/zenodo.6581323,title="Digital 13 | Object Identifier"]] 14 | 15 | What 16 | ~~~~ 17 | There are at least nine ways to unstage files in a Git repository. 18 | Remembering which versions of Git support which syntax, under which 19 | circumstances, reduced my productivity enough to publish this software 20 | in response. 21 | 22 | This is a command-line shell plugin for undoing `git add`. Too many 23 | staged files? Can’t remember if it’s `git reset HEAD` or 24 | `git restore --staged --`? Just remember `gunstage` or `git unstage`. 25 | 26 | `gunstage` works exactly as you would expect it to as it performs the opposite 27 | of `git add`. You can unstage directories and specific files in as few 28 | commands as you’d like: 29 | `gunstage file1.txt file2.txt directory/`. 30 | 31 | Want to unstage everything? Well that’s as easy as 32 | `gunstage --all` or `gunstage -A`. 33 | 34 | Why 35 | ~~~ 36 | There is no `git unstage` command packaged as part of Git’s 37 | default tooling. While `git restore --staged` often performs the task, 38 | it’s not an obvious formula based on Git’s other commands. 39 | `git restore --staged` is also unreliable, having 40 | https://web.archive.org/web/20201214132901id_/github.blog/2019-08-16-highlights-from-git-2-23/#experimental-alternatives-for-git-checkout[entered 41 | Git’s vocabulary in 2019^], after some 14 years of releases 42 | without it. Many older releases remain in the wild and `git restore` 43 | causes them to fail and choke. This software gracefully and silently accounts 44 | for those situations by always sending the syntax that Git used from 2005 until 45 | 2019: `git reset`. 46 | 47 | Instead of keeping up with the latest incarnation of Git, whose manual says 48 | `git restore` “IS EXPERIMENTAL” and “THE BEHAVIOR MAY CHANGE” (emphasis 49 | https://git-scm.com/docs/git-restore/2.30.0#_description[in original^]), you 50 | can let this script do the remembering for you. 51 | 52 | Minutiæ of the pedantic and querulous variety 53 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 54 | To unstage content in a Git repository – that is, to undo a 55 | `git add` – you must remember https://stackoverflow.com/q/58003030[which 56 | commands^] are still in use out of the many I’m aware of having been 57 | recommended so far: 58 | 59 | 1. `git restore --staged` (https://stackoverflow.com/a/16044987[source^]), 60 | 1. `git reset HEAD` (https://stackoverflow.com/a/6790291[source^]), 61 | 1. `git reset -q HEAD --` (https://github.com/gggritso/gggritso.com/blob/a07b620/_posts/2015-08-23-human-git-aliases.md#L45[source^] (https://news.ycombinator.com/item?id=17987033#17987696[via^])) 62 | 1. `git reset` (https://stackoverflow.com/a/6790285[source^]), 63 | 1. `git restore --staged --` (https://github.com/iain/dotfiles/commit/4c8f8cf7b849d723cbd0e029457dd24c42ea6263[source^]), 64 | 1. `git reset HEAD --` (https://stackoverflow.com/a/5798967[source^]), 65 | 1. `git rm --cached` (https://stackoverflow.com/a/5798967[source^]), 66 | 1. `git reset --` (https://stackoverflow.com/a/6919257[source^]), and even 67 | 1. `git rm --cached -- # ffs` (https://stackoverflow.com/a/30231316[source^]). 68 | 69 | Next, you must be aware of repository context: if the repository is new 70 | and no commit has occurred yet, then `git restore --staged` won’t work, 71 | but `gunstage` will. 72 | 73 | .Enter 74 | [source,zsh] 75 | ---- 76 | gunstage # 🔫 git unstage as a service 77 | git unstage # 🔫 it just works! 78 | ---- 79 | Its name is an abbreviation and portmanteau of `git unstage` arising by 80 | analog from 81 | https://github.com/ohmyzsh/ohmyzsh/blob/c99f3c50fa46a93be28be88632889404fff3b958/plugins/git/README.md#aliases[Oh My Zsh’s 82 | other Git aliases^]. 83 | 84 | How 85 | ~~~ 86 | The scripts are written in Bourne shell-flavored, KornShell- and Zsh-compatible 87 | Bash, which is masquerading as Z shell with a `.zsh` filename extension so 88 | Oh My Zsh recognizes it as a plugin. What does that mean? The 89 | syntax is 90 | https://github.com/mcornella/dotfiles/blob/51feef648a2d68a82348ed4753ac3d6b65972510/zshenv#L10-L11[as 91 | low-tech as possible^] while performing sophisticated work to do one thing and 92 | do it well: `git unstage`. 93 | 94 | Installation 95 | ^^^^^^^^^^^^ 96 | `gunstage` can be 97 | https://gist.github.com/06009589d7887617e061481e22cf5a4a[installed as a 98 | plugin^] or you can just clone this repository, run the following command, and 99 | then restart your terminal: 100 | [source,zsh] 101 | ---- 102 | $ printf '%s\n' '. /path/to/gunstage.plugin.zsh' \ 103 | >>"${HOME%/}"'/.'"${SHELL##*[-./]}"'rc' 104 | ---- 105 | 106 | Requirements 107 | ~~~~~~~~~~~~ 108 | * https://github.com/zsh-users/zsh/tree/zsh-5.8[Zsh 5.8^] (or 109 | https://github.com/att/ast/tree/ksh93u[Ksh 93^] (or 110 | https://git.sv.gnu.org/cgit/bash.git/commit/?h=bash-5.0[Bash 5.0^])), 111 | and 112 | * https://github.com/git/git/tree/v2.17.0[Git 2.17^]. 113 | 114 | Testing 115 | ~~~~~~~ 116 | I tested `gunstage` atop Zsh 5.8 and Bash 3.2 using Git: 117 | 118 | * 2.17 on Ubuntu 18.04, 119 | * 2.20 on Debian 9.12, 120 | * 2.28, 2.29, and 2.30 on macOS 11.0 and Alpine 3.11 and 3.12, 121 | and 122 | 123 | From macOS, I use https://github.com/gnachman/iTerm2[iTerm2^]; from iOS, I 124 | use https://github.com/ish-app/ish[iSH^]. 125 | 126 | Credit 127 | ~~~~~~ 128 | This repository’s 129 | https://web.archive.org/web/20220120220252/socialsharepreview.com/?url=https%3A%2F%2Fgithub.com%2FLucasLarson%2Fgunstage[preview 130 | image^] was created by 131 | https://github.com/twitter/twemoji/blob/7c1d3e9/2/svg/1f52b.svg[Twitter^] 132 | in 2018. 133 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## [Unreleased](https://github.com/LucasLarson/gunstage/tree/HEAD) 4 | 5 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.10.0...HEAD) 6 | 7 | **Implemented enhancements:** 8 | 9 | - add fig installation instructions [\#123](https://github.com/LucasLarson/gunstage/issues/123) 10 | 11 | **Closed issues:** 12 | 13 | - Twitter [\#132](https://github.com/LucasLarson/gunstage/issues/132) 14 | 15 | **Merged pull requests:** 16 | 17 | - chore\(deps\): bump actions/checkout from v5 to v6 [\#150](https://github.com/LucasLarson/gunstage/pull/150) ([dependabot[bot]](https://github.com/apps/dependabot)) 18 | - chore\(deps\): bump ruby from 3.1.0 to 3.4.7 [\#149](https://github.com/LucasLarson/gunstage/pull/149) ([renovate[bot]](https://github.com/apps/renovate)) 19 | - feat: skip Biome formatting [\#148](https://github.com/LucasLarson/gunstage/pull/148) ([LucasLarson](https://github.com/LucasLarson)) 20 | - revert: remove installation with Fig instructions [\#147](https://github.com/LucasLarson/gunstage/pull/147) ([LucasLarson](https://github.com/LucasLarson)) 21 | - feat: optimize `$PATH` relationship [\#146](https://github.com/LucasLarson/gunstage/pull/146) ([LucasLarson](https://github.com/LucasLarson)) 22 | - fix: prevent GitHub Actions credential persistence \(artipacked\) [\#145](https://github.com/LucasLarson/gunstage/pull/145) ([LucasLarson](https://github.com/LucasLarson)) 23 | - chore\(deps\): bump super-linter from v7 to v8 [\#144](https://github.com/LucasLarson/gunstage/pull/144) ([dependabot[bot]](https://github.com/apps/dependabot)) 24 | - fix: set GitHub actions permissions to `write` \(CKV2\_GHA\_1\) [\#142](https://github.com/LucasLarson/gunstage/pull/142) ([LucasLarson](https://github.com/LucasLarson)) 25 | - chore\(deps\): bump ad-m/github-push-action from v0.8.0 to v1.0.0 [\#141](https://github.com/LucasLarson/gunstage/pull/141) ([dependabot[bot]](https://github.com/apps/dependabot)) 26 | - chore\(deps\): bump actions/checkout from v4 to v5 [\#139](https://github.com/LucasLarson/gunstage/pull/139) ([dependabot[bot]](https://github.com/apps/dependabot)) 27 | - feat: add end-of-options delimiters [\#137](https://github.com/LucasLarson/gunstage/pull/137) ([LucasLarson](https://github.com/LucasLarson)) 28 | - chore\(deps\): bump github/super-linter from v5 to v7 [\#136](https://github.com/LucasLarson/gunstage/pull/136) ([renovate[bot]](https://github.com/apps/renovate)) 29 | - docs: add creation date to preview-image credit [\#133](https://github.com/LucasLarson/gunstage/pull/133) ([LucasLarson](https://github.com/LucasLarson)) 30 | - bump ad-m/github-push-action from v0.6.0 to v0.8.0 [\#131](https://github.com/LucasLarson/gunstage/pull/131) ([renovate[bot]](https://github.com/apps/renovate)) 31 | - bump actions/checkout from 3 to 4 [\#130](https://github.com/LucasLarson/gunstage/pull/130) ([dependabot[bot]](https://github.com/apps/dependabot)) 32 | - repair AsciiDoc code blocks [\#128](https://github.com/LucasLarson/gunstage/pull/128) ([LucasLarson](https://github.com/LucasLarson)) 33 | - ensure `root` `$HOME` expands to `/` [\#127](https://github.com/LucasLarson/gunstage/pull/127) ([LucasLarson](https://github.com/LucasLarson)) 34 | - bump github/super-linter from 4 to 5 [\#126](https://github.com/LucasLarson/gunstage/pull/126) ([dependabot[bot]](https://github.com/apps/dependabot)) 35 | - add fig installation link [\#124](https://github.com/LucasLarson/gunstage/pull/124) ([LucasLarson](https://github.com/LucasLarson)) 36 | 37 | ## [v1.10.0](https://github.com/LucasLarson/gunstage/tree/v1.10.0) (2023-01-12) 38 | 39 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.9.3...v1.10.0) 40 | 41 | ## [v1.9.3](https://github.com/LucasLarson/gunstage/tree/v1.9.3) (2022-11-24) 42 | 43 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.9.2...v1.9.3) 44 | 45 | **Merged pull requests:** 46 | 47 | - add installation instructions \(\#110\) [\#122](https://github.com/LucasLarson/gunstage/pull/122) ([LucasLarson](https://github.com/LucasLarson)) 48 | 49 | ## [v1.9.2](https://github.com/LucasLarson/gunstage/tree/v1.9.2) (2022-11-24) 50 | 51 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.9.1...v1.9.2) 52 | 53 | **Implemented enhancements:** 54 | 55 | - installation instructions [\#110](https://github.com/LucasLarson/gunstage/issues/110) 56 | 57 | ## [v1.9.1](https://github.com/LucasLarson/gunstage/tree/v1.9.1) (2022-10-30) 58 | 59 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.9.0...v1.9.1) 60 | 61 | **Implemented enhancements:** 62 | 63 | - add DeepSource flair [\#121](https://github.com/LucasLarson/gunstage/issues/121) 64 | - add mechanism to return version number \(\#117\) [\#120](https://github.com/LucasLarson/gunstage/pull/120) ([LucasLarson](https://github.com/LucasLarson)) 65 | - repair changelog credit [\#118](https://github.com/LucasLarson/gunstage/pull/118) ([LucasLarson](https://github.com/LucasLarson)) 66 | - bump Contributor Covenant Code of Conduct from v2.0 to v2.1 [\#111](https://github.com/LucasLarson/gunstage/pull/111) ([LucasLarson](https://github.com/LucasLarson)) 67 | 68 | **Fixed bugs:** 69 | 70 | - add `markdownlint` to changelog workflow [\#113](https://github.com/LucasLarson/gunstage/pull/113) ([LucasLarson](https://github.com/LucasLarson)) 71 | 72 | **Closed issues:** 73 | 74 | - calling `gunstage` from outside a repository returns a success exit code [\#119](https://github.com/LucasLarson/gunstage/issues/119) 75 | 76 | **Merged pull requests:** 77 | 78 | - expand Dependabot [\#115](https://github.com/LucasLarson/gunstage/pull/115) ([LucasLarson](https://github.com/LucasLarson)) 79 | 80 | ## [v1.9.0](https://github.com/LucasLarson/gunstage/tree/v1.9.0) (2022-10-23) 81 | 82 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.8.2...v1.9.0) 83 | 84 | **Implemented enhancements:** 85 | 86 | - add mechanism to return current version number [\#117](https://github.com/LucasLarson/gunstage/issues/117) 87 | 88 | **Fixed bugs:** 89 | 90 | - the changelog fails Super-Linter’s `markdownlint` [\#112](https://github.com/LucasLarson/gunstage/issues/112) 91 | 92 | ## [v1.8.2](https://github.com/LucasLarson/gunstage/tree/v1.8.2) (2022-05-25) 93 | 94 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.8.1...v1.8.2) 95 | 96 | ## [v1.8.1](https://github.com/LucasLarson/gunstage/tree/v1.8.1) (2022-05-25) 97 | 98 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.8.0...v1.8.1) 99 | 100 | ## [v1.8.0](https://github.com/LucasLarson/gunstage/tree/v1.8.0) (2022-05-25) 101 | 102 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.7.1...v1.8.0) 103 | 104 | ## [v1.7.1](https://github.com/LucasLarson/gunstage/tree/v1.7.1) (2022-05-25) 105 | 106 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.7.0...v1.7.1) 107 | 108 | **Fixed bugs:** 109 | 110 | - `git.io` deprecation [\#108](https://github.com/LucasLarson/gunstage/issues/108) 111 | 112 | **Merged pull requests:** 113 | 114 | - remove `git.io` links \(fix \#108\) [\#109](https://github.com/LucasLarson/gunstage/pull/109) ([LucasLarson](https://github.com/LucasLarson)) 115 | 116 | ## [v1.7.0](https://github.com/LucasLarson/gunstage/tree/v1.7.0) (2022-03-29) 117 | 118 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.6.0...v1.7.0) 119 | 120 | **Implemented enhancements:** 121 | 122 | - add a `Mentioned in Awesome` button [\#102](https://github.com/LucasLarson/gunstage/issues/102) 123 | - commands not prepended by `command` can produce unexpected behavior [\#97](https://github.com/LucasLarson/gunstage/issues/97) 124 | - Markdown syntax errors [\#95](https://github.com/LucasLarson/gunstage/issues/95) 125 | - add preferred repository citation [\#107](https://github.com/LucasLarson/gunstage/pull/107) ([LucasLarson](https://github.com/LucasLarson)) 126 | - use `command` to avoid unexpected behavior \(fix \#97\) [\#98](https://github.com/LucasLarson/gunstage/pull/98) ([LucasLarson](https://github.com/LucasLarson)) 127 | - repair Markdown syntax \(fix \#95\) [\#96](https://github.com/LucasLarson/gunstage/pull/96) ([LucasLarson](https://github.com/LucasLarson)) 128 | 129 | **Closed issues:** 130 | 131 | - there’s no attribution for the social media preview image [\#99](https://github.com/LucasLarson/gunstage/issues/99) 132 | 133 | **Merged pull requests:** 134 | 135 | - bump `actions/cache` action from v2 to v3 [\#106](https://github.com/LucasLarson/gunstage/pull/106) ([dependabot[bot]](https://github.com/apps/dependabot)) 136 | - add a Mentioned in Awesome button \(\#104\) \(fix \#102\) [\#104](https://github.com/LucasLarson/gunstage/pull/104) ([RishiKumarRay](https://github.com/RishiKumarRay)) 137 | - bump actions/checkout action from v2 to v3 [\#101](https://github.com/LucasLarson/gunstage/pull/101) ([renovate[bot]](https://github.com/apps/renovate)) 138 | - add credit for pistol icon \(fix \#99\) [\#100](https://github.com/LucasLarson/gunstage/pull/100) ([LucasLarson](https://github.com/LucasLarson)) 139 | 140 | ## [v1.6.0](https://github.com/LucasLarson/gunstage/tree/v1.6.0) (2021-10-22) 141 | 142 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1...v1.6.0) 143 | 144 | **Implemented enhancements:** 145 | 146 | - add support for `git unstage --all` [\#89](https://github.com/LucasLarson/gunstage/issues/89) 147 | - clear variables with `unset` instead of a subshell [\#81](https://github.com/LucasLarson/gunstage/issues/81) 148 | - add functionality to unstage everything with `gunstage --all` \(fix \#89\) [\#94](https://github.com/LucasLarson/gunstage/pull/94) ([LucasLarson](https://github.com/LucasLarson)) 149 | - use `unset` instead of subshell for local variable \(fix \#81\) [\#90](https://github.com/LucasLarson/gunstage/pull/90) ([LucasLarson](https://github.com/LucasLarson)) 150 | - prevent the creation of a `$PATH` that begins with a colon `:` [\#79](https://github.com/LucasLarson/gunstage/pull/79) ([LucasLarson](https://github.com/LucasLarson)) 151 | - use major semver dependency versions where possible [\#76](https://github.com/LucasLarson/gunstage/pull/76) ([LucasLarson](https://github.com/LucasLarson)) 152 | - integrate DeepSource’s expanded offerings into kitchen-sink configuration [\#75](https://github.com/LucasLarson/gunstage/pull/75) ([LucasLarson](https://github.com/LucasLarson)) 153 | - repair Git content in changelog generator [\#73](https://github.com/LucasLarson/gunstage/pull/73) ([LucasLarson](https://github.com/LucasLarson)) 154 | - remove second instance of 🔫 from shell script comments [\#70](https://github.com/LucasLarson/gunstage/pull/70) ([LucasLarson](https://github.com/LucasLarson)) 155 | - remove inactive TypoCI configuration [\#69](https://github.com/LucasLarson/gunstage/pull/69) ([LucasLarson](https://github.com/LucasLarson)) 156 | 157 | **Fixed bugs:** 158 | 159 | - broken link [\#91](https://github.com/LucasLarson/gunstage/issues/91) 160 | - add `--allow-empty` to changelog’s `git commit` [\#86](https://github.com/LucasLarson/gunstage/pull/86) ([LucasLarson](https://github.com/LucasLarson)) 161 | - exclude autogenerated changelog from DeepSource analysis [\#83](https://github.com/LucasLarson/gunstage/pull/83) ([LucasLarson](https://github.com/LucasLarson)) 162 | 163 | **Closed issues:** 164 | 165 | - `actions/setup-ruby` is deprecated [\#62](https://github.com/LucasLarson/gunstage/issues/62) 166 | 167 | **Merged pull requests:** 168 | 169 | - Update github/super-linter action to v4 [\#87](https://github.com/LucasLarson/gunstage/pull/87) ([renovate[bot]](https://github.com/apps/renovate)) 170 | - Format code with black, gofmt, yapf, autopep8, isort, standardrb, standardjs, prettier, rubocop and google-java-format [\#78](https://github.com/LucasLarson/gunstage/pull/78) ([deepsource-autofix[bot]](https://github.com/apps/deepsource-autofix)) 171 | - repair, tszuj GitHub Super-Linter [\#74](https://github.com/LucasLarson/gunstage/pull/74) ([LucasLarson](https://github.com/LucasLarson)) 172 | - reduce repetition in @Dependabot section headings [\#72](https://github.com/LucasLarson/gunstage/pull/72) ([LucasLarson](https://github.com/LucasLarson)) 173 | - replace deprecated `actions/setup-ruby` with `ruby/setup-ruby` \(fix \#62\) [\#63](https://github.com/LucasLarson/gunstage/pull/63) ([LucasLarson](https://github.com/LucasLarson)) 174 | - Update github/super-linter action to v3.16.2 [\#61](https://github.com/LucasLarson/gunstage/pull/61) ([renovate[bot]](https://github.com/apps/renovate)) 175 | - Update github/super-linter action to v3.16.1 [\#60](https://github.com/LucasLarson/gunstage/pull/60) ([renovate[bot]](https://github.com/apps/renovate)) 176 | - Update ibiqlik/action-yamllint action to v3.0.1 [\#58](https://github.com/LucasLarson/gunstage/pull/58) ([renovate[bot]](https://github.com/apps/renovate)) 177 | - Update actions/cache action to v2.1.5 [\#57](https://github.com/LucasLarson/gunstage/pull/57) ([renovate[bot]](https://github.com/apps/renovate)) 178 | - Update github/super-linter action to v3.15.5 [\#56](https://github.com/LucasLarson/gunstage/pull/56) ([renovate[bot]](https://github.com/apps/renovate)) 179 | - Update github/super-linter action to v3.15.3 [\#54](https://github.com/LucasLarson/gunstage/pull/54) ([renovate[bot]](https://github.com/apps/renovate)) 180 | - Update github/super-linter action to v3.15.2 [\#52](https://github.com/LucasLarson/gunstage/pull/52) ([renovate[bot]](https://github.com/apps/renovate)) 181 | - Update actions/setup-ruby action to v1.1.3 [\#49](https://github.com/LucasLarson/gunstage/pull/49) ([renovate[bot]](https://github.com/apps/renovate)) 182 | - Update actions/cache action to v2.1.4 [\#48](https://github.com/LucasLarson/gunstage/pull/48) ([renovate[bot]](https://github.com/apps/renovate)) 183 | - Update github/super-linter action to v3.14.5 [\#47](https://github.com/LucasLarson/gunstage/pull/47) ([renovate[bot]](https://github.com/apps/renovate)) 184 | 185 | ## [v1](https://github.com/LucasLarson/gunstage/tree/v1) (2021-01-25) 186 | 187 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.5...v1) 188 | 189 | ## [v1.5](https://github.com/LucasLarson/gunstage/tree/v1.5) (2021-01-25) 190 | 191 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.5.0...v1.5) 192 | 193 | ## [v1.5.0](https://github.com/LucasLarson/gunstage/tree/v1.5.0) (2021-01-25) 194 | 195 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.4.0...v1.5.0) 196 | 197 | **Implemented enhancements:** 198 | 199 | - remove double quotation marks where not suggested by ShellCheck [\#46](https://github.com/LucasLarson/gunstage/issues/46) 200 | - remove array if possible [\#45](https://github.com/LucasLarson/gunstage/issues/45) 201 | 202 | **Closed issues:** 203 | 204 | - Action Required: Fix Renovate Configuration [\#44](https://github.com/LucasLarson/gunstage/issues/44) 205 | 206 | ## [v1.4.0](https://github.com/LucasLarson/gunstage/tree/v1.4.0) (2021-01-18) 207 | 208 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.3.0...v1.4.0) 209 | 210 | **Fixed bugs:** 211 | 212 | - regression: filenames with spaces cause unexpected results on Linux [\#37](https://github.com/LucasLarson/gunstage/issues/37) 213 | 214 | **Closed issues:** 215 | 216 | - another `git unstage` syntax found in the wild [\#41](https://github.com/LucasLarson/gunstage/issues/41) 217 | 218 | **Merged pull requests:** 219 | 220 | - Update github/super-linter action to v3.14.4 [\#42](https://github.com/LucasLarson/gunstage/pull/42) ([renovate[bot]](https://github.com/apps/renovate)) 221 | - Update github/super-linter action to v3.14.3 [\#39](https://github.com/LucasLarson/gunstage/pull/39) ([renovate[bot]](https://github.com/apps/renovate)) 222 | - Update github/super-linter action to v3.14.0 [\#38](https://github.com/LucasLarson/gunstage/pull/38) ([renovate[bot]](https://github.com/apps/renovate)) 223 | - remove gaurav-nelson/github-action-markdown-link-check workflow [\#36](https://github.com/LucasLarson/gunstage/pull/36) ([LucasLarson](https://github.com/LucasLarson)) 224 | 225 | ## [v1.3.0](https://github.com/LucasLarson/gunstage/tree/v1.3.0) (2020-11-12) 226 | 227 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.2.1...v1.3.0) 228 | 229 | **Closed issues:** 230 | 231 | - Please add a top-level license file [\#28](https://github.com/LucasLarson/gunstage/issues/28) 232 | 233 | **Merged pull requests:** 234 | 235 | - Update ibiqlik/action-yamllint action to v3 [\#34](https://github.com/LucasLarson/gunstage/pull/34) ([renovate[bot]](https://github.com/apps/renovate)) 236 | - Make gunstage also work as `git unstage` [\#32](https://github.com/LucasLarson/gunstage/pull/32) ([unixorn](https://github.com/unixorn)) 237 | - Restyle repair changelog links [\#31](https://github.com/LucasLarson/gunstage/pull/31) ([restyled-io[bot]](https://github.com/apps/restyled-io)) 238 | - repair changelog links [\#30](https://github.com/LucasLarson/gunstage/pull/30) ([LucasLarson](https://github.com/LucasLarson)) 239 | 240 | ## [v1.2.1](https://github.com/LucasLarson/gunstage/tree/v1.2.1) (2020-11-07) 241 | 242 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.2...v1.2.1) 243 | 244 | **Fixed bugs:** 245 | 246 | - `grep --quiet` doesn’t port to BusyBox [\#27](https://github.com/LucasLarson/gunstage/issues/27) 247 | 248 | **Merged pull requests:** 249 | 250 | - repair cross-OS compatibility \(fix \#27\) [\#29](https://github.com/LucasLarson/gunstage/pull/29) ([LucasLarson](https://github.com/LucasLarson)) 251 | - Update actions/cache action to v2.1.3 [\#26](https://github.com/LucasLarson/gunstage/pull/26) ([renovate[bot]](https://github.com/apps/renovate)) 252 | - Update actions/checkout action to v2.3.4 [\#23](https://github.com/LucasLarson/gunstage/pull/23) ([renovate[bot]](https://github.com/apps/renovate)) 253 | - Update github/super-linter action to v3.13.5 [\#22](https://github.com/LucasLarson/gunstage/pull/22) ([renovate[bot]](https://github.com/apps/renovate)) 254 | - Update github/super-linter action to v3.13.3 [\#21](https://github.com/LucasLarson/gunstage/pull/21) ([renovate[bot]](https://github.com/apps/renovate)) 255 | - add [automatically generated](./.github/workflows/changelog.yml) changelog workflow [\#20](https://github.com/LucasLarson/gunstage/pull/20) ([LucasLarson](https://github.com/LucasLarson)) 256 | 257 | ## [v1.2](https://github.com/LucasLarson/gunstage/tree/v1.2) (2020-10-31) 258 | 259 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.2.0...v1.2) 260 | 261 | ## [v1.2.0](https://github.com/LucasLarson/gunstage/tree/v1.2.0) (2020-10-31) 262 | 263 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.1...v1.2.0) 264 | 265 | **Fixed bugs:** 266 | 267 | - `git restore` requires `git --version` ≥ 2.23.0 or later [\#7](https://github.com/LucasLarson/gunstage/issues/7) 268 | 269 | **Closed issues:** 270 | 271 | - ∃ ≥ 5 ways to `git unstage`: `git reset --` seen in the wild [\#8](https://github.com/LucasLarson/gunstage/issues/8) 272 | 273 | **Merged pull requests:** 274 | 275 | - Update github/super-linter action to v3.13.2 [\#19](https://github.com/LucasLarson/gunstage/pull/19) ([renovate[bot]](https://github.com/apps/renovate)) 276 | - Update ibiqlik/action-yamllint action to v2 [\#17](https://github.com/LucasLarson/gunstage/pull/17) ([renovate[bot]](https://github.com/apps/renovate)) 277 | - Update gaurav-nelson/github-action-markdown-link-check action to v1.0.8 [\#16](https://github.com/LucasLarson/gunstage/pull/16) ([renovate[bot]](https://github.com/apps/renovate)) 278 | - Bump github/super-linter from v3.13.0 to v3.13.1 [\#15](https://github.com/LucasLarson/gunstage/pull/15) ([dependabot[bot]](https://github.com/apps/dependabot)) 279 | - Bump github/super-linter from v3.12.0 to v3.13.0 [\#14](https://github.com/LucasLarson/gunstage/pull/14) ([dependabot[bot]](https://github.com/apps/dependabot)) 280 | - Bump github/super-linter from v3.11.0 to v3.12.0 [\#13](https://github.com/LucasLarson/gunstage/pull/13) ([dependabot[bot]](https://github.com/apps/dependabot)) 281 | - remove `docker` URI scheme from Super-Linter configuration [\#12](https://github.com/LucasLarson/gunstage/pull/12) ([LucasLarson](https://github.com/LucasLarson)) 282 | - Configure Renovate [\#10](https://github.com/LucasLarson/gunstage/pull/10) ([renovate[bot]](https://github.com/apps/renovate)) 283 | - add fifth competing syntax for unstaging \(fix \#8\) [\#9](https://github.com/LucasLarson/gunstage/pull/9) ([LucasLarson](https://github.com/LucasLarson)) 284 | 285 | ## [v1.1](https://github.com/LucasLarson/gunstage/tree/v1.1) (2020-09-29) 286 | 287 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.1.3...v1.1) 288 | 289 | ## [v1.1.3](https://github.com/LucasLarson/gunstage/tree/v1.1.3) (2020-09-29) 290 | 291 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.1.2...v1.1.3) 292 | 293 | **Merged pull requests:** 294 | 295 | - repair Asciidoc link to Super-Linter results [\#6](https://github.com/LucasLarson/gunstage/pull/6) ([LucasLarson](https://github.com/LucasLarson)) 296 | - `.github` repairs, extensions [\#5](https://github.com/LucasLarson/gunstage/pull/5) ([LucasLarson](https://github.com/LucasLarson)) 297 | - Update actions/checkout requirement to v2.3.3 [\#4](https://github.com/LucasLarson/gunstage/pull/4) ([dependabot[bot]](https://github.com/apps/dependabot)) 298 | - Bump gaurav-nelson/github-action-markdown-link-check from v1.0.7 to 1.0.7 [\#3](https://github.com/LucasLarson/gunstage/pull/3) ([dependabot[bot]](https://github.com/apps/dependabot)) 299 | 300 | ## [v1.1.2](https://github.com/LucasLarson/gunstage/tree/v1.1.2) (2020-09-22) 301 | 302 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.1.1...v1.1.2) 303 | 304 | ## [v1.1.1](https://github.com/LucasLarson/gunstage/tree/v1.1.1) (2020-09-16) 305 | 306 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.1.0...v1.1.1) 307 | 308 | **Merged pull requests:** 309 | 310 | - `unset` execution string to prevent memory leak [\#2](https://github.com/LucasLarson/gunstage/pull/2) ([LucasLarson](https://github.com/LucasLarson)) 311 | - rename Lint Code Base to Super-Linter [\#1](https://github.com/LucasLarson/gunstage/pull/1) ([LucasLarson](https://github.com/LucasLarson)) 312 | 313 | ## [v1.1.0](https://github.com/LucasLarson/gunstage/tree/v1.1.0) (2020-09-09) 314 | 315 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/v1.0.0...v1.1.0) 316 | 317 | ## [v1.0.0](https://github.com/LucasLarson/gunstage/tree/v1.0.0) (2020-09-08) 318 | 319 | [Full Changelog](https://github.com/LucasLarson/gunstage/compare/b7f69194517342887d251b17708fd8f52223a675...v1.0.0) 320 | 321 | \* *This changelog was [automatically generated](./.github/workflows/changelog.yml) by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator).* 322 | -------------------------------------------------------------------------------- /license.adoc: -------------------------------------------------------------------------------- 1 | :toc: macro 2 | :toclevels: 3 3 | 4 | [[top]] 5 | = GNU General Public License for Pedants 6 | 7 | Version 1, 13 August 2020 8 | 9 | ''' 10 | 11 | Copyright © 2020 Free Software Foundation, Inc. https://fsf.org[fsf.org^] 12 | 13 | Everyone is permitted to copy and distribute verbatim copies of this license 14 | document, but changing it is not allowed. 15 | 16 | toc::[] 17 | 18 | [[preamble]] 19 | == Preamble 20 | 21 | The GNU General Public License for Pedants is a free, copyleft license for 22 | software and other kinds of works. 23 | 24 | The licenses for most software and other practical works are designed to take 25 | away your freedom to share and change the works. By contrast, the GNU 26 | General Public License for Pedants is intended to guarantee your freedom 27 | to share and change all versions of a program – to make sure it remains 28 | free software for all its users. We, the Free Software Foundation, use the 29 | GNU General Public License for most of our software; it applies also to any 30 | other work released this way by its authors. You can apply it to your 31 | programs, too. 32 | 33 | When we speak of free software, we are referring to freedom, not price. 34 | Our General Public Licenses are designed to make sure that you have the freedom 35 | to distribute copies of free software (and charge for them if you wish), that 36 | you receive source code or can get it if you want it, that you can change the 37 | software or use pieces of it in new free programs, and that you know you can do 38 | these things. 39 | 40 | To protect your rights, we need to prevent others from denying you these rights 41 | or asking you to surrender the rights. Therefore, you have certain 42 | responsibilities if you distribute copies of the software, or if you 43 | modify it: responsibilities to respect the freedom of others. 44 | 45 | For example, if you distribute copies of such a program, whether gratis or for 46 | a fee, you must pass on to the recipients the same freedoms that 47 | you received. You must make sure that they, too, receive or can get the 48 | source code. And you must show them these terms so they know 49 | their rights. 50 | 51 | Developers that use the GNU GPLP protect your rights with two steps: 52 | 53 | . assert copyright on the software, and 54 | . offer you this License giving you legal permission to copy, distribute and/or 55 | modify it. 56 | 57 | For the developers’ and authors’ protection, the GPLP clearly explains that 58 | there is no warranty for this free software. For both users’ and authors’ 59 | sake, the GPLP requires that modified versions be marked as changed, so that 60 | their problems will not be attributed erroneously to authors of 61 | previous versions. 62 | 63 | Some devices are designed to deny users access to install or run modified 64 | versions of the software inside them, although the manufacturer can do so. 65 | This is fundamentally incompatible with the aim of protecting users’ freedom to 66 | change the software. The systematic pattern of such abuse occurs in the 67 | area of products for individuals to use, which is precisely where it is 68 | most unacceptable. Therefore, we have designed this version of the GPLP to 69 | prohibit the practice for those products. If such problems arise 70 | substantially in other domains, we stand ready to extend this provision to 71 | those domains in future versions of the GPLP, as needed to protect the freedom 72 | of users. 73 | 74 | Finally, every program is threatened constantly by software patents. 75 | States should not allow patents to restrict development and use of software on 76 | general‑purpose computers, but in those that do, we wish to avoid the special 77 | danger that patents applied to a free program could make it 78 | effectively proprietary. To prevent this, the GPLP assures that patents 79 | cannot be used to render the program non‑free. 80 | 81 | The precise terms and conditions for copying, distribution and 82 | modification follow. 83 | 84 | [[terms]] 85 | == Terms and Conditions 86 | 87 | [[section0]] 88 | === 0. Definitions 89 | 90 | “This License” refers to version 1 of the GNU General Public License 91 | for Pedants. 92 | 93 | “Copyright” also means copyright‑like laws that apply to other kinds of works, 94 | such as semiconductor masks. 95 | 96 | “The Program” refers to any copyrightable work licensed under 97 | this License. Each licensee is addressed as “you”. “Licensees” and 98 | “recipients” may be individuals or organizations. 99 | 100 | To “modify” a work means to copy from or adapt all or part of the work in a 101 | fashion requiring copyright permission, other than the making of an 102 | exact copy. The resulting work is called a “modified version” of the 103 | earlier work or a work “based on” the earlier work. 104 | 105 | A “covered work” means either the unmodified Program or a work based on 106 | the Program. 107 | 108 | To “propagate” a work means to do anything with it that, without permission, 109 | would make you directly or secondarily liable for infringement under applicable 110 | copyright law, except executing it on a computer or modifying a 111 | private copy. Propagation includes copying, distribution (with or without 112 | modification), making available to the public, and in some countries other 113 | activities as well. 114 | 115 | To “convey” a work means any kind of propagation that enables other parties to 116 | make or receive copies. Mere interaction with a user through a computer 117 | network, with no transfer of a copy, is not conveying. 118 | 119 | An interactive user interface displays “Appropriate Legal Notices” to the 120 | extent that it includes a convenient and prominently visible feature that 121 | 122 | . displays an appropriate copyright notice, and 123 | . tells the user that there is no warranty for the work (except to the extent 124 | that warranties are provided), that licensees may convey the work under this 125 | License, and how to view a copy of this License. 126 | 127 | If the interface presents a list of user commands or options, such as a menu, a 128 | prominent item in the list meets this criterion. 129 | 130 | [[section1]] 131 | === 1. Source Code 132 | 133 | The “source code” for a work means the preferred form of the work for making 134 | modifications to it. “Object code” means any non‑source form of 135 | a work. 136 | 137 | A “Standard Interface” means an interface that either is an official standard 138 | defined by a recognized standards body, or, in the case of interfaces specified 139 | for a particular programming language, one that is widely used among developers 140 | working in that language. 141 | 142 | The “System Libraries” of an executable work include anything, other than the 143 | work as a whole, that 144 | 145 | [loweralpha] 146 | . is included in the normal form of packaging a Major Component, but which is 147 | not part of that Major Component, and 148 | . serves only to enable use of the work with that Major Component, or to 149 | implement a Standard Interface for which an implementation is available to 150 | the public in source code form. 151 | 152 | A “Major Component”, in this context, means a major essential component 153 | (kernel, window system, and so on) of the specific operating system (if any) on 154 | which the executable work runs, or a compiler used to produce the work, or an 155 | object code interpreter used to run it. 156 | 157 | The “Corresponding Source” for a work in object code form means all the source 158 | code needed to generate, install, and (for an executable work) run the object 159 | code and to modify the work, including scripts to control 160 | those activities. However, it does not include the work’s System 161 | Libraries, or general‑purpose tools or generally available free programs which 162 | are used unmodified in performing those activities but which are not part of 163 | the work. For example, Corresponding Source includes interface definition 164 | files associated with source files for the work, and the source code for shared 165 | libraries and dynamically linked subprograms that the work is specifically 166 | designed to require, such as by intimate data communication or control flow 167 | between those subprograms and other parts of the work. 168 | 169 | The Corresponding Source need not include anything that users can regenerate 170 | automatically from other parts of the Corresponding Source. 171 | 172 | The Corresponding Source for a work in source code form is that same work. 173 | 174 | [[section2]] 175 | === 2. Basic Permissions 176 | 177 | All rights granted under this License are granted for the term of copyright on 178 | the Program, and are irrevocable provided the stated conditions are met. 179 | This License explicitly affirms your unlimited permission to run the 180 | unmodified Program. The output from running a covered work is covered by 181 | this License only if the output, given its content, constitutes a 182 | covered work. This License acknowledges your rights of fair use or other 183 | equivalent, as provided by copyright law. 184 | 185 | You may make, run and propagate covered works that you do not convey, without 186 | conditions so long as your license otherwise remains in force. You may 187 | convey covered works to others for the sole purpose of having them make 188 | modifications exclusively for you, or provide you with facilities for running 189 | those works, provided that you comply with the terms of this License in 190 | conveying all material for which you do not control copyright. Those thus 191 | making or running the covered works for you must do so exclusively on your 192 | behalf, under your direction and control, on terms that prohibit them from 193 | making any copies of your copyrighted material outside their relationship 194 | with you. 195 | 196 | Conveying under any other circumstances is permitted solely under the 197 | conditions stated below. Sublicensing is not allowed; 198 | xref:section10[section 10] makes it unnecessary. 199 | 200 | [[section3]] 201 | === 3. Protecting Users’ Legal Rights From Anti‑Circumvention Law 202 | 203 | No covered work shall be deemed part of an effective technological measure 204 | under any applicable law fulfilling obligations under 205 | https://wipo.int/treaties/en/text.jsp?file_id=295166#P87_12240[article 11 206 | of the WIPO copyright treaty adopted on 20 December 1996^], or similar laws 207 | prohibiting or restricting circumvention of such measures. 208 | 209 | When you convey a covered work, you waive any legal power to forbid 210 | circumvention of technological measures to the extent such circumvention is 211 | effected by exercising rights under this License with respect to the covered 212 | work, and you disclaim any intention to limit operation or modification of the 213 | work as a means of enforcing, against the work’s users, your or third parties’ 214 | legal rights to forbid circumvention of technological measures. 215 | 216 | [[section4]] 217 | === 4. Conveying Verbatim Copies 218 | 219 | You may convey verbatim copies of the Program’s source code as you receive it, 220 | in any medium, provided that you conspicuously and appropriately publish on 221 | each copy an appropriate copyright notice; keep intact all notices stating that 222 | this License and any non‑permissive terms added in accord with 223 | xref:section7[section 7] apply to the code; keep intact all notices of the 224 | absence of any warranty; and give all recipients a copy of this License along 225 | with the Program. 226 | 227 | You may charge any price or no price for each copy that you convey, and you may 228 | offer support or warranty protection for a fee. 229 | 230 | [[section5]] 231 | === 5. Conveying Modified Source Versions 232 | 233 | You may convey a work based on the Program, or the modifications to produce it 234 | from the Program, in the form of source code under the terms of 235 | xref:section4[section 4], provided that you also meet all of 236 | these conditions: 237 | 238 | [loweralpha] 239 | . The work must carry prominent notices stating that you modified it, and 240 | giving a relevant date. 241 | . The work must carry prominent notices stating that it is released under this 242 | License and any conditions added under xref:section7[section 7]. This 243 | requirement modifies the requirement in xref:section4[section 4] to 244 | “keep intact all notices”. 245 | . You must license the entire work, as a whole, under this License to anyone 246 | who comes into possession of a copy. This License will therefore apply, 247 | along with any applicable xref:section7[section 7] additional terms, to 248 | the whole of the work, and all its parts, regardless of how they 249 | are packaged. This License gives no permission to license the work in 250 | any other way, but it does not invalidate such permission if you have 251 | separately received it. 252 | . If the work has interactive user interfaces, each must display Appropriate 253 | Legal Notices; however, if the Program has interactive interfaces that do not 254 | display Appropriate Legal Notices, your work need not make them do so. 255 | 256 | A compilation of a covered work with other separate and independent works, 257 | which are not by their nature extensions of the covered work, and which are not 258 | combined with it such as to form a larger program, in or on a volume of a 259 | storage or distribution medium, is called an “aggregate” if the compilation and 260 | its resulting copyright are not used to limit the access or legal rights of the 261 | compilation’s users beyond what the individual works permit. Inclusion of 262 | a covered work in an aggregate does not cause this License to apply to the 263 | other parts of the aggregate. 264 | 265 | [[section6]] 266 | === 6. Conveying Non‑Source Forms 267 | 268 | You may convey a covered work in object code form under the terms of 269 | xref:section4[sections 4] and xref:section5[5], provided that you 270 | also convey the machine‑readable Corresponding Source under the terms of this 271 | License, in one of these ways: 272 | 273 | [loweralpha] 274 | . Convey the object code in, or embodied in, a physical product (including a 275 | physical distribution medium), accompanied by the Corresponding Source fixed 276 | on a durable physical medium customarily used for software interchange. 277 | . Convey the object code in, or embodied in, a physical product (including a 278 | physical distribution medium), accompanied by a written offer, valid for at 279 | least three years and valid for as long as you offer spare parts or customer 280 | support for that product model, to give anyone who possesses the object code 281 | either (1) a copy of the Corresponding Source for all the software in 282 | the product that is covered by this License, on a durable physical medium 283 | customarily used for software interchange, for a price no more than your 284 | reasonable cost of physically performing this conveying of source, or 285 | (2) access to copy the Corresponding Source from a network server at 286 | no charge. 287 | . Convey individual copies of the object code with a copy of the written offer 288 | to provide the Corresponding Source. This alternative is allowed only 289 | occasionally and noncommercially, and only if you received the object code 290 | with such an offer, in accord with subsection 6b. 291 | . Convey the object code by offering access from a designated place (gratis or 292 | for a charge), and offer equivalent access to the Corresponding Source in the 293 | same way through the same place at no further charge. You need not 294 | require recipients to copy the Corresponding Source along with the 295 | object code. If the place to copy the object code is a network server, 296 | the Corresponding Source may be on a different server (operated by you or a 297 | third party) that supports equivalent copying facilities, provided you 298 | maintain clear directions next to the object code saying where to find the 299 | Corresponding Source. Regardless of what server hosts the Corresponding 300 | Source, you remain obligated to ensure that it is available for as long as 301 | needed to satisfy these requirements. 302 | . Convey the object code using peer‑to‑peer transmission, provided you inform 303 | other peers where the object code and Corresponding Source of the work are 304 | being offered to the general public at no charge under subsection 6d. 305 | 306 | A separable portion of the object code, whose source code is excluded from the 307 | Corresponding Source as a System Library, need not be included in conveying the 308 | object code work. 309 | 310 | A “User Product” is either 311 | 312 | . a “consumer product”, which means any tangible personal property which is 313 | normally used for personal, family, or household purposes, or 314 | . anything designed or sold for incorporation into a dwelling. 315 | 316 | In determining whether a product is a consumer product, doubtful cases shall be 317 | resolved in favor of coverage. For a particular product received by a 318 | particular user, “normally used” refers to a typical or common use of that 319 | class of product, regardless of the status of the particular user or of the way 320 | in which the particular user actually uses, or expects or is expected to use, 321 | the product. A product is a consumer product regardless of whether the 322 | product has substantial commercial, industrial or non‑consumer uses, unless 323 | such uses represent the only significant mode of use of the product. 324 | 325 | “Installation Information” for a User Product means any methods, procedures, 326 | authorization keys, or other information required to install and execute 327 | modified versions of a covered work in that User Product from a modified 328 | version of its Corresponding Source. The information must suffice to 329 | ensure that the continued functioning of the modified object code is in no case 330 | prevented or interfered with solely because modification has been made. 331 | 332 | If you convey an object code work under this section in, or with, or 333 | specifically for use in, a User Product, and the conveying occurs as part of a 334 | transaction in which the right of possession and use of the User Product is 335 | transferred to the recipient in perpetuity or for a fixed term (regardless of 336 | how the transaction is characterized), the Corresponding Source conveyed under 337 | this section must be accompanied by the Installation Information. But this 338 | requirement does not apply if neither you nor any third party retains the 339 | ability to install modified object code on the User Product (for example, the 340 | work has been installed in ROM). 341 | 342 | The requirement to provide Installation Information does not include a 343 | requirement to continue to provide support service, warranty, or updates for a 344 | work that has been modified or installed by the recipient, or for the User 345 | Product in which it has been modified or installed. Access to a network 346 | may be denied when the modification itself materially and adversely affects the 347 | operation of the network or violates the rules and protocols for communication 348 | across the network. 349 | 350 | Corresponding Source conveyed, and Installation Information provided, in accord 351 | with this section must be in a format that is publicly documented (and with an 352 | implementation available to the public in source code form), and must require 353 | no special password or key for unpacking, reading or copying. 354 | 355 | [[section7]] 356 | === 7. Additional Terms 357 | 358 | “Additional permissions” are terms that supplement the terms of this License by 359 | making exceptions from one or more of its conditions. Additional 360 | permissions that are applicable to the entire Program shall be treated as 361 | though they were included in this License, to the extent that they are valid 362 | under applicable law. If additional permissions apply only to part of the 363 | Program, that part may be used separately under those permissions, but the 364 | entire Program remains governed by this License without regard to the 365 | additional permissions. 366 | 367 | When you convey a copy of a covered work, you may at your option remove any 368 | additional permissions from that copy, or from any part of it. (Additional 369 | permissions may be written to require their own removal in certain cases when 370 | you modify the work). You may place additional permissions on material, 371 | added by you to a covered work, for which you have or can give appropriate 372 | copyright permission. 373 | 374 | Notwithstanding any other provision of this License, for material you add to a 375 | covered work, you may (if authorized by the copyright holders of that material) 376 | supplement the terms of this License with terms: 377 | 378 | [loweralpha] 379 | . Disclaiming warranty or limiting liability differently from the terms of 380 | xref:section15[sections 15] and xref:section16[16] of this 381 | License; or 382 | . Requiring preservation of specified reasonable legal notices or author 383 | attributions in that material or in the Appropriate Legal Notices displayed 384 | by works containing it; or 385 | . Prohibiting misrepresentation of the origin of that material, or requiring 386 | that modified versions of such material be marked in reasonable ways as 387 | different from the original version; or 388 | . Limiting the use for publicity purposes of names of licensors or authors of 389 | the material; or 390 | . Declining to grant rights under trademark law for use of some trade names, 391 | trademarks, or service marks; or 392 | . Requiring indemnification of licensors and authors of that material by anyone 393 | who conveys the material (or modified versions of it) with contractual 394 | assumptions of liability to the recipient, for any liability that these 395 | contractual assumptions directly impose on those licensors and authors. 396 | 397 | All other non‑permissive additional terms are considered “further restrictions” 398 | within the meaning of xref:section10[section 10]. If the Program as you 399 | received it, or any part of it, contains a notice stating that it is governed 400 | by this License along with a term that is a further restriction, you may remove 401 | that term. If a license document contains a further restriction but 402 | permits relicensing or conveying under this License, you may add to a covered 403 | work material governed by the terms of that license document, provided that the 404 | further restriction does not survive such relicensing or conveying. 405 | 406 | If you add terms to a covered work in accord with this section, you must place, 407 | in the relevant source files, a statement of the additional terms that apply to 408 | those files, or a notice indicating where to find the applicable terms. 409 | 410 | Additional terms, permissive or non‑permissive, may be stated in the form of a 411 | separately written license, or stated as exceptions; the above requirements 412 | apply either way. 413 | 414 | [[section8]] 415 | === 8. Termination 416 | 417 | You may not propagate or modify a covered work except as expressly provided 418 | under this License. Any attempt otherwise to propagate or modify it is 419 | void, and will automatically terminate your rights under this License 420 | (including any patent licenses granted under the third paragraph of 421 | xref:section11[section 11]). 422 | 423 | However, if you cease all violation of this License, then your license from a 424 | particular copyright holder is reinstated 425 | 426 | [loweralpha] 427 | . provisionally, unless and until the copyright holder explicitly and finally 428 | terminates your license, and 429 | . permanently, if the copyright holder fails to notify you of the violation by 430 | some reasonable means prior to 60 days after the cessation. 431 | 432 | Moreover, your license from a particular copyright holder is reinstated 433 | permanently if the copyright holder notifies you of the violation by some 434 | reasonable means, this is the first time you have received notice of violation 435 | of this License (for any work) from that copyright holder, and you cure the 436 | violation prior to 30 days after your receipt of the notice. 437 | 438 | Termination of your rights under this section does not terminate the licenses 439 | of parties who have received copies or rights from you under this License. 440 | If your rights have been terminated and not permanently reinstated, you do not 441 | qualify to receive new licenses for the same material under 442 | xref:section10[section 10]. 443 | 444 | [[section9]] 445 | === 9. Acceptance Not Required for Having Copies 446 | 447 | You are not required to accept this License in order to receive or run a copy 448 | of the Program. Ancillary propagation of a covered work occurring solely 449 | as a consequence of using peer‑to‑peer transmission to receive a copy likewise 450 | does not require acceptance. However, nothing other than this License 451 | grants you permission to propagate or modify any covered work. These 452 | actions infringe copyright if you do not accept this License. Therefore, 453 | by modifying or propagating a covered work, you indicate your acceptance of 454 | this License to do so. 455 | 456 | [[section10]] 457 | === 10. Automatic Licensing of Downstream Recipients 458 | 459 | Each time you convey a covered work, the recipient automatically receives a 460 | license from the original licensors, to run, modify and propagate that work, 461 | subject to this License. You are not responsible for enforcing compliance 462 | by third parties with this License. 463 | 464 | An “entity transaction” is a transaction transferring control of an 465 | organization, or substantially all assets of one, or subdividing an 466 | organization, or merging organizations. If propagation of a covered work 467 | results from an entity transaction, each party to that transaction who receives 468 | a copy of the work also receives whatever licenses to the work the party’s 469 | predecessor in interest had or could give under the previous paragraph, plus a 470 | right to possession of the Corresponding Source of the work from the 471 | predecessor in interest, if the predecessor has it or can get it with 472 | reasonable efforts. 473 | 474 | You may not impose any further restrictions on the exercise of the rights 475 | granted or affirmed under this License. For example, you may not impose a 476 | license fee, royalty, or other charge for exercise of rights granted under this 477 | License, and you may not initiate litigation (including a cross‑claim or 478 | counterclaim in a lawsuit) alleging that any patent claim is infringed by 479 | making, using, selling, offering for sale, or importing the Program or any 480 | portion of it. 481 | 482 | [[section11]] 483 | === 11. Patents 484 | 485 | A “contributor” is a copyright holder who authorizes use under this License of 486 | the Program or a work on which the Program is based. The work thus 487 | licensed is called the contributor’s “contributor version”. 488 | 489 | A contributor’s “essential patent claims” are all patent claims owned or 490 | controlled by the contributor, whether already acquired or hereafter acquired, 491 | that would be infringed by some manner, permitted by this License, of making, 492 | using, or selling its contributor version, but do not include claims that would 493 | be infringed only as a consequence of further modification of the 494 | contributor version. For purposes of this definition, “control” includes 495 | the right to grant patent sublicenses in a manner consistent with the 496 | requirements of this License. 497 | 498 | Each contributor grants you a non‑exclusive, worldwide, royalty‑free patent 499 | license under the contributor’s essential patent claims, to make, use, sell, 500 | offer for sale, import and otherwise run, modify and propagate the contents of 501 | its contributor version. 502 | 503 | In the following three paragraphs, a “patent license” is any express agreement 504 | or commitment, however denominated, not to enforce a patent (such as an express 505 | permission to practice a patent or covenant not to sue for 506 | patent infringement). To “grant” such a patent license to a party means to 507 | make such an agreement or commitment not to enforce a patent against 508 | the party. 509 | 510 | If you convey a covered work, knowingly relying on a patent license, and the 511 | Corresponding Source of the work is not available for anyone to copy, free of 512 | charge and under the terms of this License, through a publicly available 513 | network server or other readily accessible means, then you must either 514 | 515 | . cause the Corresponding Source to be so available, or 516 | . arrange to deprive yourself of the benefit of the patent license for this 517 | particular work, or 518 | . arrange, in a manner consistent with the requirements of this License, to 519 | extend the patent license to downstream recipients. 520 | 521 | “Knowingly relying” means you have actual knowledge that, but for the patent 522 | license, your conveying the covered work in a country, or your recipient’s use 523 | of the covered work in a country, would infringe one or more identifiable 524 | patents in that country that you have reason to believe are valid. 525 | 526 | If, pursuant to or in connection with a single transaction or arrangement, you 527 | convey, or propagate by procuring conveyance of, a covered work, and grant a 528 | patent license to some of the parties receiving the covered work authorizing 529 | them to use, propagate, modify or convey a specific copy of the covered work, 530 | then the patent license you grant is automatically extended to all recipients 531 | of the covered work and works based on it. 532 | 533 | A patent license is “discriminatory” if it does not include within the scope of 534 | its coverage, prohibits the exercise of, or is conditioned on the non‑exercise 535 | of one or more of the rights that are specifically granted under 536 | this License. You may not convey a covered work if you are a party to an 537 | arrangement with a third party that is in the business of distributing 538 | software, under which you make payment to the third party based on the extent 539 | of your activity of conveying the work, and under which the third party grants, 540 | to any of the parties who would receive the covered work from you, a 541 | discriminatory patent license 542 | 543 | [loweralpha] 544 | . in connection with copies of the covered work conveyed by you (or copies made 545 | from those copies), or 546 | . primarily for and in connection with specific products or compilations that 547 | contain the covered work, unless you entered into that arrangement, or that 548 | patent license was granted, prior to 28 March 2007. 549 | 550 | Nothing in this License shall be construed as excluding or limiting any implied 551 | license or other defenses to infringement that may otherwise be available to 552 | you under applicable patent law. 553 | 554 | [[section12]] 555 | === 12. No Surrender of Others’ Freedom 556 | 557 | If conditions are imposed on you (whether by court order, agreement or 558 | otherwise) that contradict the conditions of this License, they do not excuse 559 | you from the conditions of this License. If you cannot convey a covered 560 | work so as to satisfy simultaneously your obligations under this License and 561 | any other pertinent obligations, then as a consequence you may not convey it 562 | at all. For example, if you agree to terms that obligate you to collect a 563 | royalty for further conveying from those to whom you convey the Program, the 564 | only way you could satisfy both those terms and this License would be to 565 | refrain entirely from conveying the Program. 566 | 567 | [[section13]] 568 | === 13. Use with the GNU Affero General Public License 569 | 570 | Notwithstanding any other provision of this License, you have permission to 571 | link or combine any covered work with a work licensed under 572 | https://gnu.org/licenses/agpl-3.0[version 3 of the GNU Affero General 573 | Public License^] into a single combined work, and to convey the 574 | resulting work. The terms of this License will continue to apply to the 575 | part which is the covered work, but the special requirements of the 576 | https://gnu.org/licenses/agpl#section13[GNU Affero General Public License, 577 | section 13], concerning interaction through a network will apply to the 578 | combination as such. 579 | 580 | [[section14]] 581 | === 14. Revised Versions of this License 582 | 583 | The Free Software Foundation may publish revised and/or new versions of the GNU 584 | General Public License from time to time. Such new versions will be 585 | similar in spirit to the present version, but may differ in detail to address 586 | new problems or concerns. 587 | 588 | Each version is given a distinguishing version number. If the Program 589 | specifies that a certain numbered version of the GNU General Public License 590 | for Pedants “or any later version” applies to it, you have the option of 591 | following the terms and conditions either of that numbered version or of any 592 | later version published by the Free Software Foundation. If the Program 593 | does not specify a version number of the GNU General Public License 594 | for Pedants, you may choose any version ever published by the Free 595 | Software Foundation. 596 | 597 | If the Program specifies that a proxy can decide which future versions of the 598 | GNU General Public License for Pedants can be used, that proxy’s public 599 | statement of acceptance of a version permanently authorizes you to choose that 600 | version for the Program. 601 | 602 | Later license versions may give you additional or different permissions. 603 | However, no additional obligations are imposed on any author or copyright 604 | holder as a result of your choosing to follow a later version. 605 | 606 | [[section15]] 607 | === 15. Disclaimer of Warranty 608 | 609 | There is no warranty for the program, to the extent permitted by 610 | applicable law. Except when otherwise stated in writing the copyright 611 | holders and/or other parties provide the program “as is” without warranty of 612 | any kind, either expressed or implied, including, but not limited to, the 613 | implied warranties of merchantability and fitness for a 614 | particular purpose. The entire risk as to the quality and performance of 615 | the program is with you. Should the program prove defective, you assume 616 | the cost of all necessary servicing, repair, or correction. 617 | 618 | [[section16]] 619 | === 16. Limitation of Liability 620 | 621 | In no event unless required by applicable law or agreed to in writing will any 622 | copyright holder, or any other party who modifies and/or conveys the program as 623 | permitted above, be liable to you for damages, including any general, special, 624 | incidental or consequential damages arising out of the use or inability to use 625 | the program (including but not limited to loss of data or data being rendered 626 | inaccurate or losses sustained by you or third parties or a failure of the 627 | program to operate with any other programs), even if such holder or other party 628 | has been advised of the possibility of such damages. 629 | 630 | [[section17]] 631 | === 17. Interpretation of Sections 15 and 16 632 | 633 | If the disclaimer of warranty and limitation of liability provided above cannot 634 | be given local legal effect according to their terms, reviewing courts shall 635 | apply local law that most closely approximates an absolute waiver of all civil 636 | liability in connection with the Program, unless a warranty or assumption of 637 | liability accompanies a copy of the Program in return for a fee. 638 | 639 | End of Terms and Conditions 640 | 641 | ''' 642 | 643 | [[howto]] 644 | == How to Apply These Terms to Your New Programs 645 | 646 | If you develop a new program, and you want it to be of the greatest possible 647 | use to the public, the best way to achieve this is to make it free software 648 | which everyone can redistribute and change under these terms. 649 | 650 | To do so, attach the following notices to the program. It is safest to 651 | attach them to the start of each source file to most effectively state the 652 | exclusion of warranty; and each file should have at least the “copyright” line 653 | and a pointer to where the full notice is found. 654 | 655 | [source] 656 | ---- 657 | 658 | Copyright © 659 | 660 | This program is free software: you can redistribute it and/or modify it under 661 | the terms of the GNU General Public License for Pedants as published by the 662 | Free Software Foundation, either version 1 of the License, or (at your option) 663 | any later version. 664 | 665 | This program is distributed in the hope that it will be useful, but without any 666 | warranty; without even the implied warranty of merchantability or fitness for a 667 | particular purpose. See the GNU General Public License for Pedants for 668 | more details. 669 | 670 | You should have received a copy of the GNU General Public License for Pedants 671 | along with this program. If not, see gnu.org/licenses. 672 | ---- 673 | 674 | Also add information on how to contact you by electronic and paper mail. 675 | 676 | If the program does terminal interaction, make it output a short notice like 677 | this when it starts in an interactive mode: 678 | 679 | [source] 680 | ---- 681 | Copyright © 682 | This program comes with absolutely no warranty; for details type `show w`. This 683 | is free software, and you are welcome to redistribute it under certain 684 | conditions; type `show c` for details. 685 | ---- 686 | 687 | The hypothetical commands `show w` and `show c` should show the appropriate 688 | parts of the General Public License for Pedants. Of course, your program’s 689 | commands might be different; for a GUI interface, you would use an 690 | “about box”. 691 | 692 | You should also get your employer (if you work as a programmer) or school, if 693 | any, to sign a “copyright disclaimer” for the program, if necessary. For 694 | more information on this, and how to apply and follow the GNU GPL, 695 | see https://gnu.org/licenses[gnu.org/licenses^]. 696 | 697 | The GNU General Public License for Pedants does not permit incorporating 698 | your program into proprietary programs. If your program is a subroutine 699 | library, you may consider it more useful to permit linking proprietary 700 | applications with the library. If this is what you want to do, use the GNU 701 | Lesser General Public License instead of this License. But first, please 702 | read https://gnu.org/licenses/why-not-lgpl[gnu.org/licenses/why-not-lgpl^]. 703 | --------------------------------------------------------------------------------