P4,如何从给定的变更列表中查找变更列表用户?

发布于 2024-09-11 06:00:55 字数 305 浏览 1 评论 0原文

有人知道如何从给定的变更列表中获取变更列表用户(比如#12345)?
p4 描述 -s #12345
将给出如下输出:

Change #12345 by user@user_clientspec on 2010/07/26 10:26:29
受影响的文件...

.......

是否有任何命令只给出用户名。不适用于客户端规范,因为它显示 user@user_clientspec。

感谢您的帮助。

谢谢, 汤姆

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

寻找一个思念的角度 2024-09-18 06:00:55
p4 change -o 12345 | grep ^User:

或者,如果您使用的是“p4”命令行的最新版本:

p4 -F "%User%" -ztag change -o 12345
p4 change -o 12345 | grep ^User:

Or, if you're on a fairly recent version of the 'p4' command line:

p4 -F "%User%" -ztag change -o 12345
从此见与不见 2024-09-18 06:00:55

我认为你只需要解析输出。

这个笨拙的 powershell 会让你获得用户:

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

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] }
无所的.畏惧 2024-09-18 06:00:55

仅获取用户,而不获取其他“User:”字符串、尾随空格等。请尝试:

bash -c "p4 change -o 12345 | grep -oP '(?<=^User:).*' | xargs"

to get only the user, and not other "User:" strings, trailing spaces, etc. try:

bash -c "p4 change -o 12345 | grep -oP '(?<=^User:).*' | xargs"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文