├── .gitignore ├── abbreviations.bash ├── .editorconfig ├── abbreviations.fish ├── init.bash ├── init.zsh ├── abbreviations.zsh ├── LICENSE-MIT ├── README.md ├── init.fish ├── COPYRIGHT ├── abbreviations └── LICENSE-APACHE /.gitignore: -------------------------------------------------------------------------------- 1 | /run.fish 2 | -------------------------------------------------------------------------------- /abbreviations.bash: -------------------------------------------------------------------------------- 1 | abbreviations.zsh -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.fish] 2 | indent_style = space 3 | indent_size = 2 4 | -------------------------------------------------------------------------------- /abbreviations.fish: -------------------------------------------------------------------------------- 1 | # NOTE: Abbreviation specialization is not implemented in fish yet 2 | #gbda 3 | #gpristine 4 | #gdct 5 | #git-svn-dcommit-push 6 | #gke 7 | #gpoat 8 | #grt 9 | #gtl 10 | #gunwip 11 | #gwip 12 | -------------------------------------------------------------------------------- /init.bash: -------------------------------------------------------------------------------- 1 | __cgitc() { 2 | local arr 3 | local key 4 | local value 5 | 6 | while read -r line; do 7 | # Strip out comments 8 | IFS='#' read -ra arr <<< "$line" 9 | line=${arr[0]} 10 | 11 | # Skip empty lines 12 | if [[ -z "${line// }" ]]; then 13 | continue 14 | fi 15 | 16 | # Split a line into two 17 | key=${line%% *} 18 | value=${line#* } 19 | value="${value#"${value%%[![:space:]]*}"}" # Remove leading whitespaces 20 | value="${value%"${value##*[![:space:]]}"}" # Remove trailing whitespaces 21 | 22 | # shellcheck disable=SC2139 23 | alias "$key"="$value" 24 | done < "${1}" 25 | } 26 | 27 | __cgitc "$(dirname "${BASH_SOURCE[0]}")/abbreviations" 28 | __cgitc "$(dirname "${BASH_SOURCE[0]}")/abbreviations.bash" 29 | 30 | unset -f __cgitc 31 | -------------------------------------------------------------------------------- /init.zsh: -------------------------------------------------------------------------------- 1 | autoload -U is-at-least 2 | if is-at-least 5.1.0; then 3 | __CGITC_CMD="local arr=(\"\${(@s/#/)line}\") 4 | line=\$arr[1]" 5 | else 6 | __CGITC_CMD="line=\$(echo \"\$line\" | cut -d '#' -f 1)" 7 | fi 8 | 9 | __cgitc() { 10 | while read -r line; do 11 | # Strip out comments 12 | eval "$__CGITC_CMD" 13 | 14 | # Skip empty lines 15 | if [ -z "$line" ]; then continue; fi 16 | 17 | # Split a line into two 18 | key="$line[(w)1]" 19 | value=${line#* } 20 | value="${value#"${value%%[![:space:]]*}"}" # Remove leading whitespaces 21 | value="${value%"${value##*[![:space:]]}"}" # Remove trailing whitespaces 22 | 23 | # shellcheck disable=SC2139 24 | alias "$key"="$value" 25 | done < "${1}" 26 | } 27 | 28 | __cgitc "${0%/*}/abbreviations" 29 | __cgitc "${0%/*}/abbreviations.zsh" 30 | 31 | unset -f __cgitc 32 | unset __CGITC_CMD 33 | -------------------------------------------------------------------------------- /abbreviations.zsh: -------------------------------------------------------------------------------- 1 | gbda git branch --no-color --merged | command grep -vE "^(\+|\*|\s*(master|main|develop|dev)\s*$)" | command xargs -n 1 git branch -d 2 | gpristine git reset --hard && git clean -dfx 3 | gdct git describe --tags $(git rev-list --tags --max-count=1) 4 | git-svn-dcommit-push git svn dcommit && git push github master:svntrunk 5 | gke \gitk --all $(git log -g --pretty=%h) 6 | gpoat git push origin --all && git push origin --tags 7 | grt cd "$(git rev-parse --show-toplevel || echo .)" 8 | gtl gtl(){ git tag --sort=-v:refname -n -l "${1}*" }; noglob gtl 9 | gunwip git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1 10 | gwip git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]" 11 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-2017, Hyeon Kim 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Close Git Combat 3 |

4 | 5 | **cgitc** is set of useful git aliases for [bash], [zsh] and [fish]. It provides 6 | professional and swift git usage. 7 | 8 | ``` 9 | g = git 10 | 11 | gst = git status 12 | gd = git diff 13 | gdca = git diff --cached 14 | gc = git commit -v 15 | gup = git pull --rebase 16 | glog = git log --oneline --decorate --color --graph 17 | gsta = git stash 18 | gstp = git stash pop 19 | 20 | (etc) 21 | ``` 22 | 23 | cgitc is fork of [oh-my-zsh]'s [git plugin]. 24 |

25 | 26 | Installation 27 | -------- 28 | You can install cgitc via various plugin managers. 29 | 30 | #### Bash 31 | ```bash 32 | git clone https://github.com/simnalamburt/cgitc.git --depth=1 ~/.cgitc 33 | cat <<< 'source ~/.cgitc/init.bash' >> ~/.bashrc 34 | ``` 35 | 36 | #### Zsh, [zinit] 37 | ```zsh 38 | zinit light simnalamburt/cgitc 39 | 40 | # (Optional) It'll be more useful with zsh-expand-all 41 | zinit light simnalamburt/zsh-expand-all 42 | ``` 43 | 44 | #### Fish, [chips] 45 | ```yaml 46 | # Update your '~/.config/chips/plugin.yaml' 47 | github: 48 | - simnalamburt/cgitc 49 | ``` 50 | 51 | #### Fish, [oh-my-fish] 52 | ```fish 53 | omf install https://github.com/simnalamburt/cgitc 54 | ``` 55 | 56 |
57 | 58 | -------- 59 | *cgitc* is primarily distributed under the terms of both the [MIT license] 60 | and the [Apache License (Version 2.0)]. *cgitc emblem* © 2017 [XT]. See 61 | [COPYRIGHT] for details. 62 | 63 | [bash]: https://www.gnu.org/software/bash/ 64 | [zsh]: https://www.zsh.org 65 | [fish]: https://fishshell.com 66 | [zinit]: https://github.com/zdharma/zinit 67 | [chips]: https://github.com/xtendo-org/chips 68 | [oh-my-fish]: https://github.com/oh-my-fish/oh-my-fish 69 | [oh-my-zsh]: http://ohmyz.sh 70 | [git plugin]: https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh 71 | [MIT license]: LICENSE-MIT 72 | [Apache License (Version 2.0)]: LICENSE-APACHE 73 | [COPYRIGHT]: COPYRIGHT 74 | [XT]: https://e.xtendo.org/ 75 | -------------------------------------------------------------------------------- /init.fish: -------------------------------------------------------------------------------- 1 | # Fish <2.2.0 2 | if printf '%s\n2.2.0' "$FISH_VERSION" | sort --check=silent --version-sort 3 | for line in (cat (dirname (status -f))/abbreviations) 4 | # 1. Strip out comments 5 | # 2. Squeeze repeating spaces 6 | # 3. Strip trailing whitespaces 7 | set line (echo "$line" | cut -d '#' -f 1 | tr -s ' ' | sed 's/[[:space:]]*$//') 8 | 9 | # Skip empty lines 10 | if not [ "$line" ]; continue; end 11 | 12 | # Parse lines 13 | set key (echo "$line" | cut -d ' ' -f 1) 14 | set value (echo "$line" | cut -d ' ' -f 2-) 15 | 16 | alias $key $value 17 | end 18 | exit 19 | end 20 | 21 | # Skip if cgitc_revision is up to date 22 | set -l current_revision (git -C (dirname (realpath (status -f))) rev-parse HEAD) 23 | if [ "$cgitc_revision" != "$current_revision" ] 24 | printf 'Initializing \x1b[33mcgitc\x1b[0m ... ' 25 | 26 | if printf '%s\n3.0.0' "$FISH_VERSION" | sort --check=silent --version-sort 27 | # Fish >=2.2.0, <3.0.0 28 | # Use fish_user_abbreviations environment variable 29 | set -l cgitc_text ( 30 | for line in (cat (dirname (realpath (status -f)))/abbreviations) 31 | # 1. Strip out comments 32 | # 2. Squeeze repeating spaces 33 | # 3. Strip trailing whitespaces 34 | set line (echo "$line" | cut -d '#' -f 1 | tr -s ' ' | sed 's/[[:space:]]*$//') 35 | 36 | # Skip empty lines 37 | if not [ "$line" ]; continue; end 38 | 39 | # Wrap with double quote 40 | echo "\"$line\"" 41 | end | tr '\n' ' ' 42 | ) 43 | echo "set -gx fish_user_abbreviations \$fish_user_abbreviations $cgitc_text" > (realpath (dirname (status -f)))/run.fish 44 | else 45 | # Fish >=3.0.0 46 | # Use abbr command 47 | set -l cgitc_text ( 48 | for line in (cat (dirname (realpath (status -f)))/abbreviations) 49 | # 1. Strip out comments 50 | # 2. Squeeze repeating spaces 51 | # 3. Strip trailing whitespaces 52 | set line (echo "$line" | cut -d '#' -f 1 | tr -s ' ' | sed 's/[[:space:]]*$//') 53 | 54 | # Skip empty lines 55 | if not [ "$line" ]; continue; end 56 | 57 | # Tokenize 58 | set line (string split ' ' $line) 59 | 60 | # Wrap with calling 'abbr' 61 | echo "abbr --add --global -- $line[1] \"$line[2..-1]\"" 62 | end 63 | ) 64 | echo -s \n$cgitc_text > (realpath (dirname (status -f)))/run.fish 65 | end 66 | 67 | set -U cgitc_revision "$current_revision" 68 | echo 'Done' 69 | end 70 | source (realpath (dirname (status -f)))/run.fish 71 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright of cgitc project 2 | ======== 3 | 4 | Short version for non-laywers: 5 | The cgitc project is dual-licensed under Apache 2.0 and MIT terms. 6 | 7 | Longer version: 8 | Copyright 2015-2020 Hyeon Kim 9 | 10 | Licensed under the Apache License, Version 2.0 or the MIT license 12 | , at your 13 | option. This file may not be copied, modified, or distributed 14 | except according to those terms. 15 | 16 | 17 | The cgitc project includes packages written by third parties. The following 18 | third party packages are included, and carry their own copyright notices and 19 | license terms: 20 | 21 | * The 'abbreviations' file is derived from 'plugins/git/git.plugin.zsh' file of 22 | oh-my-zsh project. 23 | oh-my-zsh project carries the following license. 24 | 25 | The MIT License (MIT) 26 | 27 | Copyright (c) 2009-2017 Robby Russell and contributors 28 | See the full list at https://github.com/robbyrussell/oh-my-zsh/contributors 29 | 30 | Permission is hereby granted, free of charge, to any person obtaining a copy 31 | of this software and associated documentation files (the "Software"), to deal 32 | in the Software without restriction, including without limitation the rights 33 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 34 | copies of the Software, and to permit persons to whom the Software is 35 | furnished to do so, subject to the following conditions: 36 | 37 | The above copyright notice and this permission notice shall be included in all 38 | copies or substantial portions of the Software. 39 | 40 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 41 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 42 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 43 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 44 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 45 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 46 | SOFTWARE. 47 | 48 | 49 | 50 | Copyright of cgitc emblem 51 | ======== 52 | A copyright notice from XT , maker of the emblem: 53 | 54 | I hereby release the cgitc emblem under the terms of the [AGPL] version 3 or 55 | later, the [Apache License] version 2 or later, the [MIT] license, the 56 | [2-Clause BSD License], the [zlib/libpng License], and a proprietary license 57 | in which the sellers of a t-shirt with the cgitc emblem printed on it must 58 | share fifty percent of their revenue to me. A user or a redistributor of the 59 | cgitc emblem may choose the best license that suits their demand. 60 | 61 | [AGPL]: https://www.gnu.org/licenses/agpl-3.0.en.html 62 | [Apache License]: https://www.apache.org/licenses/LICENSE-2.0 63 | [MIT]: https://opensource.org/licenses/MIT 64 | [2-Clause BSD License]: https://opensource.org/licenses/BSD-2-Clause 65 | [zlib/libpng License]: https://opensource.org/licenses/Zlib 66 | -------------------------------------------------------------------------------- /abbreviations: -------------------------------------------------------------------------------- 1 | # Abbreviations sorted in alphabetically 2 | g git 3 | 4 | ga git add 5 | gaa git add --all 6 | gapa git add --patch 7 | gau git add --update 8 | gav git add --verbose 9 | gap git apply 10 | 11 | gb git branch 12 | gba git branch -a 13 | gbd git branch -d 14 | #gbda git branch --no-color --merged | command grep -vE "^(\+|\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d 15 | gbD git branch -D 16 | gbl git blame -b -w 17 | gbnm git branch --no-merged 18 | gbr git branch --remote 19 | gbs git bisect 20 | gbsb git bisect bad 21 | gbsg git bisect good 22 | gbsr git bisect reset 23 | gbss git bisect start 24 | 25 | gc git commit -v 26 | gc! git commit -v --amend 27 | gcn! git commit -v --no-edit --amend 28 | gca git commit -v -a 29 | gca! git commit -v -a --amend 30 | gcan! git commit -v -a --no-edit --amend 31 | gcans! git commit -v -a -s --no-edit --amend 32 | gcam git commit -a -m 33 | gcsm git commit -s -m 34 | gcb git checkout -b 35 | gcf git config --list 36 | gcl git clone --recurse-submodules 37 | gclean git clean -id 38 | #gpristine git reset --hard && git clean -dfx 39 | gcm git checkout master 40 | gcd git checkout develop 41 | gcmsg git commit -m 42 | gco git checkout 43 | gcount git shortlog -sn 44 | gcp git cherry-pick 45 | gcpa git cherry-pick --abort 46 | gcpc git cherry-pick --continue 47 | gcs git commit -S 48 | 49 | gd git diff 50 | gdca git diff --cached 51 | gdcw git diff --cached --word-diff 52 | #gdct git describe --tags $(git rev-list --tags --max-count=1) 53 | #gds git diff --staged # NOTE: It conflicts with "git diff --stat" 54 | gdt git diff-tree --no-commit-id --name-only -r 55 | gdw git diff --word-diff 56 | 57 | #gdv 58 | 59 | gf git fetch 60 | gfa git fetch --all --prune 61 | gfo git fetch origin 62 | 63 | gfg git ls-files | grep 64 | 65 | gg git gui citool 66 | gga git gui citool --amend 67 | 68 | #ggf 69 | #ggfl 70 | 71 | #ggl 72 | #ggp 73 | #ggpnp 74 | #ggu 75 | 76 | #ggpur ggu 77 | #ggpull git pull origin "$(git_current_branch)" 78 | #ggpush git push origin "$(git_current_branch)" 79 | 80 | #ggsup git branch --set-upstream-to=origin/$(git_current_branch) 81 | #gpsup git push --set-upstream origin $(git_current_branch) 82 | 83 | ghh git help 84 | 85 | gignore git update-index --assume-unchanged 86 | gignored git ls-files -v | grep "^[[:lower:]]" 87 | #git-svn-dcommit-push git svn dcommit && git push github master:svntrunk 88 | 89 | gk \gitk --all --branches 90 | #gke \gitk --all $(git log -g --pretty=%h) 91 | 92 | gl git pull 93 | glg git log --stat 94 | glgp git log --stat -p 95 | glgg git log --graph 96 | glgga git log --graph --decorate --all 97 | glgm git log --graph --max-count=10 98 | glo git log --oneline --decorate 99 | glol git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' 100 | glols git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --stat 101 | glod git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' 102 | glods git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short 103 | glola git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --all 104 | glog git log --oneline --decorate --graph 105 | gloga git log --oneline --decorate --graph --all 106 | #glp 107 | 108 | gm git merge 109 | gmom git merge origin/master 110 | gmt git mergetool --no-prompt 111 | gmtvim git mergetool --no-prompt --tool=vimdiff 112 | gmum git merge upstream/master 113 | gma git merge --abort 114 | 115 | gp git push 116 | gpd git push --dry-run 117 | gpf git push --force-with-lease 118 | gpf! git push --force 119 | #gpoat git push origin --all && git push origin --tags 120 | gpu git push upstream 121 | gpv git push -v 122 | 123 | gr git remote 124 | gra git remote add 125 | grb git rebase 126 | grba git rebase --abort 127 | grbc git rebase --continue 128 | grbd git rebase develop 129 | grbi git rebase -i 130 | grbm git rebase master 131 | grbs git rebase --skip 132 | grev git revert 133 | grh git reset 134 | grhh git reset --hard 135 | #groh git reset origin/$(git_current_branch) --hard 136 | grm git rm 137 | grmc git rm --cached 138 | grmv git remote rename 139 | grrm git remote remove 140 | grs git restore 141 | grset git remote set-url 142 | grss git restore --source 143 | #grt cd "$(git rev-parse --show-toplevel || echo .)" 144 | gru git reset -- 145 | grup git remote update 146 | grv git remote -v 147 | 148 | gsb git status -sb 149 | gsd git svn dcommit 150 | gsh git show 151 | gsi git submodule init 152 | gsps git show --pretty=short --show-signature 153 | gsr git svn rebase 154 | gss git status -s 155 | gst git status 156 | 157 | #gsta git stash save 158 | 159 | gstaa git stash apply 160 | gstc git stash clear 161 | gstd git stash drop 162 | gstl git stash list 163 | gstp git stash pop 164 | gsts git stash show --text 165 | gstall git stash --all 166 | gsu git submodule update 167 | gsw git switch 168 | gswc git switch -c 169 | 170 | gts git tag -s 171 | gtv git tag | sort -V 172 | #gtl gtl(){ git tag --sort=-v:refname -n -l "${1}*" }; noglob gtl 173 | 174 | gunignore git update-index --no-assume-unchanged 175 | #gunwip git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1 176 | gup git pull --rebase 177 | gupv git pull --rebase -v 178 | gupa git pull --rebase --autostash 179 | gupav git pull --rebase --autostash -v 180 | glum git pull upstream master 181 | 182 | gwch git whatchanged -p --abbrev-commit --pretty=medium 183 | #gwip git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify --no-gpg-sign -m "--wip-- [skip ci]" 184 | gwt git worktree 185 | gwta git worktree add 186 | gwtls git worktree list 187 | gwtmv git worktree move 188 | gwtrm git worktree remove 189 | 190 | #git_current_branch 191 | 192 | # 193 | # cgitc extensions 194 | # 195 | gbm git branch -m 196 | gcaa git commit -v -a --amend 197 | gdl git difftool 198 | gds git diff --stat 199 | ggpush git push --set-upstream origin HEAD 200 | gp! git push --force-with-lease 201 | grhd git reset HEAD 202 | grhhd git reset --hard HEAD 203 | grhh1 git reset --hard HEAD~1 204 | gsta git stash 205 | gstas git stash --staged 206 | gstai git stash --keep-index 207 | gc- git checkout - 208 | glogp git log --decorate --oneline --graph --show-pulls -- 209 | gsur git submodule update --recursive 210 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | --------------------------------------------------------------------------------