Perforce blame

前端 未结 6 1837
闹比i
闹比i 2021-02-01 13:07

Is there an equivalent of svn\'s blame for Perforce on the command line? p4 annotate doesn\'t display usernames -- only changeset numbers (without ancestor history!

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-01 13:25

    I'm not overly familiar with the blame command, but I assume that you are looking for who changes a particular line of code. The easiest way is to use Perforce's 'time lapse view' available from both p4win and p4v.

    This tool uses annotate and some other commands to give you a view of the code line over time. You can see who modified what code, when it was inserted or removed from the codeline, etc.

    It's not command line though. I checked briefly in the help and there doesnt' seem to be a way to launch the time lapse view directly from a p4win or p4v invocation. There might be though...I'll be checking further...

    Edit: I checked with support, and you can launch the timelapse view through p4v as follows:

    p4v.exe -cmd "annotate //"
    

    HTH.

提交回复
热议问题