<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-p4.py, branch v2.23.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.23.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.23.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-07-09T22:25:40Z</updated>
<entry>
<title>Merge branch 'am/p4-branches-excludes'</title>
<updated>2019-07-09T22:25:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-07-09T22:25:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=44275f5e1bef37304f5a9da65b588e344eb00a72'/>
<id>urn:sha1:44275f5e1bef37304f5a9da65b588e344eb00a72</id>
<content type='text'>
"git p4" update.

* am/p4-branches-excludes:
  git-p4: respect excluded paths when detecting branches
  git-p4: add failing test for "git-p4: respect excluded paths when detecting branches"
  git-p4: don't exclude other files with same prefix
  git-p4: add failing test for "don't exclude other files with same prefix"
  git-p4: don't groom exclude path list on every commit
  git-p4: match branches case insensitively if configured
  git-p4: add failing test for "git-p4: match branches case insensitively if configured"
  git-p4: detect/prevent infinite loop in gitCommitByP4Change()
</content>
</entry>
<entry>
<title>Merge branch 'mm/p4-unshelve-windows-fix'</title>
<updated>2019-06-17T17:15:19Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-06-17T17:15:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=add59c4708cd629a6ee3175f0e0a796cc9b6db28'/>
<id>urn:sha1:add59c4708cd629a6ee3175f0e0a796cc9b6db28</id>
<content type='text'>
The command line to invoke a "git cat-file" command from inside
"git p4" was not properly quoted to protect a caret and running a
broken command on Windows, which has been corrected.

* mm/p4-unshelve-windows-fix:
  p4 unshelve: fix "Not a valid object name HEAD0" on Windows
</content>
</entry>
<entry>
<title>p4 unshelve: fix "Not a valid object name HEAD0" on Windows</title>
<updated>2019-05-28T20:32:20Z</updated>
<author>
<name>Mike Mueller</name>
<email>mike.mueller@moodys.com</email>
</author>
<published>2019-05-28T18:15:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c3f2358de39a8ac754ae68880a992835a84a6f0c'/>
<id>urn:sha1:c3f2358de39a8ac754ae68880a992835a84a6f0c</id>
<content type='text'>
git p4 unshelve was failing with these errors:

fatal: Not a valid object name HEAD0
Command failed: git cat-file commit HEAD^0

(git version 2.21.0.windows.1, python 2.7.16)

The pOpen call used by git-p4 to invoke the git command can take either a
string or an array as a first argument. The array form is preferred
because platform-specific escaping of special characters will be
handled automatically.(https://docs.python.org/2/library/subprocess.html)
The extractLogMessageFromGitCommit method was, however, using the string
form and so the caret (^) character in the HEAD^0 argument was not being
escaped on Windows.  The caret happens to be the escape character, which
is why the git command was receiving HEAD0.

The behaviour can be confirmed by typing ECHO HEAD^0 at the command-
prompt, which emits HEAD0.

The solution is simply to use the array format of passing the command to
fOpen, which is recommended and used in other parts of this code anyway.

Signed-off-by: Mike Mueller &lt;mike.mueller@moodys.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: allow unshelving of branched files</title>
<updated>2019-05-28T17:54:42Z</updated>
<author>
<name>Simon Williams</name>
<email>simon@no-dns-yet.org.uk</email>
</author>
<published>2019-05-22T06:21:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0108f47eb30b9b473e044285b731e2fbca803170'/>
<id>urn:sha1:0108f47eb30b9b473e044285b731e2fbca803170</id>
<content type='text'>
When unshelving a changelist, git-p4 tries to work out the appropriate
parent commit in a given branch (default: HEAD).  To do this, it looks
at the state of any pre-existing files in the target Perforce branch,
omitting files added in the shelved changelist.  Currently, only files
added (or move targets) are classed as new.  However, files integrated
from other branches (i.e. a 'branch' action) also need to be considered
as added, for this purpose.

Signed-off-by: Simon Williams &lt;simon@no-dns-yet.org.uk&gt;
Acked-by: Luke Diamand &lt;luke@diamand.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: respect excluded paths when detecting branches</title>
<updated>2019-04-02T02:25:42Z</updated>
<author>
<name>Mazo, Andrey</name>
<email>amazo@checkvideo.com</email>
</author>
<published>2019-04-01T18:02:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d15068a6501bec72fddec9f79372a5e3ce5e1379'/>
<id>urn:sha1:d15068a6501bec72fddec9f79372a5e3ce5e1379</id>
<content type='text'>
Currently, excluded paths are only handled in the following cases:
 * no branch detection;
 * branch detection with using clientspec.

However, excluded paths are not respected in case of
branch detection without using clientspec.

Fix this by consulting the list of excluded paths
when splitting files across branches.

Signed-off-by: Andrey Mazo &lt;amazo@checkvideo.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: don't exclude other files with same prefix</title>
<updated>2019-04-02T02:25:41Z</updated>
<author>
<name>Mazo, Andrey</name>
<email>amazo@checkvideo.com</email>
</author>
<published>2019-04-01T18:02:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a2bee10ad9ed4dc45c1f7da76f01388925b80212'/>
<id>urn:sha1:a2bee10ad9ed4dc45c1f7da76f01388925b80212</id>
<content type='text'>
Make sure not to exclude files unintentionally
if exclude paths are specified without a trailing /.
I.e., don't exclude "//depot/file_dont_exclude" if run with "-//depot/file".

Do this by ensuring that paths without a trailing "/" are only matched completely.

Also, abort path search on the first match as a micro-optimization.

Signed-off-by: Andrey Mazo &lt;amazo@checkvideo.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: don't groom exclude path list on every commit</title>
<updated>2019-04-02T02:25:41Z</updated>
<author>
<name>Mazo, Andrey</name>
<email>amazo@checkvideo.com</email>
</author>
<published>2019-04-01T18:02:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ff8c50ed0c98d9bc6aaf5fc2e93bd976c3076750'/>
<id>urn:sha1:ff8c50ed0c98d9bc6aaf5fc2e93bd976c3076750</id>
<content type='text'>
Currently, `cloneExclude` array is being groomed (by removing trailing "...")
on every changeset.
(since `extractFilesFromCommit()` is called on every imported changeset)

As a micro-optimization, do it once while parsing arguments.
Also, prepend "/" and remove trailing "..." at the same time.

Signed-off-by: Andrey Mazo &lt;amazo@checkvideo.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: match branches case insensitively if configured</title>
<updated>2019-04-02T02:25:41Z</updated>
<author>
<name>Mazo, Andrey</name>
<email>amazo@checkvideo.com</email>
</author>
<published>2019-04-01T18:02:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f2768cb343cb0320f79692625dea7f50af643759'/>
<id>urn:sha1:f2768cb343cb0320f79692625dea7f50af643759</id>
<content type='text'>
git-p4 knows how to handle case insensitivity in file paths
if core.ignorecase is set.
However, when determining a branch for a file,
it still does a case-sensitive prefix match.
This may result in some file changes to be lost on import.

For example, given the following commits
 1. add //depot/main/file1
 2. add //depot/DirA/file2
 3. add //depot/dira/file3
 4. add //depot/DirA/file4
and "branchList = main:DirA" branch mapping,
commit 3 will be lost.

So, do branch search case insensitively if running with core.ignorecase set.
Teach splitFilesIntoBranches() to use the p4PathStartsWith() function
for path prefix matches instead of always case-sensitive match.

Signed-off-by: Andrey Mazo &lt;amazo@checkvideo.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: detect/prevent infinite loop in gitCommitByP4Change()</title>
<updated>2019-04-02T02:25:41Z</updated>
<author>
<name>Mazo, Andrey</name>
<email>amazo@checkvideo.com</email>
</author>
<published>2019-04-01T18:02:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2dda741279ba3c56340f3bd88745604bb5a394a6'/>
<id>urn:sha1:2dda741279ba3c56340f3bd88745604bb5a394a6</id>
<content type='text'>
Under certain circumstances, gitCommitByP4Change() can enter an infinite
loop resulting in `git p4 sync` hanging forever.

The problem is that
`git rev-list --bisect &lt;latest&gt; ^&lt;earliest&gt;` can return `&lt;latest&gt;`,
which would result in reinspecting &lt;latest&gt; and potentially an infinite loop.

This can happen when importing just a subset of P4 repository
and/or with explicit "--changesfile" option.

A real-life example:
"""
    looking in ref refs/remotes/p4/mybranch for change 26894 using bisect...
    Reading pipe: git rev-parse refs/remotes/p4/mybranch
    trying: earliest  latest 4daff81c520a82678e1ef347f2b5e97258101ae1
    Reading pipe: git rev-list --bisect 4daff81c520a82678e1ef347f2b5e97258101ae1
    Reading pipe: git cat-file commit 147f5d3292af2e1cc4a56a7b96db845144c68486
    current change 25339
    trying: earliest ^147f5d3292af2e1cc4a56a7b96db845144c68486 latest 4daff81c520a82678e1ef347f2b5e97258101ae1
    Reading pipe: git rev-list --bisect 4daff81c520a82678e1ef347f2b5e97258101ae1 ^147f5d3292af2e1cc4a56a7b96db845144c68486
    Reading pipe: git cat-file commit 51db83df9d588010d0bd995641c85aa0408a5bb9
    current change 25420
    trying: earliest ^51db83df9d588010d0bd995641c85aa0408a5bb9 latest 4daff81c520a82678e1ef347f2b5e97258101ae1
    Reading pipe: git rev-list --bisect 4daff81c520a82678e1ef347f2b5e97258101ae1 ^51db83df9d588010d0bd995641c85aa0408a5bb9
    Reading pipe: git cat-file commit e8f83909ceb570f5a7e48c2853f3c5d8207cea52
    current change 25448
    trying: earliest ^e8f83909ceb570f5a7e48c2853f3c5d8207cea52 latest 4daff81c520a82678e1ef347f2b5e97258101ae1
    Reading pipe: git rev-list --bisect 4daff81c520a82678e1ef347f2b5e97258101ae1 ^e8f83909ceb570f5a7e48c2853f3c5d8207cea52
    Reading pipe: git cat-file commit 09a48eb7acd594dce52e06681be9c366e1844d66
    current change 25521
    trying: earliest ^09a48eb7acd594dce52e06681be9c366e1844d66 latest 4daff81c520a82678e1ef347f2b5e97258101ae1
    Reading pipe: git rev-list --bisect 4daff81c520a82678e1ef347f2b5e97258101ae1 ^09a48eb7acd594dce52e06681be9c366e1844d66
    Reading pipe: git cat-file commit 4daff81c520a82678e1ef347f2b5e97258101ae1
    current change 26907
    trying: earliest ^09a48eb7acd594dce52e06681be9c366e1844d66 latest 4daff81c520a82678e1ef347f2b5e97258101ae1
    Reading pipe: git rev-list --bisect 4daff81c520a82678e1ef347f2b5e97258101ae1 ^09a48eb7acd594dce52e06681be9c366e1844d66
    Reading pipe: git cat-file commit 4daff81c520a82678e1ef347f2b5e97258101ae1
    current change 26907
    trying: earliest ^09a48eb7acd594dce52e06681be9c366e1844d66 latest 4daff81c520a82678e1ef347f2b5e97258101ae1
    Reading pipe: git rev-list --bisect 4daff81c520a82678e1ef347f2b5e97258101ae1 ^09a48eb7acd594dce52e06681be9c366e1844d66
    Reading pipe: git cat-file commit 4daff81c520a82678e1ef347f2b5e97258101ae1
    current change 26907
    ...
"""

The fix is two-fold:
 * detect an infinite loop and die right away
   instead of looping forever;
 * make sure, `git rev-list --bisect` can't return "latestCommit" again
   by excluding it from the rev-list range explicitly.

Signed-off-by: Andrey Mazo &lt;amazo@checkvideo.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ld/git-p4-shelve-update-fix'</title>
<updated>2019-02-05T22:26:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-02-05T22:26:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=40b8ba2c4458bd1ed6d32092712c07a4fc26e256'/>
<id>urn:sha1:40b8ba2c4458bd1ed6d32092712c07a4fc26e256</id>
<content type='text'>
"git p4" failed to update a shelved change when there were moved
files, which has been corrected.

* ld/git-p4-shelve-update-fix:
  git-p4: handle update of moved/copied files when updating a shelve
  git-p4: add failing test for shelved CL update involving move/copy
</content>
</entry>
</feed>
