{"thread":{"id":"63036","subject":"git-p4 enhancements and fixes","startedAt":"2025-03-02T02:27:56Z","lastAt":"2025-03-02T02:27:56Z","messageCount":1,"participants":["Nikolay Shustov"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"513354","messageId":"e3e8729b-2f0f-43d4-bd3b-422302df9fa1@gmail.com","threadId":"63036","inReplyTo":null,"subject":"git-p4 enhancements and fixes","fromName":"Nikolay Shustov","fromEmail":"nikolay.shustov@gmail.com","sentAt":"2025-03-02T02:27:52Z","receivedAt":"2025-03-02T02:27:56Z","isPatch":false,"sender":{"key":"nikolay.shustov@gmail.com","avatar":null},"body":"Hello,\nI am having in works the following changes to git-p4 which I found \nuseful for the usage workflow I typically have to follow.\nI think these could be useful for the users of git-p4 in general.\nLooking for the feedback and comments.\nThank you in advance for your time and consideration.\n\nEnhancements:\n=============\n\nNew git-p4.P4CommandErrorEncoding (string) configuration setting\n****************************************************************\n\nThis configuration setting allows to specify the characters encoding \nthat will be used for reading the errors Perforce commands may return. \nIf not set, utf-8 is used.\nThis setting is useful when Perforce client and/or server are configured \nto use single-byte encoding, like Laitn-1; in such cases git-p4 errors \nout while trying to decode error messages from Perforce commands which \nhappen to contain high-bit set characters in the output.\nSetting git-p4.P4CommandErrorEncoding to ‘latin-1’ will now allow git-p4 \nto proceed.\n\nNew --disable-p4refresh command line option\n*******************************************\n\nIf used, git-p4 will not attempt to sync the associated p4 workspace \nbefore creating changelist from git commits.\nNew associated configuration setting: git-p4.disableP4Refresh (boolean)\n\nNew --new-changelist command line option\n****************************************\n\nCan be used for “shelve” command git-p4 command.\nIf used, git-p4 will create a new numbered changelist from gits commits, \nas opposite to using default changelist.\nNew associated configuration setting: git-p4.makeNewChangelist (boolean)\n\nNew --keep-p4opened command line option\n***************************************\n\nCan be used for “shelve” git-p4 command.\nIf used, git-p4 will not revert the changelist files after creating \nshelving them.\nNew associated configuration setting: git-p4.keepShelvedFilesOpened \n(boolean)\n\nNew --p4-description-file=<filepath> command line option\n********************************************************\n\nThis option used instructs git-p4 will use the given file contents as a \ntemplate for the description of new changelist.\nThe template supports the following substitutions:\n     {message} – substituted with the commit message\n     {hash}  – substituted with the commit hash\nNew associated configuration setting: git-p4.descriptionTemplateFile \n(string)\n\nExample: --p4-description-file=~/git-p4/default-description.txt\n\n\nNew --p4-description=string command line option\n***********************************************\n\nThis option used instructs git-p4 will use the given string as a \ntemplate for changelist message.\nThe template supports the following substitutions:\n     {message} – substituted with the commit message\n     {hash}  – substituted with the commit hash\n     \\n – substituted with the newline character; allows to create \nmultiline descriptions.\nNew associated configuration setting: git-p4.descriptionTemplate (string)\n\nExample: --p4-description=”{message}\\nGit commit: {hash}”\n\nNew --no-edit-p4spec command line option\n****************************************\n\nIf used, git-p4 will not bring up editor for editing the changelist spec \nbefore proceeding, for the usage scenarios where it normally would.\nAssociated with the existing configuration setting git-p4.skipSubmitEdit\n\nNew --edit-p4spec command line option\n*************************************\n\nIf used, git-p4 will bring up editor for editing the changelist spec \nbefore proceeding, for the usage scenarios where it normally would not.\n\n\nFixes:\n======\n\nIssue: After p4 revert operations, git-p4 leaves writeable files in the \nPerforce workspace.\n\nScenario: git-p4 reverts created changelist, as a result of the \nsuccessful shelve or after error happened.\n\nProblem: The files that were added, are left in the Perforce workspace \nabandoned and writeable after the revert operation. Now these files are \nin the way of the syncing the Perforce workspace unless it is explicitly \ninstructed to clobber writeable files and/or forced sync is used \n(depending on workspace settings etc.)\n\nFix: For such scenarios, git-p4 implementation now calls “p4 revert” \nwith “-w” option, which instructs Perforce client to delete files which \nwere marked in changelist as “added”.\n-------------------------------------------------------------------------------------------------------------------------------------------------\n\nThank you,\n- Nikolay\n"}]}