# (C) 2011-2025 magicant

# Completion script for the "git-revert" command.
# Supports Git 2.48.1.

function completion/git-revert {
        WORDS=(git revert "${WORDS[2,-1]}")
        command -f completion//reexecute
}

function completion/git::revert:arg {

        OPTIONS=( #>#
        "--abort; end suspended revert and restore the original state"
        "--cleanup:; specify the way the message is cleaned up"
        "--continue; resume suspended revert"
        "e --edit; (re)edit the message"
        "m: --mainline:; specify the mainline parent by number"
        "n --no-commit; don't commit the reversion result automatically"
        "--no-edit; don't reedit the message"
        "--no-gpg-sign; don't sign commits using GPG"
        "--no-rerere-autoupdate; don't update the index with rerere resolution"
        "--quit; end suspended quit and keep the current state"
        "--reference; use the reference format in the message"
        "--rerere-autoupdate; update the index with rerere resolution"
        "S:: --gpg-sign::; sign commits with GPG"
        "s --signoff; add a \"signed-off-by\" line to the message"
        "--strategy:; specify the merge strategy"
        "X: --strategy-option:; specify a strategy-specific option"
        ) #<#

        command -f completion//parseoptions
        case $ARGOPT in
                (-)
                        command -f completion//completeoptions
                        ;;
                ('')
                        command -f completion/git::completeref range=true
                        ;;
                (*)
                        if command -vf completion/git::merge:compopt >/dev/null 2>&1 ||
                                        . -AL completion/git-merge; then
                                command -f completion/git::merge:compopt
                        fi
                        ;;
        esac

}


# vim: set ft=sh ts=8 sts=8 sw=8 et:
