Merge pull request #778 from pabs3/cleanups

Clean up some minor issues detected by check-all-the-things
This commit is contained in:
罗泽轩 2019-09-06 14:46:15 +08:00 committed by GitHub
commit f7d127b360
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 35 additions and 33 deletions

View file

@ -1,7 +1,7 @@
## Your new git-extra command should support
* OSX, Linux, BSD (You may need to browse their man page)<sup>*</sup>
* 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+
<sup>*</sup>If you aren't able to test your new command on a platform,

View file

@ -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
@ -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.
@ -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:
@ -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

View file

@ -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/

View file

@ -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 </dev/tty; echo
if [[ $REPLY =~ ^[Yy]$ ]]; then atomicExecution; fi
else
@ -49,7 +49,7 @@ function guardedExecution () {
# atomic git command execution with log
function atomicExecution () {
echo "${bldred}->${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

View file

@ -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

View file

@ -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=$(</tmp/ls-remote-error)
rm -f /tmp/ls-remote-error
REMOTE_ERROR=$(<"$stderr")
rm -f "$stderr"
if [ $REMOTE_EXIT -eq 0 ]
then
git push $REMOTE HEAD:refs/heads/$BRANCH

View file

@ -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

View file

@ -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)
#
# ------------------------------------------------------------------------------

View file

@ -9,13 +9,14 @@ make_install() {
fi
}
cd /tmp \
&& rm -rf ./git-extras \
dir=$(mktemp -t -d git-extras-install.XXXXXXXXXX) \
&& cd "$dir" \
&& echo "Setting up 'git-extras'...." \
&& git clone https://github.com/tj/git-extras.git &> /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"

View file

@ -51,7 +51,7 @@ Any git Command you wish to execute on the repositories\.
\-\-addworkspace <ws\-name> <ws\-root\-directory>
.
.P
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\.
.
.P
\-\-removeworkspace <ws\-name>

View file

@ -114,7 +114,7 @@
<p> --addworkspace &lt;ws-name&gt; &lt;ws-root-directory&gt;</p>
<p> Register a workspace for bulk operations. All repositories in the diretories below &lt;ws-root-directory&gt; get registered under this workspace with the name &lt;ws-name&gt;. &lt;ws-root-directory&gt; must be absolute path.</p>
<p> Register a workspace for bulk operations. All repositories in the directories below &lt;ws-root-directory&gt; get registered under this workspace with the name &lt;ws-name&gt;. &lt;ws-root-directory&gt; must be absolute path.</p>
<p> --removeworkspace &lt;ws-name&gt;</p>

View file

@ -38,7 +38,7 @@ git bulk adds convenient support for operations that you want to execute on mult
--addworkspace &lt;ws-name&gt; &lt;ws-root-directory&gt;
Register a workspace for bulk operations. All repositories in the diretories below &lt;ws-root-directory&gt; get registered under this workspace with the name &lt;ws-name&gt;. &lt;ws-root-directory&gt; must be absolute path.
Register a workspace for bulk operations. All repositories in the directories below &lt;ws-root-directory&gt; get registered under this workspace with the name &lt;ws-name&gt;. &lt;ws-root-directory&gt; must be absolute path.
--removeworkspace &lt;ws-name&gt;

View file

@ -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

View file

@ -44,8 +44,8 @@ Written by Nate Jones &lt;<nate@endot.org>&gt;
## REPORTING BUGS
&lt;<http://github.com/tj/git-extras/issues>&gt;
&lt;<https://github.com/tj/git-extras/issues>&gt;
## SEE ALSO
&lt;<http://github.com/tj/git-extras>&gt;
&lt;<https://github.com/tj/git-extras>&gt;

View file

@ -84,7 +84,7 @@ Written by Damien Tardy-Panis &lt;<damien@tardypad.me>&gt;
## REPORTING BUGS
&lt;<http://github.com/tj/git-extras/issues>&gt;
&lt;<https://github.com/tj/git-extras/issues>&gt;
## SEE ALSO

View file

@ -40,8 +40,8 @@ Written by Niklas Fiekas &lt;<niklas.fiekas@tu-clausthal.de>&gt;
## REPORTING BUGS
&lt;<http://github.com/tj/git-extras/issues>&gt;
&lt;<https://github.com/tj/git-extras/issues>&gt;
## SEE ALSO
&lt;<http://github.com/tj/git-extras>&gt;
&lt;<https://github.com/tj/git-extras>&gt;

View file

@ -49,7 +49,7 @@ Also runs git commit if -c is provided.
Written by Antoine Beaupré &lt;<anarcat@debian.org>&gt; 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

View file

@ -69,7 +69,7 @@ Written by Damien Tardy-Panis &lt;<damien@tardypad.me>&gt;
## REPORTING BUGS
&lt;<http://github.com/tj/git-extras/issues>&gt;
&lt;<https://github.com/tj/git-extras/issues>&gt;
## SEE ALSO