From f55b87c1c748cdec7ce1631e6296e3edfd7cfc7d Mon Sep 17 00:00:00 2001 From: Romain Merland Date: Fri, 1 Jun 2018 09:46:14 +0200 Subject: git-p4: add options --commit and --disable-rebase On a daily work with multiple local git branches, the usual way to submit only a specified commit was to cherry-pick the commit on master then run git-p4 submit. It can be very annoying to switch between local branches and master, only to submit one commit. The proposed new way is to select directly the commit you want to submit. Add option --commit to command 'git-p4 submit' in order to submit only specified commit(s) in p4. On a daily work developping software with big compilation time, one may not want to rebase on his local git tree, in order to avoid long recompilation. Add option --disable-rebase to command 'git-p4 submit' in order to disable rebase after submission. Thanks-to: Cedric Borgese Reviewed-by: Luke Diamand Signed-off-by: Romain Merland Signed-off-by: Junio C Hamano --- Documentation/git-p4.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Documentation') diff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt index d8c8f11c9f..88d109debb 100644 --- a/Documentation/git-p4.txt +++ b/Documentation/git-p4.txt @@ -149,6 +149,12 @@ To specify a branch other than the current one, use: $ git p4 submit topicbranch ------------ +To specify a single commit or a range of commits, use: +------------ +$ git p4 submit --commit +$ git p4 submit --commit +------------ + The upstream reference is generally 'refs/remotes/p4/master', but can be overridden using the `--origin=` command-line option. @@ -330,6 +336,14 @@ These options can be used to modify 'git p4 submit' behavior. p4/master. See the "Sync options" section above for more information. +--commit |:: + Submit only the specified commit or range of commits, instead of the full + list of changes that are in the current Git branch. + +--disable-rebase:: + Disable the automatic rebase after all commits have been successfully + submitted. + Rebase options ~~~~~~~~~~~~~~ These options can be used to modify 'git p4 rebase' behavior. -- cgit v1.2.1 From 3b3477ea5ae0a443ecceaf588c41cbc937066260 Mon Sep 17 00:00:00 2001 From: Luke Diamand Date: Fri, 8 Jun 2018 21:32:43 +0100 Subject: git-p4: disable-rebase: allow setting this via configuration This just lets you set the --disable-rebase option with the git configuration options git-p4.disableRebase. If you're using this option, you probably want to set it all the time for a given repo. Signed-off-by: Luke Diamand Signed-off-by: Junio C Hamano --- Documentation/git-p4.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt index 88d109debb..699fcc8f8a 100644 --- a/Documentation/git-p4.txt +++ b/Documentation/git-p4.txt @@ -342,7 +342,7 @@ These options can be used to modify 'git p4 submit' behavior. --disable-rebase:: Disable the automatic rebase after all commits have been successfully - submitted. + submitted. Can also be set with git-p4.disableRebase. Rebase options ~~~~~~~~~~~~~~ @@ -658,6 +658,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. + IMPLEMENTATION DETAILS ---------------------- * Changesets from p4 are imported using Git fast-import. -- cgit v1.2.1 From b9d34db9a2108755ad01926cccc2a5007b5862a6 Mon Sep 17 00:00:00 2001 From: Luke Diamand Date: Fri, 8 Jun 2018 21:32:44 +0100 Subject: git-p4: add option to disable syncing of p4/master with p4 Add an option to the git-p4 submit command to disable syncing with Perforce. This is useful for the case where a git-p4 mirror has been setup on a server somewhere, running from (e.g.) cron, and developers then clone from this. Having the local cloned copy also sync from Perforce just isn't useful. Signed-off-by: Luke Diamand Signed-off-by: Junio C Hamano --- Documentation/git-p4.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Documentation') diff --git a/Documentation/git-p4.txt b/Documentation/git-p4.txt index 699fcc8f8a..fa0e992049 100644 --- a/Documentation/git-p4.txt +++ b/Documentation/git-p4.txt @@ -344,6 +344,11 @@ These options can be used to modify 'git p4 submit' behavior. Disable the automatic rebase after all commits have been successfully submitted. Can also be set with git-p4.disableRebase. +--disable-p4sync:: + Disable the automatic sync of p4/master from Perforce after commits have + been submitted. Implies --disable-rebase. Can also be set with + git-p4.disableP4Sync. Sync with origin/master still goes ahead if possible. + Rebase options ~~~~~~~~~~~~~~ These options can be used to modify 'git p4 rebase' behavior. @@ -661,6 +666,9 @@ git-p4.conflict:: 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. -- cgit v1.2.1