[p4] Bash completion with depot paths

John Hopkins johnh at ca.sophos.com
Thu Sep 20 16:03:36 PDT 2007


> Date: Wed, 19 Sep 2007 08:49:16 -0700
> From: Andrew May <acmay at acmay.homeip.net>
> Subject: [p4] Bash completion with depot paths
> To: Perforce Users <perforce-user at perforce.com>
> 
> I have been working on getting tab completions working for depot paths
> with the bash completion file started by Frank Cusak. It took a bit of
> flailing to get the dirs/files to expand ok without putting in the
> extra spaces that would throw things off along the way.
> That seemed to be the problem another person ran into on this mailing
> list too.

I've seen UNIX developers create a directory (or symlink) under the
root of their directory hierarchy which gives them depot path
completion for free.  Your client spec would be rooted at /depot if
your depot name is 'depot'.  You can double up the initial '/' - bash
(or UNIX) doesn't mind.  The only limitation is you have to p4 sync
whatever you want to tab complete in advance so that bash sees those
files and directories locally.

Example:
$ ls /
bin dev depot
$ p4 sync /depot/...
$ p4 sync //depot/[tab][tab]
branch1/ branch2/

hth,
John

-- 
John Hopkins
Build Engineer, Sophos
Sophos - security and control


More information about the perforce-user mailing list