# fish completion for ggc
# Code generated by go run tools/cmd/gencompletions/main.go; DO NOT EDIT.

function __ggc_complete_branches
    ggc __complete branch 2>/dev/null
end

function __ggc_complete_files
    ggc __complete files 2>/dev/null
end

# Main commands
complete -c ggc -f -a "add am archive bisect blame branch checkout cherry-pick clean commit completion config debug-keys describe diff doctor fetch format-patch fsck gc grep help history hook log maintenance merge mv notes prune pull push quit range-diff rebase reflog remote reset restore revert rm shortlog show sparse-checkout stash status submodule switch tag version worktree"
complete -c ggc -f -n "__fish_seen_subcommand_from branch" -a "checkout contains create current delete info list move rename set sort"
complete -c ggc -f -n "__fish_seen_subcommand_from branch; and __fish_seen_subcommand_from delete" -a "merged"
complete -c ggc -f -n "__fish_seen_subcommand_from branch; and __fish_seen_subcommand_from list" -a "local remote verbose"
complete -c ggc -f -n "__fish_seen_subcommand_from branch; and __fish_seen_subcommand_from set" -a "upstream"
complete -c ggc -f -n "__fish_seen_subcommand_from clean" -a "dirs files interactive"
complete -c ggc -f -n "__fish_seen_subcommand_from commit" -a "allow amend fixup"
complete -c ggc -f -n "__fish_seen_subcommand_from commit; and __fish_seen_subcommand_from allow" -a "empty"
complete -c ggc -f -n "__fish_seen_subcommand_from commit; and __fish_seen_subcommand_from amend" -a "no-edit"
complete -c ggc -f -n "__fish_seen_subcommand_from completion" -a "bash fish install zsh"
complete -c ggc -f -n "__fish_seen_subcommand_from config" -a "get list set"
complete -c ggc -f -n "__fish_seen_subcommand_from debug-keys" -a "raw"
complete -c ggc -f -n "__fish_seen_subcommand_from diff" -a "head staged unstaged"
complete -c ggc -f -n "__fish_seen_subcommand_from fetch" -a "prune"
complete -c ggc -f -n "__fish_seen_subcommand_from history" -a "clear last search"
complete -c ggc -f -n "__fish_seen_subcommand_from hook" -a "disable edit enable install list uninstall"
complete -c ggc -f -n "__fish_seen_subcommand_from log" -a "graph simple"
complete -c ggc -f -n "__fish_seen_subcommand_from pull" -a "current rebase"
complete -c ggc -f -n "__fish_seen_subcommand_from push" -a "current force"
complete -c ggc -f -n "__fish_seen_subcommand_from rebase" -a "abort autosquash continue interactive skip"
complete -c ggc -f -n "__fish_seen_subcommand_from remote" -a "add list remove set-url"
complete -c ggc -f -n "__fish_seen_subcommand_from reset" -a "hard soft"
complete -c ggc -f -n "__fish_seen_subcommand_from restore" -a "staged"
complete -c ggc -f -n "__fish_seen_subcommand_from show" -a "--name-only --stat"
complete -c ggc -f -n "__fish_seen_subcommand_from stash" -a "apply branch clear create drop list pop push save show store"
complete -c ggc -f -n "__fish_seen_subcommand_from stash; and __fish_seen_subcommand_from push" -a "-m"
complete -c ggc -f -n "__fish_seen_subcommand_from status" -a "short"
complete -c ggc -f -n "__fish_seen_subcommand_from switch" -a "--detach -c"
complete -c ggc -f -n "__fish_seen_subcommand_from tag" -a "annotated create delete list push show"
complete -c ggc -f -n "__fish_seen_subcommand_from version" -a "json"

# Branch checkout needs both keyword and dynamic branch names
complete -c ggc -f -n "__fish_seen_subcommand_from branch; and __fish_seen_subcommand_from checkout" -a "remote (__ggc_complete_branches)"

# Rebase branch completion when not using a subcommand
complete -c ggc -f -n "__fish_seen_subcommand_from rebase; and not __fish_seen_subcommand_from interactive; and not __fish_seen_subcommand_from continue; and not __fish_seen_subcommand_from abort; and not __fish_seen_subcommand_from skip" -a "(__ggc_complete_branches)"

# Add subcommands also allow file completion
complete -c ggc -f -n "__fish_seen_subcommand_from add" -a "interactive patch"
complete -c ggc -f -n "__fish_seen_subcommand_from add" -a "(__ggc_complete_files)"
