Skip to content

Commit

Permalink
Merge pull request #52 from SirWrexes/patch/wraps
Browse files Browse the repository at this point in the history
feat: enable fish's `git <command>` completion for Gitnow simple wrapper commands
  • Loading branch information
joseluisq committed Jun 14, 2023
2 parents aba9145 + 41e16cd commit 5dab658
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions conf.d/gitnow.fish
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function state -d "Gitnow: Show the working tree status in compact way"
command git status -sb
end

function stage -d "Gitnow: Stage files in current working directory"
function stage -d "Gitnow: Stage files in current working directory" -w 'git add'
if not __gitnow_is_git_repository
__gitnow_msg_not_valid_repository "stage"
return
Expand All @@ -46,7 +46,7 @@ function stage -d "Gitnow: Stage files in current working directory"
command git add $opts
end

function unstage -d "Gitnow: Unstage files in current working directory"
function unstage -d "Gitnow: Unstage files in current working directory" -w 'git reset'
if not __gitnow_is_git_repository
__gitnow_msg_not_valid_repository "unstage"
return
Expand All @@ -62,7 +62,7 @@ function unstage -d "Gitnow: Unstage files in current working directory"
command git reset $opts
end

function show -d "Gitnow: Show commit detail objects"
function show -d "Gitnow: Show commit detail objects" -w 'git show'
if not __gitnow_is_git_repository
__gitnow_msg_not_valid_repository "show"
return
Expand All @@ -87,7 +87,7 @@ function untracked -d "Gitnow: Check for untracked files and directories on curr

end

function commit -d "Gitnow: Commit changes to the repository"
function commit -d "Gitnow: Commit changes to the repository" -w 'git commit'
if not __gitnow_is_git_repository
__gitnow_msg_not_valid_repository "commit"
return
Expand All @@ -112,7 +112,7 @@ function commit-all -d "Gitnow: Add and commit all changes to the repository"
commit .
end

function pull -d "Gitnow: Pull changes from remote server but stashing uncommitted changes"
function pull -d "Gitnow: Pull changes from remote server but stashing uncommitted changes" -w 'git pull'
if not __gitnow_is_git_repository
__gitnow_msg_not_valid_repository "pull"
return
Expand Down Expand Up @@ -159,7 +159,7 @@ end

# Git push with --set-upstream
# Shortcut inspired from https://github.com/jamiew/git-friendly
function push -d "Gitnow: Push commit changes to remote repository"
function push -d "Gitnow: Push commit changes to remote repository" -w 'git push'
if not __gitnow_is_git_repository
__gitnow_msg_not_valid_repository "push"
return
Expand Down Expand Up @@ -373,7 +373,7 @@ function move -d "GitNow: Switch from current branch to another but stashing unc
end
end

# Move to prev branch either via the --prev option or the "-" shorthand char
# Move to prev branch either via the --prev option or the "-" shorthand char
if begin test -n "$v_prev"; or [ "$args" = "-" ]; end
if begin test -z "$g_current_branch"; or [ "$g_current_branch" = (__gitnow_current_branch_name) ]; end
echo "Previous branch not found or the same as current one. Nothing to do."
Expand Down

0 comments on commit 5dab658

Please sign in to comment.