<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-p4.py, branch v2.32.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.32.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.32.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2021-05-06T03:51:33Z</updated>
<entry>
<title>git-p4: speed up search for branch parent</title>
<updated>2021-05-06T03:51:33Z</updated>
<author>
<name>Joachim Kuebart</name>
<email>joachim.kuebart@gmail.com</email>
</author>
<published>2021-05-05T11:56:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6b79818bfbd39a5d41d15003375a9f382f70ad0e'/>
<id>urn:sha1:6b79818bfbd39a5d41d15003375a9f382f70ad0e</id>
<content type='text'>
For every new branch that git-p4 imports, it needs to find the commit
where it branched off its parent branch. While p4 doesn't record this
information explicitly, the first changelist on a branch is usually an
identical copy of the parent branch.

The method searchParent() tries to find a commit in the history of the
given "parent" branch whose tree exactly matches the initial changelist
of the new branch, "target". The code iterates through the parent
commits and compares each of them to this initial changelist using
diff-tree.

Since we already know the tree object name we are looking for, spawning
diff-tree for each commit is wasteful.

Use the "--format" option of "rev-list" to find out the tree object name
of each commit in the history, and find the tree whose name is exactly
the same as the tree of the target commit to optimize this.

This results in a considerable speed-up, at least on Windows. On one
Windows machine with a fairly large repository of about 16000 commits in
the parent branch, the current code takes over 7 minutes, while the new
code only takes just over 10 seconds for the same changelist:

Before:

    $ time git p4 sync
    Importing from/into multiple branches
    Depot paths: //depot
    Importing revision 31274 (100.0%)
    Updated branches: b1

    real    7m41.458s
    user    0m0.000s
    sys     0m0.077s

After:

    $ time git p4 sync
    Importing from/into multiple branches
    Depot paths: //depot
    Importing revision 31274 (100.0%)
    Updated branches: b1

    real    0m10.235s
    user    0m0.000s
    sys     0m0.062s

Signed-off-by: Joachim Kuebart &lt;joachim.kuebart@gmail.com&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Helped-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 'dl/p4-encode-after-kw-expansion'</title>
<updated>2021-01-16T05:48:47Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-01-16T05:48:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=453e149c8a9da871fb3d99a5f12e790cb9c2b1ff'/>
<id>urn:sha1:453e149c8a9da871fb3d99a5f12e790cb9c2b1ff</id>
<content type='text'>
Text encoding fix for "git p4".

* dl/p4-encode-after-kw-expansion:
  git-p4: fix syncing file types with pattern
</content>
</entry>
<entry>
<title>git-p4: fix syncing file types with pattern</title>
<updated>2020-12-23T21:49:40Z</updated>
<author>
<name>Daniel Levin</name>
<email>dendy.ua@gmail.com</email>
</author>
<published>2020-12-23T14:37:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=52fc4f195c93eb2b1d1edfae69079646d8c2ea99'/>
<id>urn:sha1:52fc4f195c93eb2b1d1edfae69079646d8c2ea99</id>
<content type='text'>
Example of pattern file type: text+k

Text filtered through the p4 pattern regexp must be converted from
string back to bytes, otherwise 'data' command for the fast-import
will receive extra invalid characters, followed by the fast-import
process error.

CC: Yang Zhao &lt;yang.zhao@skyboxlabs.com&gt;
Signed-off-by: Daniel Levin &lt;dendy.ua@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/p4-default-branch'</title>
<updated>2020-11-11T21:18:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2020-11-11T21:18:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca8870d7c198b658a0e3004e27d1c36305702f7f'/>
<id>urn:sha1:ca8870d7c198b658a0e3004e27d1c36305702f7f</id>
<content type='text'>
"git p4" now honors init.defaultBranch configuration.

* js/p4-default-branch:
  p4: respect init.defaultBranch
</content>
</entry>
<entry>
<title>p4: respect init.defaultBranch</title>
<updated>2020-11-09T21:01:47Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2020-11-08T08:41:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1b09d1917f376d52e191102509d08303f8d26388'/>
<id>urn:sha1:1b09d1917f376d52e191102509d08303f8d26388</id>
<content type='text'>
In `git p4 clone`, we hard-code the branch name `master` instead of
looking what the _actual_ initial branch name is. Let's fix that.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: fixing two trivial typos in Documentation/</title>
<updated>2020-11-05T20:52:50Z</updated>
<author>
<name>Marlon Rac Cambasis</name>
<email>marlonrc08@gmail.com</email>
</author>
<published>2020-11-05T20:48:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b7e20b43733b81474b3b50a63cabe647538b010f'/>
<id>urn:sha1:b7e20b43733b81474b3b50a63cabe647538b010f</id>
<content type='text'>
Fix misspelled "specified" and "occurred" in documentation and
comments.

Signed-off-by: Marlon Rac Cambasis &lt;marlonrc08@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<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>
</feed>
