tags:

views:

40

answers:

2

Hi,

Anybody knows how to get the change list user from a given changelist(say, #12345)?
p4 describe -s #12345
will give output like this:

Change #12345 by user@user_clientspec on 2010/07/26 10:26:29
affected files...

.......

Is there any command to give only the user name. Not with client spec as it shows user@user_clientspec.

Appreciate your help.

Thanks, Tom

A: 

I think you'll just have to parse the output.

This ungainly bit of powershell will get you the user:

p4 describe -s 12345 | select-object -first 1 | %{ $_.Split()[3].Split('@')[0] }
tenpn
+2  A: 

p4 change -o 12345 | grep ^User:

Bryan Pendleton
Nice. This powershell snippet will parse out the actual username, rather than just the line: `p4 change -o 12345 | foreach{if($_ -match "^User:\w*(.*)") {$matches[1].Trim()}}`
tenpn