Add CLI command to replace existing checkin-comment
Via GUI it's possible to edit existing checkin-comments and save them.
In the CLI (cm command line) there is no equivalent to this action. There should be a command to replace the comment of a specified changeset.
That way we could apply batch pattern-replacement in checkin comments, similar to "git filter-branch --msg-filter". This is not about rewriting history, as only the comments will be modified.
An example of where this is useful: after import from SVN via Git each changeset has got an appended formatted string, starting with "git-svn-id:" and containing info about the corresponding branch and revision in the original SVN repository. It would be very nice to be able to batch-process this formatted string into something more readable without having to do it during the actual migration.
Additionally, in Plastic there are ways to add auto-comments on checkin. Whenever we have a formatted string that can be pattern-matched and that is automatically added to each commit, it will be useful to be able to post-process those.
-
Eric Mehl commented
This would be a big help for our use case too - looking up data from other databases based on user-entered codes to pull in checkin comments from other sources
-
Peter Hackett commented
The cm command should be able to do anything the GUI can do.
As near as I can tell, cm *is* the api for Plastic. The api is incomplete.
This is not the case for Perforce p4 or p4api.
-
Actually the command could probably be used to change comments of any object, like branches, labels and so on.
Interesting but not high prio, I'm afraid.
-
Göran Wallgren commented
While it _is_ possible to achieve this via "advanced queries" and "execquery update" it's not recommended... There should be a CLI command for this since it's already doable in the GUI. Suggested syntax:
cm replacecheckincomment | replmsg cset_spec new_comment
cm replmsg cs:85 "Testing the new replace comment feature"