<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-p4.py, branch v2.29.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.29.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.29.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2020-09-19T20:44:55Z</updated>
<entry>
<title>git-p4: use HEAD~$n to find parent commit for unshelve</title>
<updated>2020-09-19T20:44:55Z</updated>
<author>
<name>Luke Diamand</name>
<email>luke@diamand.org</email>
</author>
<published>2020-09-19T08:54:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0acbf5997fa26747aec544d2ef6a27e4feb75e81'/>
<id>urn:sha1:0acbf5997fa26747aec544d2ef6a27e4feb75e81</id>
<content type='text'>
Found-by: Liu Xuhui (Jackson) &lt;Xuhui.Liu@amd.com&gt;
Signed-off-by: Luke Diamand &lt;luke@diamand.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bk/p4-prepare-p4-only-fix'</title>
<updated>2020-06-02T20:35:01Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-06-02T20:35:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7a8fec908a40bd009803de1617c90684e932f878'/>
<id>urn:sha1:7a8fec908a40bd009803de1617c90684e932f878</id>
<content type='text'>
The "--prepare-p4-only" option is supposed to stop after replaying
one changeset, but kept going (by mistake?)

* bk/p4-prepare-p4-only-fix:
  git-p4.py: fix --prepare-p4-only error with multiple commits
</content>
</entry>
<entry>
<title>git-p4.py: fix --prepare-p4-only error with multiple commits</title>
<updated>2020-05-12T19:42:32Z</updated>
<author>
<name>Ben Keene</name>
<email>seraphire@gmail.com</email>
</author>
<published>2020-05-12T13:15:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2dfdd705ffd8c6dd1ef75abdfb64e1a08ad35a26'/>
<id>urn:sha1:2dfdd705ffd8c6dd1ef75abdfb64e1a08ad35a26</id>
<content type='text'>
When using git p4 submit with the --prepare-p4-only option, the program
should prepare a single p4 changelist and notify the user that more
commits are pending and then stop processing.

A bug has been introduced by the p4-changelist hook feature that
causes the program to continue to try and process all pending
changelists at the same time.

The function applyCommit returns True when applying the commit
was successful and the program should continue. However, when the
optional flag --prepare-p4-only is set, the program should stop
after the first application.

Change the logic in the run method for P4Submit to check for the
flag --prepare-p4-only after successfully completing the applyCommit
method.

Be aware - this change will fix the existing test error in t9807.23
for --prepare-p4-only. However there is insufficent coverage for
this flag.  If more than 1 commit is pending submission to P4, the
method will properly prepare the P4 changelist, however it will
still exit the application with an exitcode of 1.

The current documentation does not define what the exit code should be
in this condition.
(See: https://git-scm.com/docs/git-p4#Documentation/git-p4.txt---prepare-p4-only)

Signed-off-by: Ben Keene &lt;seraphire@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: recover from inconsistent perforce history</title>
<updated>2020-05-10T16:58:50Z</updated>
<author>
<name>Andrew Oakley</name>
<email>andrew@adoakley.name</email>
</author>
<published>2020-05-10T10:16:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=82e46d6b837e96de5ee01f0298b600519aef1bba'/>
<id>urn:sha1:82e46d6b837e96de5ee01f0298b600519aef1bba</id>
<content type='text'>
Perforce allows you commit files and directories with the same name,
so you could have files //depot/foo and //depot/foo/bar both checked
in.  A p4 sync of a repository in this state fails.  Deleting one of
the files recovers the repository.

When this happens we want git-p4 to recover in the same way as
perforce.

Note that Perforce has this change in their 2017.1 version:

     Bugs fixed in 2017.1
     #1489051 (Job #2170) **
        Submitting a file with the same name as an existing depot
        directory path (or vice versa) will now be rejected.

so people hopefully will not creating damaged Perforce repos
anymore, but "git p4" needs to be able to interact with already
corrupt ones.

Signed-off-by: Andrew Oakley &lt;andrew@adoakley.name&gt;
Reviewed-by: Luke Diamand &lt;luke@diamand.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bk/p4-pre-edit-changelist'</title>
<updated>2020-04-22T20:42:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-04-22T20:42:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5f2ec211f629f5b1d9a85e924946ae2079fa96f7'/>
<id>urn:sha1:5f2ec211f629f5b1d9a85e924946ae2079fa96f7</id>
<content type='text'>
"git p4" learned four new hooks and also "--no-verify" option to
bypass them (and the existing "p4-pre-submit" hook).

* bk/p4-pre-edit-changelist:
  git-p4: add RCS keyword status message
  git-p4: add p4 submit hooks
  git-p4: restructure code in submit
  git-p4: add --no-verify option
  git-p4: add p4-pre-submit exit text
  git-p4: create new function run_git_hook
  git-p4: rewrite prompt to be Windows compatible
</content>
</entry>
<entry>
<title>Merge branch 'yz/p4-py3'</title>
<updated>2020-03-25T20:57:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-03-25T20:57:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9a0fa1709c188d8be05aa573fa914d115f55aab1'/>
<id>urn:sha1:9a0fa1709c188d8be05aa573fa914d115f55aab1</id>
<content type='text'>
Update "git p4" to work with Python 3.

* yz/p4-py3:
  ci: use python3 in linux-gcc and osx-gcc and python2 elsewhere
  git-p4: use python3's input() everywhere
  git-p4: simplify regex pattern generation for parsing diff-tree
  git-p4: use dict.items() iteration for python3 compatibility
  git-p4: use functools.reduce instead of reduce
  git-p4: fix freezing while waiting for fast-import progress
  git-p4: use marshal format version 2 when sending to p4
  git-p4: open .gitp4-usercache.txt in text mode
  git-p4: convert path to unicode before processing them
  git-p4: encode/decode communication with git for python3
  git-p4: encode/decode communication with p4 for python3
  git-p4: remove string type aliasing
  git-p4: change the expansion test from basestring to list
  git-p4: make python2.7 the oldest supported version
</content>
</entry>
<entry>
<title>git-p4: add RCS keyword status message</title>
<updated>2020-02-14T16:58:53Z</updated>
<author>
<name>Ben Keene</name>
<email>seraphire@gmail.com</email>
</author>
<published>2020-02-14T14:44:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ec4a0a356f73ef0ab57d3903bd6667942a7052c'/>
<id>urn:sha1:1ec4a0a356f73ef0ab57d3903bd6667942a7052c</id>
<content type='text'>
During the p4 submit process, git-p4 will attempt to apply a patch
to the files found in the p4 workspace. However, if P4 uses RCS
keyword expansion, this patch may fail.

When the patch fails, the user is alerted to the failure and that git-p4
will attempt to clear the expanded text from the files and re-apply
the patch. The current version of git-p4 does not tell the user the
result of the re-apply attempt after the RCS expansion has been removed
which can be confusing.

Add a new print statement after the git patch has been successfully
applied when the RCS keywords have been cleansed.

Signed-off-by: Ben Keene &lt;seraphire@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: add p4 submit hooks</title>
<updated>2020-02-14T16:58:53Z</updated>
<author>
<name>Ben Keene</name>
<email>seraphire@gmail.com</email>
</author>
<published>2020-02-14T14:44:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=38ecf75244c4cab93ecb201afff8980c29f56ce8'/>
<id>urn:sha1:38ecf75244c4cab93ecb201afff8980c29f56ce8</id>
<content type='text'>
The git command "commit" supports a number of hooks that support
changing the behavior of the commit command.  The git-p4.py program only
has one existing hook, "p4-pre-submit".  This command occurs early in
the process.  There are no hooks in the process flow for modifying
the P4 changelist text programmatically.

Adds 3 new hooks to git-p4.py to the submit option.

The new hooks are:
* p4-prepare-changelist - Execute this hook after the changelist file
  has been created. The hook will be executed even if the
  --prepare-p4-only option is set.  This hook ignores the --no-verify
  option in keeping with the existing behavior of git commit.

* p4-changelist - Execute this hook after the user has edited the
  changelist. Do not execute this hook if the user has selected the
  --prepare-p4-only option. This hook will honor the --no-verify,
  following the conventions of git commit.

* p4-post-changelist - Execute this hook after the P4 submission process
  has completed successfully. This hook takes no parameters and is
  executed regardless of the --no-verify option.  It's return value will
  not be checked.

The calls to the new hooks: p4-prepare-changelist, p4-changelist,
and p4-post-changelist should all be called inside the try-finally
block.

Signed-off-by: Ben Keene &lt;seraphire@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: restructure code in submit</title>
<updated>2020-02-14T16:58:53Z</updated>
<author>
<name>Ben Keene</name>
<email>seraphire@gmail.com</email>
</author>
<published>2020-02-14T14:44:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cd1e0dc47a5ab1520b823d051d23f60c89072349'/>
<id>urn:sha1:cd1e0dc47a5ab1520b823d051d23f60c89072349</id>
<content type='text'>
In preparation for adding new hooks to the submit method of git-p4,
restructure the applyCommit function in the P4Submit class.  Make the
following changes:

* Move all the code after the definition of submitted = False into the
  Try-Finally block. This ensures that any error that occurs will
  properly recover.  This is not necessary with the current code because
  none of it should throw an exception, however the next set of changes
  will introduce exceptional code.

  Existing flow control can remain as defined - the if-block for
  prepare-p4-only sets the local variable "submitted" to True and exits
  the function. New early exits, leave submitted set to False so the
  Finally block will undo changes to the P4 workspace.

* Make the small usability change of adding an empty string to the
  print statements displayed to the user when the prepare-p4-only option
  is selected.  On Windows, the command print() may display a set of
  parentheses "()" to the user when the print() function is called with
  no parameters. By supplying an empty string, the intended blank line
  will print as expected.

* Fix a small bug when the submittedTemplate is edited by the user
  and all content in the file is removed. The existing code will throw
  an exception if the separateLine is not found in the file. Change this
  code to test for the separator line using a find() test first and only
  split on the separator if it is found.

* Additionally, add the new behavior that if the changelist file has
  been completely emptied that the Submit action for this changelist
  will be aborted.

Signed-off-by: Ben Keene &lt;seraphire@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: add --no-verify option</title>
<updated>2020-02-11T20:04:05Z</updated>
<author>
<name>Ben Keene</name>
<email>seraphire@gmail.com</email>
</author>
<published>2020-02-11T18:58:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4935c458c2ef301d720980eb94de4b631fe47128'/>
<id>urn:sha1:4935c458c2ef301d720980eb94de4b631fe47128</id>
<content type='text'>
Add new command line option --no-verify:

Add a new command line option "--no-verify" to the Submit command of
git-p4.py.  This option will function in the spirit of the existing
--no-verify command line option found in git commit. It will cause the
P4 Submit function to ignore the existing p4-pre-submit.

Change the execution of the existing trigger p4-pre-submit to honor the
--no-verify option. Before exiting on failure of this hook, display
text to the user explaining which hook has failed and the impact
of using the --no-verify option.

Change the call of the p4-pre-submit hook to use the new run_git_hook
function. This is in preparation of additional hooks to be added.

Signed-off-by: Ben Keene &lt;seraphire@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
