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

Re: slash after dir in bash_completion

From: Hyrum K. Wright <hyrum_wright_at_mail.utexas.edu>
Date: 2007-01-17 03:06:55 CET

Martin von Gagern wrote:
> Abstract:
> bash completion does not append / after dir names; patch attached.
>
>
> Hi!
>
> I'm using svn 1.4.2 on Gentoo, including the bash_completion script that
> is bundled with the original source tarball.
>
> This exhibits a behaviour that's been annoying me for some time now:
> after directory names there is a trailing space, not a slash. So if I
> want to diff a file deep in some working tree, I have to repeatedly type
> the beginning of the dir name, press tab, backspace, slash, and then go
> on to the next directory level.
>
> The solution I found (after studying the bash_completion script as well
> as the output from the "completion" bash builtin) is this:
> replace "-o default" with "-o filenames" in the calls to "complete".
>
> This causes minor problems when you have a directory that has the same
> name as some command. In this case, the complection function will
> complete the command name, but bash will add a slash.
>
> The solution to this would probably be to have the trailing slashes and
> spaces managed in the completion function as well, i.e. have something
> append a / to all generated dir name completions and so on.
>
> This sounds like much work, and I'd think a person relying on command
> name completion in a working copy with a directory of the same name
> should be a rare coincidence. Therefore I'd say "-o filenames" is good
> enough for 95% of all cases whre it makes a difference at all.
>
> So please apply my patch to the current trunk.

Martin,
I have not reviewed your patch, however, I do have a suggestion. Your
patch a much greater probability of being applied if you follow the
guidelines in HACKING[1], especially regarding subject lines and log
messages.

[1] http://subversion.tigris.org/hacking.html#patches

Thanks,
-Hyrum

> ------------------------------------------------------------------------
>
> Index: trunk/tools/client-side/bash_completion
> ===================================================================
> --- trunk/tools/client-side/bash_completion (revision 23051)
> +++ trunk/tools/client-side/bash_completion (working copy)
> @@ -616,7 +616,7 @@
> COMPREPLY=( $( compgen -W "$cmdOpts" -- $cur ) )
> return 0
> }
> -complete -F _svn -o default svn
> +complete -F _svn -o filenames svn
>
> _svnadmin ()
> {
> @@ -717,4 +717,4 @@
>
> return 0
> }
> -complete -F _svnadmin -o default svnadmin
> +complete -F _svnadmin -o filenames svnadmin
>
>
>

Received on Wed Jan 17 03:07:16 2007

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.