Martin von Gagern wrote:
> bash completion does not append / after dir names; patch attached.
> 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.
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, especially regarding subject lines and log
> 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