Home Explore Blog CI



git

10th chunk of `Documentation/git-p4.adoc`
6a84dcf37826423900965bcbba60d78222dd84fcb4613c4d0000000100000cda
 address in Git. Use a string
	with the following format to create a mapping:
+
-------------
git config --add git-p4.mapUser "p4user = First Last <mail@address.com>"
-------------
+
A mapping will override any user information from P4. Mappings for
multiple P4 user can be defined.

Submit variables
~~~~~~~~~~~~~~~~
git-p4.detectRenames::
	Detect renames.  See linkgit:git-diff[1].  This can be true,
	false, or a score as expected by 'git diff -M'.

git-p4.detectCopies::
	Detect copies.  See linkgit:git-diff[1].  This can be true,
	false, or a score as expected by 'git diff -C'.

git-p4.detectCopiesHarder::
	Detect copies harder.  See linkgit:git-diff[1].  A boolean.

git-p4.preserveUser::
	On submit, re-author changes to reflect the Git author,
	regardless of who invokes 'git p4 submit'.

git-p4.allowMissingP4Users::
	When 'preserveUser' is true, 'git p4' normally dies if it
	cannot find an author in the p4 user map.  This setting
	submits the change regardless.

git-p4.skipSubmitEdit::
	The submit process invokes the editor before each p4 change
	is submitted.  If this setting is true, though, the editing
	step is skipped.

git-p4.skipSubmitEditCheck::
	After editing the p4 change message, 'git p4' makes sure that
	the description really was changed by looking at the file
	modification time.  This option disables that test.

git-p4.allowSubmit::
	By default, any branch can be used as the source for a 'git p4
	submit' operation.  This configuration variable, if set, permits only
	the named branches to be used as submit sources.  Branch names
	must be the short names (no "refs/heads/"), and should be
	separated by commas (","), with no spaces.

git-p4.skipUserNameCheck::
	If the user running 'git p4 submit' does not exist in the p4
	user map, 'git p4' exits.  This option can be used to force
	submission regardless.

git-p4.attemptRCSCleanup::
	If enabled, 'git p4 submit' will attempt to cleanup RCS keywords
	($Header$, etc). These would otherwise cause merge conflicts and prevent
	the submit going ahead. This option should be considered experimental at
	present.

git-p4.exportLabels::
	Export Git tags to p4 labels, as per --export-labels.

git-p4.labelExportRegexp::
	Only p4 labels matching this regular expression will be exported. The
	default value is '[a-zA-Z0-9_\-.]+$'.

git-p4.conflict::
	Specify submit behavior when a conflict with p4 is found, as per
	--conflict.  The default behavior is 'ask'.

git-p4.disableRebase::
    Do not rebase the tree against p4/master following a submit.

git-p4.disableP4Sync::
    Do not sync p4/master with Perforce following a submit. Implies git-p4.disableRebase.

IMPLEMENTATION DETAILS
----------------------
* Changesets from p4 are imported using Git fast-import.
* Cloning or syncing does not require a p4 client; file contents are
  collected using 'p4 print'.
* Submitting requires a p4 client, which is not in the same location
  as the Git repository.  Patches are applied, one at a time, to
  this p4 client and submitted from there.
* Each commit imported by 'git p4' has a line at the end of the log
  message indicating the p4 depot location and change number.  This
  line is used by later 'git p4 sync' operations to know which p4
  changes are new.

GIT
---
Part of the linkgit:git[1] suite

Title: Git-p4 Configuration and Implementation Details
Summary
The git-p4 tool provides various configuration options for submit operations, including user mapping, rename and copy detection, and conflict resolution. Additionally, the implementation details of git-p4 are discussed, including the use of Git fast-import, p4 clients, and log message formatting to track p4 changes.