From e24c1302f495336133f3c82af4b4496efe624886 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Wed, 4 Sep 2019 19:35:43 +0800 Subject: [PATCH 1/4] Fix an indefinite article in the documentation Suggested-by: anorack --- Commands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Commands.md b/Commands.md index dfcbd72..1038bfa 100644 --- a/Commands.md +++ b/Commands.md @@ -1196,7 +1196,7 @@ List all commits on the local branch that have not yet been sent to origin. Any ## git archive-file -Creates an zip archive of the current git repository. The name of the archive will depend on the current HEAD of your git repository. +Creates a zip archive of the current git repository. The name of the archive will depend on the current HEAD of your git repository. ## git missing From 1a414f5512afc4ca2c11de21faac3dd28cd116f3 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Wed, 4 Sep 2019 19:42:17 +0800 Subject: [PATCH 2/4] Fix typos Suggested-by: codespell Suggested-by: spellintian --- Commands.md | 2 +- bin/git-bulk | 8 ++++---- bin/git-changelog | 2 +- bin/git-standup | 2 +- man/git-bulk.1 | 2 +- man/git-bulk.html | 2 +- man/git-bulk.md | 2 +- man/git-ignore-io.md | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Commands.md b/Commands.md index 1038bfa..060019d 100644 --- a/Commands.md +++ b/Commands.md @@ -317,7 +317,7 @@ $ git bulk --purge ## git repl -Git read-eval-print-loop. Let's you run `git` commands without typing 'git'. +Git read-eval-print-loop. Lets you run `git` commands without typing 'git'. Commands can be prefixed with an exclamation mark (!) to be interpreted as a regular command. diff --git a/bin/git-bulk b/bin/git-bulk index 9f9f634..172d866 100755 --- a/bin/git-bulk +++ b/bin/git-bulk @@ -1,5 +1,5 @@ #!/usr/bin/env bash -invers=$(tput rev) +inverse=$(tput rev) reset=$(tput sgr0) txtbld=$(tput bold) bldred=${txtbld}$(tput setaf 1) @@ -39,7 +39,7 @@ function listall { git config --global --get-regexp bulkworkspaces; } # guarded execution of a git command in one specific repository function guardedExecution () { if $guardedmode; then - echo -n "${invers}git $gitcommand${reset} -> execute here (y/n)? " + echo -n "${inverse}git $gitcommand${reset} -> execute here (y/n)? " read -n 1 -r ${reset} executing ${invers}git $gitcommand${reset}" && git $gitcommand + echo "${bldred}->${reset} executing ${inverse}git $gitcommand${reset}" && git $gitcommand } # check if the passed command is known as a core git command @@ -108,7 +108,7 @@ function executBulkOp () { if [[ -n $wsname ]] && [[ $rwsname != "$wsname" ]]; then continue; fi eval cd "\"$rwsdir\"" local actual=$(pwd) - echo "Executing bulk operation in workspace ${invers}$actual${reset}" + echo "Executing bulk operation in workspace ${inverse}$actual${reset}" eval find -L . -name ".git" | while read line; do local gitrepodir=${line::${#line}-5} # cut the .git part of find results to have the root git directory of that repository eval cd "\"$gitrepodir\"" # into git repo location diff --git a/bin/git-changelog b/bin/git-changelog index 895e8c4..ede2ea0 100755 --- a/bin/git-changelog +++ b/bin/git-changelog @@ -375,7 +375,7 @@ _exit() { # The format of `ps` is different between Windows and other platforms, # so we need to calculate the total column number(COL_NUM) of header first. # Why don't we just use the last column? - # Because the body of CMD column may contain space and be treated as multiple fileds. + # Because the body of CMD column may contain space and be treated as multiple fields. pid_list=( $(ps -f | awk -v ppid=$$ 'NR == 1 { COL_NUM = NF diff --git a/bin/git-standup b/bin/git-standup index d73844d..2de7601 100755 --- a/bin/git-standup +++ b/bin/git-standup @@ -129,7 +129,7 @@ done shift $((OPTIND-1)) if [[ $# -gt 0 ]]; then - warn "please upgrate to new-style interface. Run 'git help standup' to get more info." + warn "please upgrade to new-style interface. Run 'git help standup' to get more info." if [[ $# -gt 3 ]] ; then usage exit 1 diff --git a/man/git-bulk.1 b/man/git-bulk.1 index b87bf3c..202ccf8 100644 --- a/man/git-bulk.1 +++ b/man/git-bulk.1 @@ -51,7 +51,7 @@ Any git Command you wish to execute on the repositories\. \-\-addworkspace . .P -Register a workspace for bulk operations\. All repositories in the diretories below get registered under this workspace with the name \. must be absolute path\. +Register a workspace for bulk operations\. All repositories in the directories below get registered under this workspace with the name \. must be absolute path\. . .P \-\-removeworkspace diff --git a/man/git-bulk.html b/man/git-bulk.html index d05b658..511c0a0 100644 --- a/man/git-bulk.html +++ b/man/git-bulk.html @@ -114,7 +114,7 @@

--addworkspace <ws-name> <ws-root-directory>

-

Register a workspace for bulk operations. All repositories in the diretories below <ws-root-directory> get registered under this workspace with the name <ws-name>. <ws-root-directory> must be absolute path.

+

Register a workspace for bulk operations. All repositories in the directories below <ws-root-directory> get registered under this workspace with the name <ws-name>. <ws-root-directory> must be absolute path.

--removeworkspace <ws-name>

diff --git a/man/git-bulk.md b/man/git-bulk.md index 834c585..9cbb736 100644 --- a/man/git-bulk.md +++ b/man/git-bulk.md @@ -38,7 +38,7 @@ git bulk adds convenient support for operations that you want to execute on mult --addworkspace <ws-name> <ws-root-directory> - Register a workspace for bulk operations. All repositories in the diretories below <ws-root-directory> get registered under this workspace with the name <ws-name>. <ws-root-directory> must be absolute path. + Register a workspace for bulk operations. All repositories in the directories below <ws-root-directory> get registered under this workspace with the name <ws-name>. <ws-root-directory> must be absolute path. --removeworkspace <ws-name> diff --git a/man/git-ignore-io.md b/man/git-ignore-io.md index 8d0edbe..37516a5 100644 --- a/man/git-ignore-io.md +++ b/man/git-ignore-io.md @@ -52,7 +52,7 @@ $ git ignore-io vim *~ ``` -Append sample gitignore for vim and python to .gitignore in current directory. +Append sample gitignore for Vim and Python to .gitignore in current directory. ```bash $ git ignore-io -a vim python From a85d5f57bb1fd8093a7cedb4c5e5fe152da2564c Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Wed, 4 Sep 2019 20:02:51 +0800 Subject: [PATCH 3/4] Switch http URLs to https where possible Suggested-by: check-all-the-things --- CONTRIBUTING.md | 2 +- Commands.md | 4 ++-- Installation.md | 4 ++-- etc/git-extras-completion.zsh | 6 +++--- man/git-missing.md | 4 ++-- man/git-reauthor.md | 2 +- man/git-rebase-patch.md | 4 ++-- man/git-sed.md | 2 +- man/git-stamp.md | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 70386c2..79de7e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ ## Your new git-extra command should support * OSX, Linux, BSD (You may need to browse their man page)* -* Bash 3.2+ (If you aren't sure, see [the Bash changelog](http://tldp.org/LDP/abs/html/bash2.html)) +* Bash 3.2+ (If you aren't sure, see [the Bash changelog](https://www.tldp.org/LDP/abs/html/bash2.html)) * Git 2.1+ *If you aren't able to test your new command on a platform, diff --git a/Commands.md b/Commands.md index 060019d..e7c2487 100644 --- a/Commands.md +++ b/Commands.md @@ -91,7 +91,7 @@ $ git extras update ``` ## git gh-pages -Sets up the `gh-pages` branch. (See [GitHub Pages](http://pages.github.com/) documentation.) +Sets up the `gh-pages` branch. (See [GitHub Pages](https://pages.github.com/) documentation.) ## git feature|refactor|bug|chore @@ -877,7 +877,7 @@ Populates the file matching `authors|contributors -i` with the authors of commit Opens the file in `$EDITOR` when set. -See the ["MAPPING AUTHORS" section](http://git-scm.com/docs/git-shortlog#_mapping_authors) of **git-shortlog**(1) to coalesce together commits by the same person. +See the ["MAPPING AUTHORS" section](https://git-scm.com/docs/git-shortlog#_mapping_authors) of **git-shortlog**(1) to coalesce together commits by the same person. Updating AUTHORS file: diff --git a/Installation.md b/Installation.md index 32016bd..feb3323 100644 --- a/Installation.md +++ b/Installation.md @@ -131,7 +131,7 @@ See the Makefile for details on advanced configuration options. One-liner: ```bash -curl -sSL http://git.io/git-extras-setup | sudo bash /dev/stdin +curl -sSL https://git.io/git-extras-setup | sudo bash /dev/stdin ``` ## Installing as Zsh plugin @@ -154,4 +154,4 @@ If you installed git-extras from source, you can run `git-extras update` to upda Enjoy `git-extras`! -[1]: http://sourceforge.net/projects/msys2/ +[1]: https://sourceforge.net/projects/msys2/ diff --git a/etc/git-extras-completion.zsh b/etc/git-extras-completion.zsh index 0552eca..672ded7 100644 --- a/etc/git-extras-completion.zsh +++ b/etc/git-extras-completion.zsh @@ -2,7 +2,7 @@ # Description # ----------- # -# Completion script for git-extras (http://github.com/tj/git-extras). +# Completion script for git-extras (https://github.com/tj/git-extras). # # This depends on and reuses some of the internals of the _git completion # function that ships with zsh itself. It will not work with the _git that ships @@ -19,8 +19,8 @@ # Inspirations # ----------- # -# * git-extras (http://github.com/tj/git-extras) -# * git-flow-completion (http://github.com/bobthecow/git-flow-completion) +# * git-extras (https://github.com/tj/git-extras) +# * git-flow-completion (https://github.com/bobthecow/git-flow-completion) # # ------------------------------------------------------------------------------ diff --git a/man/git-missing.md b/man/git-missing.md index 2ca7d5b..6f4ff65 100644 --- a/man/git-missing.md +++ b/man/git-missing.md @@ -44,8 +44,8 @@ Written by Nate Jones <> ## REPORTING BUGS -<> +<> ## SEE ALSO -<> +<> diff --git a/man/git-reauthor.md b/man/git-reauthor.md index 7471d3c..19478ef 100644 --- a/man/git-reauthor.md +++ b/man/git-reauthor.md @@ -84,7 +84,7 @@ Written by Damien Tardy-Panis <> ## REPORTING BUGS -<> +<> ## SEE ALSO diff --git a/man/git-rebase-patch.md b/man/git-rebase-patch.md index dc66084..aa0dd3c 100644 --- a/man/git-rebase-patch.md +++ b/man/git-rebase-patch.md @@ -40,8 +40,8 @@ Written by Niklas Fiekas <> ## REPORTING BUGS -<> +<> ## SEE ALSO -<> +<> diff --git a/man/git-sed.md b/man/git-sed.md index 844c2af..6096d9e 100644 --- a/man/git-sed.md +++ b/man/git-sed.md @@ -49,7 +49,7 @@ Also runs git commit if -c is provided. Written by Antoine Beaupré <> from inspiration by https://github.com/da-x/git-search-replace and -http://stackoverflow.com/questions/9651898/is-there-a-git-sed-or-equivalent +https://stackoverflow.com/questions/9651898/is-there-a-git-sed-or-equivalent ## REPORTING BUGS diff --git a/man/git-stamp.md b/man/git-stamp.md index da97c68..dcc9dfc 100644 --- a/man/git-stamp.md +++ b/man/git-stamp.md @@ -69,7 +69,7 @@ Written by Damien Tardy-Panis <> ## REPORTING BUGS -<> +<> ## SEE ALSO From 1d7d4c2446c85736680b24a2952619dba665bf6e Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Wed, 4 Sep 2019 20:36:20 +0800 Subject: [PATCH 4/4] Switch from using /tmp to using mktemp mktemp protects against attacks from other users. mktemp protects against concurrent writers. mktemp respects the $TMPDIR environment variable. Suggested-by: check-all-the-things --- bin/git-create-branch | 7 ++++--- install.sh | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/git-create-branch b/bin/git-create-branch index c94d0a0..c0d1dd4 100755 --- a/bin/git-create-branch +++ b/bin/git-create-branch @@ -37,10 +37,11 @@ test -z $BRANCH && echo "branch argument required." 1>&2 && exit 1 if [[ -n $REMOTE ]] then - git ls-remote --exit-code $REMOTE 1>/dev/null 2>/tmp/ls-remote-error + stderr=$(git_extra_mktemp) + git ls-remote --exit-code $REMOTE 1>/dev/null 2>"$stderr" REMOTE_EXIT=$? - REMOTE_ERROR=$( /dev/null \ && cd git-extras \ && git checkout \ $(git describe --tags $(git rev-list --tags --max-count=1)) \ &> /dev/null \ - && make_install + && make_install \ + && rm -rf "$dir"