Skip to content

Commit d482d87

Browse files
committed
rename to git-clone-completion.bash
1 parent 3f9a61d commit d482d87

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ Also autocompletes arbitrary servers accessible via SSH.
1212
## Install
1313

1414
```bash
15-
$ curl -LO https://github.com/mjuric/git-utils/releases/latest/download/git-clone-completions.bash
15+
$ curl -LO https://github.com/mjuric/git-utils/releases/latest/download/git-clone-completion.bash
1616

1717
# place this into your ~/.bash_profile (Mac) or ~/.bashrc (Linux)
18-
$ source git-clone-completions.bash
18+
$ source git-clone-completion.bash
1919
```
2020

2121
## Usage
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ __gg_setup()
1919
local xdg_config_home=${XDG_CONFIG_HOME:-$HOME/.config}
2020
local xdg_cache_home=${XDG_CACHE_HOME:-$HOME/.cache}
2121

22-
GG_CFGDIR=${GG_CFGDIR:-$xdg_config_home/git-clone-completions}
23-
GG_CACHEDIR=${GG_CACHEDIR:-$xdg_cache_home/git-clone-completions}
22+
GG_CFGDIR=${GG_CFGDIR:-$xdg_config_home/git-clone-completion}
23+
GG_CACHEDIR=${GG_CACHEDIR:-$xdg_cache_home/git-clone-completion}
2424
}
2525
__gg_setup
2626
unset -f __gg_setup
@@ -577,7 +577,7 @@ init-gitlab-completion()
577577
echo
578578
echo "and generate a new personal access token:"
579579
echo
580-
echo " 1. Under 'Name', write 'git-clone-completions access for $USER@$(hostname)'"
580+
echo " 1. Under 'Name', write 'git-clone-completion access for $USER@$(hostname)'"
581581
echo " 2. Leave 'Expires at' empty"
582582
echo " 3. Under 'Scopes', check 'api' and leave others unchecked."
583583
echo
@@ -671,7 +671,7 @@ init-github-completion()
671671
echo
672672
echo "and generate a new personal access token:"
673673
echo
674-
echo " 1. Under 'Note', write 'git-clone-completions access for $USER@$(hostname)'"
674+
echo " 1. Under 'Note', write 'git-clone-completion access for $USER@$(hostname)'"
675675
echo " 2. Under 'Select scopes', check 'repo' and leave otherwise unchecked."
676676
echo
677677
echo "Then click the 'Generate Token' green button (bottom of the page)."
@@ -797,7 +797,7 @@ init-bitbucket-completion()
797797
echo
798798
echo "to generate a new 'app password':"
799799
echo
800-
echo " 1. Under 'Label', write 'git-clone-completions access for $USER@$(hostname)'"
800+
echo " 1. Under 'Label', write 'git-clone-completion access for $USER@$(hostname)'"
801801
echo " 2. Under 'Permissions', check:"
802802
echo " a) 'Read' under 'Account'"
803803
echo " b) 'Read' under 'Projects'"
@@ -1351,7 +1351,7 @@ _complete_url()
13511351
#################
13521352

13531353
GG_NO_UPDATE_MARKER="$GG_CFGDIR/no-update-checks"
1354-
GG_NEW_VERSION="$GG_CACHEDIR/git-clone-completions.bash"
1354+
GG_NEW_VERSION="$GG_CACHEDIR/git-clone-completion.bash"
13551355
GG_SELF="${BASH_SOURCE[0]}"
13561356
#GG_UPDATE_CHECK_INTERVAL='-1 weeks'
13571357
#GG_UPDATE_NAG_INTERVAL='-1 weeks'
@@ -1372,7 +1372,7 @@ __check_and_download_update()
13721372
# download the current version
13731373
local tmp="$GG_NEW_VERSION.$$.$RANDOM.tmp"
13741374

1375-
if curl -f -s "https://raw.githubusercontent.com/mjuric/git-utils/master/git-clone-completions.bash" -o "$tmp" >/dev/null 1>&2 && # download
1375+
if curl -f -s "https://raw.githubusercontent.com/mjuric/git-utils/master/git-clone-completion.bash" -o "$tmp" >/dev/null 1>&2 && # download
13761376
[[ -s "$tmp" ]] && # continue if not empty
13771377
! cmp -s "$GG_SELF" "$tmp" 2>/dev/null && # continue if not the same
13781378
bash -n "$tmp" 2>/dev/null; # continue if not malformed
@@ -1387,12 +1387,12 @@ __check_and_download_update()
13871387
gg-update()
13881388
{
13891389
if [[ ! -f "$GG_NEW_VERSION" ]]; then
1390-
echo "git-clone-completions: no new version available for update." 1>&2
1390+
echo "git-clone-completion: no new version available for update." 1>&2
13911391
return
13921392
fi
13931393

13941394
# save a backup
1395-
local backup="$GG_CACHEDIR/git-clone-completions.bash.$(date)"
1395+
local backup="$GG_CACHEDIR/git-clone-completion.bash.$(date)"
13961396
cp -a "$GG_SELF" "$backup"
13971397

13981398
echo
@@ -1406,7 +1406,7 @@ gg-update()
14061406
echo " mv '$GG_NEW_VERSION' '$GG_SELF'"
14071407
echo
14081408
echo "to update."
1409-
#echo "git-clone-completions: update complete! source $SELF to activate."
1409+
#echo "git-clone-completion: update complete! source $SELF to activate."
14101410
}
14111411

14121412
gg-stop()
@@ -1416,7 +1416,7 @@ gg-stop()
14161416
mkdir -p "$(dirname "$GG_NO_UPDATE_MARKER")"
14171417
touch "$GG_NO_UPDATE_MARKER"
14181418

1419-
echo "git-clone-completions: won't check for updates going forward."
1419+
echo "git-clone-completion: won't check for updates going forward."
14201420
}
14211421

14221422
__check_update()
@@ -1436,7 +1436,7 @@ __check_update()
14361436
mkdir -p "$(basename "$nagfile")"
14371437
touch "$nagfile"
14381438

1439-
echo "message: new git-clone-completions available; run gg-update to update. run gg-stop to stop update checks." 1>&2
1439+
echo "message: new git-clone-completion available; run gg-update to update. run gg-stop to stop update checks." 1>&2
14401440
fi
14411441
}
14421442

tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ def _bash_aux(request, bashpath, homedir, wordbreaks, git_completion):
204204
bash.run(f"source '{git_completion}'", expect_output=False)
205205

206206
# install the library
207-
out = bash.run(f"source '{_TESTDIR}/../git-clone-completions.bash'", expect_output=not bash.git_completion)
207+
out = bash.run(f"source '{_TESTDIR}/../git-clone-completion.bash'", expect_output=not bash.git_completion)
208208
if out:
209209
assert out.startswith("\r\nwarning 1: *** no git autocompletion found"), "expected a warning message about no git autocompletion"
210210

211-
# Load bashrc defs for testing and git-clone-completions
211+
# Load bashrc defs for testing and git-clone-completion
212212
bash.run(f"source '{bashrc}'")
213213

214214
with assert_unmodified_env(bash, ignore=ignore_env):

tests/test_github.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_github_auth(self, bash):
2828
bash.expect('Your GitHub username: ')
2929
bash.sendline(username)
3030

31-
auth_loc = f"{bash.homedir}/.config/git-clone-completions/github.auth.netrc"
31+
auth_loc = f"{bash.homedir}/.config/git-clone-completion/github.auth.netrc"
3232
expect = f"Authentication setup complete; token stored to '{auth_loc}'"
3333
bash.expect_exact(expect)
3434
bash.expect_exact(bash.PS1)

tests/test_ssh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ def test_cache_expiration(self, bash):
3737
assert bash.complete("git clone test-dummy-0") == [ 'test-dummy-0:' ], f"Unexpected completion for `{cmdline}`"
3838
assert bash.complete("git clone test-dummy-1") == [], f"Didn't expire a host from cache"
3939
except:
40-
with open(f'{bash.homedir}/.cache/git-clone-completions/ssh.recent') as fp:
40+
with open(f'{bash.homedir}/.cache/git-clone-completion/ssh.recent') as fp:
4141
print(fp.read())
4242
raise

0 commit comments

Comments
 (0)