Hello,
I am having in works the following changes to git-p4 which I found
useful for the usage workflow I typically have to follow.
I think these could be useful for the users of git-p4 in general.
Looking for the feedback and comments.
Thank you in advance for your time and consideration.
Enhancements:
=============
New git-p4.P4CommandErrorEncoding (string) configuration setting
****************************************************************
This configuration setting allows to specify the characters encoding
that will be used for reading the errors Perforce commands may return.
If not set, utf-8 is used.
This setting is useful when Perforce client and/or server are configured
to use single-byte encoding, like Laitn-1; in such cases git-p4 errors
out while trying to decode error messages from Perforce commands which
happen to contain high-bit set characters in the output.
Setting git-p4.P4CommandErrorEncoding to ‘latin-1’ will now allow git-p4
to proceed.
New --disable-p4refresh command line option
*******************************************
If used, git-p4 will not attempt to sync the associated p4 workspace
before creating changelist from git commits.
New associated configuration setting: git-p4.disableP4Refresh (boolean)
New --new-changelist command line option
****************************************
Can be used for “shelve” command git-p4 command.
If used, git-p4 will create a new numbered changelist from gits commits,
as opposite to using default changelist.
New associated configuration setting: git-p4.makeNewChangelist (boolean)
New --keep-p4opened command line option
***************************************
Can be used for “shelve” git-p4 command.
If used, git-p4 will not revert the changelist files after creating
shelving them.
New associated configuration setting: git-p4.keepShelvedFilesOpened
(boolean)
New --p4-description-file=<filepath> command line option
********************************************************
This option used instructs git-p4 will use the given file contents as a
template for the description of new changelist.
The template supports the following substitutions:
{message} – substituted with the commit message
{hash} – substituted with the commit hash
New associated configuration setting: git-p4.descriptionTemplateFile
(string)
Example: --p4-description-file=~/git-p4/default-description.txt
New --p4-description=string command line option
***********************************************
This option used instructs git-p4 will use the given string as a
template for changelist message.
The template supports the following substitutions:
{message} – substituted with the commit message
{hash} – substituted with the commit hash
\n – substituted with the newline character; allows to create
multiline descriptions.
New associated configuration setting: git-p4.descriptionTemplate (string)
Example: --p4-description=”{message}\nGit commit: {hash}”
New --no-edit-p4spec command line option
****************************************
If used, git-p4 will not bring up editor for editing the changelist spec
before proceeding, for the usage scenarios where it normally would.
Associated with the existing configuration setting git-p4.skipSubmitEdit
New --edit-p4spec command line option
*************************************
If used, git-p4 will bring up editor for editing the changelist spec
before proceeding, for the usage scenarios where it normally would not.
Fixes:
======
Issue: After p4 revert operations, git-p4 leaves writeable files in the
Perforce workspace.
Scenario: git-p4 reverts created changelist, as a result of the
successful shelve or after error happened.
Problem: The files that were added, are left in the Perforce workspace
abandoned and writeable after the revert operation. Now these files are
in the way of the syncing the Perforce workspace unless it is explicitly
instructed to clobber writeable files and/or forced sync is used
(depending on workspace settings etc.)
Fix: For such scenarios, git-p4 implementation now calls “p4 revert”
with “-w” option, which instructs Perforce client to delete files which
were marked in changelist as “added”.
-------------------------------------------------------------------------------------------------------------------------------------------------
Thank you,
- Nikolay