-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- https://fishshell.com/docs/current/tutorial.html#autoloading-functions - https://fishshell.com/docs/current/language.html#configuration
- Loading branch information
Showing
31 changed files
with
356 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/.gitnow | ||
**/.DS_Store |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# GitNow — Speed up your Git workflow. 🐠 | ||
# https://github.com/joseluisq/gitnow | ||
|
||
# Merge command | ||
|
||
__gitnow_load_git_functions | ||
|
||
complete -f -x -c merge -a '(__fish_git_branches)' | ||
|
||
complete -f -x -c merge \ | ||
-s h -l help \ | ||
-d "Show information about the options for this command" | ||
|
||
complete -f -x -c merge \ | ||
-s a -l abort \ | ||
-d "Abort conflicted merge" | ||
|
||
complete -f -x -c merge \ | ||
-s c -l continue \ | ||
-d "Continue merge" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# GitNow — Speed up your Git workflow. 🐠 | ||
# https://github.com/joseluisq/gitnow | ||
|
||
# Move command | ||
|
||
__gitnow_load_git_functions | ||
|
||
complete -f -x -c move -a '(__fish_git_branches)' | ||
|
||
complete -f -x -c move \ | ||
-s h -l help \ | ||
-d "Show information about the options for this command" | ||
|
||
complete -f -x -c move \ | ||
-s p -l prev \ | ||
-d "Switch to a previous branch using the `--no-apply-stash` option (equivalent to \"move -\")" | ||
|
||
complete -f -x -c move \ | ||
-s n -l no-apply-stash \ | ||
-a '(__fish_git_branches)' \ | ||
-d "Switch to a local branch but without applying current stash" | ||
|
||
complete -f -x -c move \ | ||
-s u -l upstream \ | ||
-a '(__fish_git_branches)' \ | ||
-d "Fetch a remote branch and switch to it applying current stash" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# GitNow — Speed up your Git workflow. 🐠 | ||
# https://github.com/joseluisq/gitnow | ||
|
||
# Tag command | ||
|
||
__gitnow_load_git_functions | ||
|
||
complete -f -x -c tag \ | ||
-d "List all tags in a lexicographic order and treating tag names as versions" | ||
|
||
complete -f -x -c tag -a '(__fish_git_tags)' | ||
|
||
complete -f -x -c tag \ | ||
-s h -l help \ | ||
-d "Show information about the options for this command" | ||
|
||
complete -f -x -c tag \ | ||
-s l -l latest \ | ||
-d "Show only the latest Semver release tag version (no suffixed ones or others)" | ||
|
||
complete -f -x -c tag \ | ||
-s x -l major \ | ||
-d "Tag auto-incrementing a major version number" | ||
|
||
complete -f -x -c tag \ | ||
-s y -l minor \ | ||
-d "Tag auto-incrementing a minor version number" | ||
|
||
complete -f -x -c tag \ | ||
-s z -l patch \ | ||
-d "Tag auto-incrementing a patch version number" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# GitNow — Speed up your Git workflow. 🐠 | ||
# https://github.com/joseluisq/gitnow | ||
|
||
function __gitnow_check_if_branch_exist | ||
set -l xfound 0 | ||
|
||
if test (count $argv) -eq 1 | ||
set -l xbranch $argv[1] | ||
set -l xbranch_list (__gitnow_current_branch_list) | ||
|
||
for b in $xbranch_list | ||
if [ "$xbranch" = "$b" ] | ||
set xfound 1 | ||
break | ||
end | ||
end | ||
end | ||
|
||
echo $xfound | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# GitNow — Speed up your Git workflow. 🐠 | ||
# https://github.com/joseluisq/gitnow | ||
|
||
function __gitnow_clone_msg | ||
set -l msg $argv[1] | ||
|
||
echo "Repository name is required!" | ||
echo "Example: $msg your-repo-name" | ||
echo "Usages:" | ||
echo " a) $msg username/repo-name" | ||
echo " b) $msg username repo-name" | ||
echo " c) $msg repo-name" | ||
echo " For this, it's necessary to set your $msg username (login)" | ||
echo " to global config before like: " | ||
echo " git config --global user.$msg \"your-username\"" | ||
echo | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# GitNow — Speed up your Git workflow. 🐠 | ||
# https://github.com/joseluisq/gitnow | ||
|
||
function __gitnow_clone_params | ||
set -l repo | ||
|
||
if count $argv >/dev/null | ||
if test (count $argv) -gt 1 | ||
set repo $argv[1]/$argv[2] | ||
else if echo $argv | LC_ALL=C command grep -q -E '^([a-zA-Z0-9\_\-]+)\/([a-zA-Z0-9\_\-]+)$' | ||
set repo $argv | ||
else | ||
set repo "%S/$argv" | ||
end | ||
end | ||
|
||
echo $repo | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# GitNow — Speed up your Git workflow. 🐠 | ||
# https://github.com/joseluisq/gitnow | ||
|
||
function __gitnow_clone_repo | ||
set -l repo $argv[1] | ||
set -l platform $argv[2] | ||
|
||
if test -n "$repo" | ||
set -l ok 1 | ||
|
||
if echo $repo | LC_ALL=C command grep -q -E '^[\%S].+' | ||
set -l user (command git config --global user.$platform) | ||
|
||
if test -n "$user" | ||
set -l repor (echo $repo | LC_ALL=C command sed -e "s/^%S/$user/") | ||
set repo $repor | ||
else | ||
set ok 0 | ||
end | ||
end | ||
|
||
if test $ok -eq 1 | ||
if [ "$platform" = "github" ] | ||
set url github.com | ||
end | ||
|
||
if [ "$platform" = "bitbucket" ] | ||
set url bitbucket.org | ||
end | ||
|
||
set -l repo_url git@$url:$repo.git | ||
|
||
echo "📦 Remote repository: $repo_url" | ||
command git clone $repo_url | ||
else | ||
__gitnow_clone_msg $platform | ||
end | ||
else | ||
__gitnow_clone_msg $platform | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# GitNow — Speed up your Git workflow. 🐠 | ||
# https://github.com/joseluisq/gitnow | ||
|
||
function __gitnow_current_branch_list | ||
command git branch --list --no-color | LC_ALL=C command sed -E "s/^(\*?[ \t]*)//g" 2>/dev/null | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# GitNow — Speed up your Git workflow. 🐠 | ||
# https://github.com/joseluisq/gitnow | ||
|
||
function __gitnow_current_branch_name | ||
command git symbolic-ref --short HEAD 2>/dev/null | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# GitNow — Speed up your Git workflow. 🐠 | ||
# https://github.com/joseluisq/gitnow | ||
|
||
function __gitnow_current_remote | ||
set -l branch_name (__gitnow_current_branch_name) | ||
command git config "branch.$branch_name.remote" 2>/dev/null; or echo origin | ||
end |
Oops, something went wrong.