You are not logged in.

#1 2008-09-20 16:13:07

AlexC_
Member
Registered: 2008-07-14
Posts: 14

SVN Tab Complete issues (space after each complete)

Morning all,

I've got a weird issue with my SVN tab complete using Bash, it adds a space after each item it completes - for example: Say there is a directory 'foobar' with a file 'zomg' within that, I'd type 'svn add fo' and then hit tab - however, this results in 'svn add foobar ' (note the space). This is highly annoying, as I can no longer hit 'z' then tab to complete it to 'foobar/zomg', I have to remove the space, then go again (it does it for everything, so adding something like 'foobar/zomg/wtf/bbq' is a nightmare.)

So far it only does it with Bash, I've not been able to test it on other shells. Subversion 1.4.6-4 on an up-to-date Arch install with core, extra and community repos enabled (however it has done it from the very start of me using Arch, so it's not a recent update that killed it).

Regards,

Last edited by AlexC_ (2008-09-20 16:13:48)

Offline

#2 2008-09-21 02:06:17

alanhaggai
Member
From: World Wide Web
Registered: 2008-08-15
Posts: 25
Website

Re: SVN Tab Complete issues (space after each complete)

Hi AlexC_ :-)

I suspect that it may be an issue with /etc/bash_completion. This is the relevant part from my /etc/bash_completion.

# svn completion
#
have svn &&
{
_svn()
{
    local cur prev commands options command

    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}

    commands='add blame praise annotate ann cat checkout co cleanup commit \
        ci copy cp delete del remove rm diff di export help ? h import \
        info list ls lock log merge mkdir move mv rename ren \
        propdel pdel pd propedit pedit pe propget pget pg \
        proplist plist pl propset pset ps resolved revert \
        status stat st switch sw unlock update up'

    if [[ $COMP_CWORD -eq 1 ]] ; then
        if [[ "$cur" == -* ]]; then
            COMPREPLY=( $( compgen -W '--version' -- $cur ) )
        else
            COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
        fi
    else

        prev=${COMP_WORDS[COMP_CWORD-1]}
        case $prev in
            --config-dir)
                _filedir -d
                return 0;
                ;;
            -@(F|-file|-targets))
                _filedir
                return 0;
                ;;
            --encoding)
                COMPREPLY=( $( compgen -W \
                    '$( iconv --list | sed -e "s@//@@;" )' \
                    -- "$cur" ) )
                return 0;
                ;;
            --@(editor|diff|diff3)-cmd)
                COMP_WORDS=(COMP_WORDS[0] $cur)
                COMP_CWORD=1
                _command
                return 0;
                ;;
        esac

        command=${COMP_WORDS[1]}

        if [[ "$cur" == -* ]]; then
            # possible options for the command
            case $command in
                add)
                    options='--auto-props --no-auto-props \
                        --force --targets --no-ignore \
                        --non-recursive -N -q --quiet'
                    ;;
                @(blame|annotate|ann|praise))
                    options='-r --revisions --username \
                        --password --no-auth-cache \
                        --non-interactive -v \
                        --verbose --incremental --xml'
                    ;;
                cat)
                    options='-r --revision --username \
                        --password --no-auth-cache \
                        --non-interactive'
                    ;;
                @(checkout|co))
                    options='-r --revision -q --quiet -N \
                        --non-recursive --username \
                        --password --no-auth-cache \
                        --non-interactive \
                        --ignore-externals'
                    ;;
                cleanup)
                    options='--diff3-cmd'
                    ;;
                @(commit|ci))
                    options='-m --message -F --file \
                        --encoding --force-log -q \
                        --quiet --non-recursive -N \
                        --targets --editor-cmd \
                        --username --password \
                        --no-auth-cache \
                        --non-interactive --no-unlock'
                    ;;
                @(copy|cp))
                    options='-m --message -F --file \
                        --encoding --force-log -r \
                        --revision -q --quiet \
                        --editor-cmd -username \
                        --password --no-auth-cache \
                        --non-interactive'
                    ;;
                @(delete|del|remove|rm))
                    options='--force -m --message -F \
                        --file --encoding --force-log \
                        -q --quiet --targets \
                        --editor-cmd -username \
                        --password --no-auth-cache \
                        --non-interactive'
                    ;;
                @(diff|di))
                    options='-r --revision -x --extensions \
                        --diff-cmd --no-diff-deleted \
                        -N --non-recursive --username \
                        --password --no-auth-cache \
                        --non-interactive --force \
                        --old --new --notice-ancestry'
                    ;;
                export)
                    options='-r --revision -q --quiet \
                        --username --password \
                        --no-auth-cache \
                        --non-interactive -N \
                        --non-recursive --force \
                        --native-eol --ignore-externals'
                    ;;
                import)
                    options='--auto-props --no-auto-props \
                        -m --message -F --file \
                        --encoding --force-log -q \
                        --quiet --non-recursive \
                        --no-ignore --editor-cmd \
                        --username --password \
                        --no-auth-cache \
                        --non-interactive'
                    ;; 
                info)
                    options='--username --password \
                        --no-auth-cache \
                        --non-interactive -r \
                        --revision --xml --targets \
                        -R --recursive --incremental'
                    ;;
                @(list|ls))
                    options='-r --revision -v --verbose -R \
                        --recursive --username \
                        --password --no-auth-cache \
                        --non-interactive \
                        --incremental --xml'
                    ;;
                lock)
                    options='-m --message -F --file \
                        --encoding --force-log \
                        --targets --force --username \
                        --password --no-auth-cache \
                        --non-interactive'
                    ;;
                log)
                    options='-r --revision -v --verbose \
                        --targets --username \
                        --password --no-auth-cache \
                        --non-interactive \
                        --stop-on-copy --incremental \
                        --xml -q --quiet --limit'
                    ;;
                merge)
                    options='-r --revision -N \
                        --non-recursive -q --quiet \
                        --force --dry-run --diff3-cmd \
                        --username --password \
                        --no-auth-cache \
                        --non-interactive \
                        --ignore-ancestry'
                    ;;
                mkdir)
                    options='-m --message -F --file \
                        --encoding --force-log -q \
                        --quiet --editor-cmd \
                        --username --password \
                        --no-auth-cache \
                        --non-interactive'
                    ;;
                @(move|mv|rename|ren))
                    options='-m --message -F --file \
                        --encoding --force-log -r \
                        --revision -q --quiet \
                        --force --editor-cmd \
                        --username --password \
                        --no-auth-cache \
                        --non-interactive'
                    ;;
                @(propdel|pdel|pd))
                    options='-q --quiet -R --recursive -r \
                        --revision --revprop \
                        --username --password \
                        --no-auth-cache \
                        --non-interactive'
                    ;;
                @(propedit|pedit|pe))
                    options='-r --revision --revprop \
                        --encoding --editor-cmd \
                        --username --password \
                        --no-auth-cache \
                        --non-interactive --force'
                    ;;
                @(propget|pget|pg))
                    options='-R --recursive -r --revision \
                        --revprop --strict --username \
                        --password --no-auth-cache \
                        --non-interactive'
                    ;;
                @(proplist|plist|pl))
                    options='-v --verbose -R --recursive \
                        -r --revision --revprop -q \
                        --quiet --username --password \
                        --no-auth-cache \
                        --non-interactive'
                    ;;
                @(propset|pset|ps))
                    options='-F --file -q --quiet \
                        --targets -R --recursive \
                        --revprop --encoding \
                        --username --password \
                        --no-auth-cache \
                        --non-interactive -r \
                        --revision --force'
                    ;;
                resolved)
                    options='--targets -R --recursive -q \
                        --quiet'
                    ;;
                revert)
                    options='--targets -R --recursive -q \
                        --quiet'
                    ;;
                @(status|stat|st))
                    options='-u --show-updates -v \
                        --verbose -N --non-recursive \
                        -q --quiet --username \
                        --password --no-auth-cache \
                        --non-interactive --no-ignore \
                        --ignore-externals \
                        --incremental --xml'
                    ;;
                @(switch|sw))
                    options='--relocate -r --revision -N \
                        --non-recursive -q --quiet \
                        --username --password \
                        --no-auth-cache \
                        --non-interactive --diff3-cmd'
                    ;;
                unlock)
                    options='--targets --force --username \
                        --password --no-auth-cache \
                        --non-interactive'
                    ;;
                @(update|up))
                    options='-r --revision -N \
                        --non-recursive -q --quiet \
                        --username --password \
                        --no-auth-cache \
                        --non-interactive \
                        --diff3-cmd --ignore-externals'
                    ;;
            esac
            options="$options --help -h --config-dir"

            COMPREPLY=( $( compgen -W "$options" -- $cur ) )
        else
            if [[ "$command" == @(help|h|\?) ]]; then
                COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
            else
                _filedir
            fi
        fi
    fi

    return 0
}
complete -F _svn $default svn

_svnadmin()
{
    local cur prev commands options mode

    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}

    commands='create deltify dump help ? hotcopy list-dblogs \
        list-unused-dblogs load lslocks lstxns recover rmlocks \
        rmtxns setlog verify'

    if [[ $COMP_CWORD -eq 1 ]] ; then
        if [[ "$cur" == -* ]]; then
            COMPREPLY=( $( compgen -W '--version' -- $cur ) )
        else
            COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
        fi
    else
        prev=${COMP_WORDS[COMP_CWORD-1]}
        case $prev in
            --config-dir)
                _filedir -d
                return 0;
                ;;
            --fs-type)
                COMPREPLY=( $( compgen -W 'fsfs bdb' -- $cur ) )
                return 0;
                ;;
        esac

        command=${COMP_WORDS[1]}

        if [[ "$cur" == -* ]]; then
            # possible options for the command
            case $command in
                create)
                    options='--bdb-txn-nosync \
                        --bdb-log-keep --config-dir \
                        --fs-type'
                    ;;
                deltify)
                    options='-r --revision -q --quiet'
                    ;;
                dump)
                    options='-r --revision --incremental \
                        -q --quiet --deltas'
                    ;;
                hotcopy)
                    options='--clean-logs'
                    ;;
                load)
                    options='--ignore-uuid --force-uuid \
                        --parent-dir -q --quiet \
                        --use-pre-commit-hook \
                        --use-post-commit-hook'
                    ;;
                rmtxns)
                    options='-q --quiet'
                    ;;
                setlog)
                    options='-r --revision --bypass-hooks'
                    ;;
            esac

            options="$options --help -h"
            COMPREPLY=( $( compgen -W "$options" -- $cur ) )
        else
            if [[ "$command" == @(help|h|\?) ]]; then
                COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
            else
                _filedir
            fi
        fi
    fi

    return 0
}
complete -F _svnadmin $default svnadmin

_svnlook()
{
    local cur prev commands options mode

    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}

    commands='author cat changed date diff dirs-changed help ? h history \
        info lock log propget pget pg proplist plist pl tree uuid \
        youngest'

    if [[ $COMP_CWORD -eq 1 ]] ; then
        if [[ "$cur" == -* ]]; then
            COMPREPLY=( $( compgen -W '--version' -- $cur ) )
        else
            COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
        fi
    else
        command=${COMP_WORDS[1]}

        if [[ "$cur" == -* ]]; then
            # possible options for the command
            case $command in
                @(author|cat|date|dirs-changed|info|log))
                    options='-r --revision -t \
                        --transaction'
                    ;;
                changed)
                    options='-r --revision -t \
                        --transaction --copy-info'
                    ;;
                diff)
                    options='-r --revision -t \
                        --transaction \
                        --no-diff-deleted \
                        --no-diff-added \
                        --diff-copy-from'
                    ;;
                history)
                    options='-r --revision --show-ids'
                    ;;
                prop@(get|list))
                    options='-r --revision -t \
                        --transaction --revprop'
                    ;;
                tree)
                    options='-r --revision -t \
                        --transaction --show-ids \
                        --full-paths'
                    ;;
            esac

            options="$options --help -h"
            COMPREPLY=( $( compgen -W "$options" -- $cur ) )
        else
            if [[ "$command" == @(help|h|\?) ]]; then
                COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
            else
                _filedir
            fi
        fi
    fi

    return 0
}
complete -F _svnlook $default svnlook
}

Hope this helps.

Last edited by alanhaggai (2008-09-21 02:08:12)


The difference makes the difference.

Offline

#3 2008-09-21 06:49:31

AlexC_
Member
Registered: 2008-07-14
Posts: 14

Re: SVN Tab Complete issues (space after each complete)

oh hai alanhaggai big_smile

I've replaced that with what was in my /etc/bash_complete (for that section) however it still does the same.

Offline

Board footer

Powered by FluxBB