<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-p4.py, branch v2.37.0-rc2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.37.0-rc2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.37.0-rc2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-05-20T22:27:00Z</updated>
<entry>
<title>Merge branch 'tk/p4-metadata-coding-strategies'</title>
<updated>2022-05-20T22:27:00Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-20T22:27:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3af1df0415741c85f84e78e281339186be1d05d7'/>
<id>urn:sha1:3af1df0415741c85f84e78e281339186be1d05d7</id>
<content type='text'>
"git p4" updates.

* tk/p4-metadata-coding-strategies:
  git-p4: improve encoding handling to support inconsistent encodings
</content>
</entry>
<entry>
<title>Merge branch 'kf/p4-multiple-remotes'</title>
<updated>2022-05-20T22:26:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-20T22:26:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=586f23705c639d08fc3c1f1489cdec57e18a1fe9'/>
<id>urn:sha1:586f23705c639d08fc3c1f1489cdec57e18a1fe9</id>
<content type='text'>
"git p4" update.

* kf/p4-multiple-remotes:
  git-p4: fix issue with multiple perforce remotes
</content>
</entry>
<entry>
<title>Merge branch 'tk/p4-with-explicity-sync'</title>
<updated>2022-05-20T22:26:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-20T22:26:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=af3a3205d14561e1683ca86b894888f9f1fc0176'/>
<id>urn:sha1:af3a3205d14561e1683ca86b894888f9f1fc0176</id>
<content type='text'>
"git p4" update.

* tk/p4-with-explicity-sync:
  git-p4: support explicit sync of arbitrary existing git-p4 refs
</content>
</entry>
<entry>
<title>Merge branch 'tk/p4-utf8-bom'</title>
<updated>2022-05-20T22:26:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-05-20T22:26:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=804ec0301fddb68d5170939084d79e2c0c672028'/>
<id>urn:sha1:804ec0301fddb68d5170939084d79e2c0c672028</id>
<content type='text'>
"git p4" update.

* tk/p4-utf8-bom:
  git-p4: preserve utf8 BOM when importing from p4 to git
</content>
</entry>
<entry>
<title>git-p4: improve encoding handling to support inconsistent encodings</title>
<updated>2022-05-04T17:30:01Z</updated>
<author>
<name>Tao Klerks</name>
<email>tao@klerks.biz</email>
</author>
<published>2022-04-30T19:26:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f7b5ff607fa1a62a480399afb6ccb9691735bf79'/>
<id>urn:sha1:f7b5ff607fa1a62a480399afb6ccb9691735bf79</id>
<content type='text'>
git-p4 is designed to run correctly under python2.7 and python3, but
its functional behavior wrt importing user-entered text differs across
these environments:

Under python2, git-p4 "naively" writes the Perforce bytestream into git
metadata (and does not set an "encoding" header on the commits); this
means that any non-utf-8 byte sequences end up creating invalidly-encoded
commit metadata in git.

Under python3, git-p4 attempts to decode the Perforce bytestream as utf-8
data, and fails badly (with an unhelpful error) when non-utf-8 data is
encountered.

Perforce clients (especially p4v) encourage user entry of changelist
descriptions (and user full names) in OS-local encoding, and store the
resulting bytestream to the server unmodified - such that different
clients can end up creating mutually-unintelligible messages. The most
common inconsistency, in many Perforce environments, is likely to be utf-8
(typical in linux) vs cp-1252 (typical in windows).

Make the changelist-description- and user-fullname-handling code
python-runtime-agnostic, introducing three "strategies" selectable via
config:
- 'passthrough', behaving as previously under python2,
- 'strict', behaving as previously under python3, and
- 'fallback', favoring utf-8 but supporting a secondary encoding when
utf-8 decoding fails, and finally escaping high-range bytes if the
decoding with the secondary encoding also fails.

Keep the python2 default behavior as-is ('legacy' strategy), but switch
the python3 default strategy to 'fallback' with default fallback encoding
'cp1252'.

Also include tests exercising these encoding strategies, documentation for
the new config, and improve the user-facing error messages when decoding
does fail.

Signed-off-by: Tao Klerks &lt;tao@klerks.biz&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: preserve utf8 BOM when importing from p4 to git</title>
<updated>2022-04-06T19:59:58Z</updated>
<author>
<name>Tao Klerks</name>
<email>tao@klerks.biz</email>
</author>
<published>2022-04-04T05:50:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fbe5f6b80437adbcd58af1b3751b830910a2ddaa'/>
<id>urn:sha1:fbe5f6b80437adbcd58af1b3751b830910a2ddaa</id>
<content type='text'>
Perforce has a file type "utf8" which represents a text file with
explicit BOM. utf8-encoded files *without* BOM are stored as
regular file type "text". The "utf8" file type behaves like text
in all but one important way: it is stored, internally, without
the leading 3 BOM bytes.

git-p4 has historically imported utf8-with-BOM files (files stored,
in Perforce, as type "utf8") the same way as regular text files -
losing the BOM in the process.

Under most circumstances this issue has little functional impact,
as most systems consider the BOM to be optional and redundant, but
this *is* a correctness failure, and can have lead to practical
issues for example when BOMs are explicitly included in test files,
for example in a file encoding test suite.

Fix the handling of utf8-with-BOM files when importing changes from
p4 to git, and introduce a test that checks it is working correctly.

Signed-off-by: Tao Klerks &lt;tao@klerks.biz&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: support explicit sync of arbitrary existing git-p4 refs</title>
<updated>2022-04-06T19:59:40Z</updated>
<author>
<name>Tao Klerks</name>
<email>tao@klerks.biz</email>
</author>
<published>2022-04-04T05:10:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=17f273ffbad8724278e0fa4da592a7ec7c6abc83'/>
<id>urn:sha1:17f273ffbad8724278e0fa4da592a7ec7c6abc83</id>
<content type='text'>
With the --branch argument of the "sync" subcommand, git-p4 enables
you to import a perforce branch/path to an arbitrary git ref, using
a full ref path, or to refs/remotes/p4/* or refs/heads/p4/*,
depending on --import-local, using a short ref name.

However, when you later want to explicitly sync such a given ref to
pick up subsequent p4 changes, it only works if the ref was placed
in the p4 path *and* has only one path component (no "/").

This limitation results from a bad assumption in the
existing-branch sync logic, and also means you cannot individually
sync branches detected by --detect-branches, as these also get a
"/" in their names.

Fix "git p4 sync --branch", when called with an existing ref, so
that it works correctly regardless of whether the ref is in the p4
path or not, and (in the case of refs in the p4 path) regardless of
whether it has a "/" in its short name or not.

Also add tests to validate that these branch-specific syncs work
as expected.

Signed-off-by: Tao Klerks &lt;tao@klerks.biz&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: sort imports</title>
<updated>2022-04-01T20:15:44Z</updated>
<author>
<name>Joel Holdsworth</name>
<email>jholdsworth@nvidia.com</email>
</author>
<published>2022-04-01T14:25:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4ff0108d9e21e274b4fefa840a84ff4953ec8e06'/>
<id>urn:sha1:4ff0108d9e21e274b4fefa840a84ff4953ec8e06</id>
<content type='text'>
Signed-off-by: Joel Holdsworth &lt;jholdsworth@nvidia.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: seperate multiple statements onto seperate lines</title>
<updated>2022-04-01T20:15:44Z</updated>
<author>
<name>Joel Holdsworth</name>
<email>jholdsworth@nvidia.com</email>
</author>
<published>2022-04-01T14:25:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e8f8b3b2a34fadaa559b25ec734c78ab9ef1228f'/>
<id>urn:sha1:e8f8b3b2a34fadaa559b25ec734c78ab9ef1228f</id>
<content type='text'>
PEP8 discourages the use of compound statements where there are multiple
statements on a single line in the "Other Recommendations" section:

https://www.python.org/dev/peps/pep-0008/#other-recommendations

Signed-off-by: Joel Holdsworth &lt;jholdsworth@nvidia.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-p4: move inline comments to line above</title>
<updated>2022-04-01T20:15:44Z</updated>
<author>
<name>Joel Holdsworth</name>
<email>jholdsworth@nvidia.com</email>
</author>
<published>2022-04-01T14:25:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4768af208850ef3de74908c498acf9f8956cf545'/>
<id>urn:sha1:4768af208850ef3de74908c498acf9f8956cf545</id>
<content type='text'>
PEP8 recommends that all inline comments should be separated from code
by two spaces, in the "Inline Comments" section:

https://www.python.org/dev/peps/pep-0008/#inline-comments

However, because all instances of these inline comments extended to an
excessive line length, they have been moved onto a seprate line.

Signed-off-by: Joel Holdsworth &lt;jholdsworth@nvidia.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
