FS#64977 - git p4 is broken

Attached to Project: Arch Linux
Opened by John Hubbard (bluesky) - Sunday, 29 December 2019, 04:17 GMT
Last edited by Christian Hesse (eworm) - Sunday, 29 December 2019, 21:18 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: git p4 is broken. This appears to be because the latest release changed the first line of /usr/lib/git-core/git-p4 from:

#!/usr/bin/python2

to:

#!/usr/bin/python

Changing it back, or downgrading to git 2.24.1-2, avoids the failure. See below for more details.

Additional info:
* git 2.24.1-3

Steps to reproduce:

sudo pacman -Syu
# Change to a git-p4 cloned directory, then:
git p4 rebase

Results:

Traceback (most recent call last):
File "/usr/lib/git-core/git-p4", line 4172, in <module>
main()
File "/usr/lib/git-core/git-p4", line 4164, in main
os.environ["GIT_DIR"] = cmd.gitdir
File "/usr/lib/python3.8/os.py", line 678, in __setitem__
value = self.encodevalue(value)
File "/usr/lib/python3.8/os.py", line 748, in encode
raise TypeError("str expected, not %s" % type(value).__name__)
TypeError: str expected, not bytes

The above is what happens if you try intermix python2 and python3 code, speaking somewhat loosely.
This task depends upon

Closed by  Christian Hesse (eworm)
Sunday, 29 December 2019, 21:18 GMT
Reason for closing:  Fixed
Additional comments about closing:  git 2.24.1-4
Comment by Eli Schwartz (eschwartz) - Sunday, 29 December 2019, 16:03 GMT
That's very interesting, because upstream supposedly tried to port it to python3, see the changes here:

https://github.com/git/git/commits/db2d997efa43596fe5860d1b1c0c410e99d96f67/git-p4.py

If it is nevertheless still broken, I bet the git development mailing list would be grateful for the report.
Comment by loqs (loqs) - Sunday, 29 December 2019, 16:51 GMT Comment by Eli Schwartz (eschwartz) - Sunday, 29 December 2019, 16:58 GMT
Aha, and that's in the "pu" branch, not master...
Comment by Christian Hesse (eworm) - Sunday, 29 December 2019, 19:44 GMT
Please try git 2.24.1-4.
Comment by John Hubbard (bluesky) - Sunday, 29 December 2019, 19:58 GMT
1. Switching to the latest in git's "pu" branch, the problem is fixed there. In other words, the answer to "Is the issue present after https://github.com/git/git/commit/5fcac4275b1c4e4cc9ca0f0e6a62c0656f0133b3 ?" is "no".

2. I'm not sure how to retrieve git 2.24.1-4, is there a special arch location to point to? "sudo pacman -Syu" leaves me at git 2.24.1-3.
Comment by Eli Schwartz (eschwartz) - Sunday, 29 December 2019, 20:01 GMT
The package was released 14 minutes ago, depending on how quickly your mirror syncs you may need to wait up to a couple hours.

EDIT: It's also only in testing: https://www.archlinux.org/packages/testing/x86_64/git/
(There is a download link there. You can selectively upgrade the git package since in this case you know there isn't a pending rebuild or anything.)
Comment by John Hubbard (bluesky) - Sunday, 29 December 2019, 20:44 GMT
OK, I've retrieved 2.24.1-4 from testing/ and confirmed that it fixes the problem!

Loading...