Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enable Fish's git <command> completion on simple wrappers #52

Merged
merged 1 commit into from
Jun 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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