[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: bash_completion - subversion add: svn ls/merge ^/<remote path>

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Tue, 18 Aug 2015 13:51:58 +0100

Christian Ferbar wrote:
> new version. This patch are my current changes for "svn ls" only.

Thanks, Chris. This looks much better already. (I haven't tried it.)

> I need some feedback concerning:
>
> -> how to deal with svn error messages written to stderr, for example:
> svn ls svn+ssh://svn.something.com/<tab><tab>user_at_svn.something.com's password:
>
> this happens when you forget to do ssh-add

I suggest it should simply not provide any completions that cannot be
obtained without further input. Use --non-interactive so that
Subversion does not prompt for passwords. Prevent any stderr output
being printed to the console (maybe use "2> /dev/null"). Then make
sure the script behaves OK (just returning no completions) when
Subversion returns an error. You might need to look for a non-zero
exit code explicitly, but maybe not: it might be enough to just try
parsing the stdout and if there is no recognizable stdout then you get
no resulting completions.

> -> in bash >= 4 they changed COMP_WORDS. The Line will be split at : as well, so "file:/something" are 3 array items. Nobody would use subversion 1.9 with bash 3 ... probably. I will drop bash 3 statements, for example:
>
> if [[ $cur == file:* ]]
>
> ok?

Dropping support for Bash 3 sounds OK to me, if it is difficult to
keep it working. Especially good if only the URL completion depends on
Bash 4 and all the rest of the existing kinds of completion keep
working with Bash 3.

>> Please can URL completion work on full URLs as well as on relative URLs?
> for SVN LS this is done:
>
> 1. svn ls tabtab -> ^/ file:/// http:// https:// svn:// svn+ssh://
> 2. svn ls svn+ssh://tabtab -> will look at the ~/.ssh/known_hosts
> 3. svn ls http[s]://tabtab -> lookup in ~/.subversion/simple-auth - should still be working
> 4. svn ls proto://server/tabtab or ^/tabtab -> autocomplete via "svn ls"

Excellent, that looks like the sort of thing I was hoping for.

- Julian
Received on 2015-08-18 14:52:38 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.