Hi Git,
When I use "git p4 unshelve 4495953", it failed.
I have fixed this issue locally. You can check the attached for details.What have I done to fix this:
It's because the line#4240 in function "findLastP4Revision" of git-p4.py:
log = extractLogMessageFromGitCommit("{0}^{1}".format(starting_point, parent))
I think it should be:
log = extractLogMessageFromGitCommit("{0}~{1}".format(starting_point, parent))Best Regards, Jackson(Xuhui) Liu
------------------------------------------------------------------------------------- 1-14F, Tower 1, Candor Plaza No.669 Huanke Rd., Pudong District, Shanghai 201210, China Facebook | Twitter | amd.com
Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.
What did you do before the bug happened? (Steps to reproduce your issue)
git p4 unshelve -v 4495953
What did you expect to happen? (Expected behavior)
I want to get shelved changelist 4495953.
What happened instead? (Actual behavior)
It failed.
Here is the output log:
Reading pipe: ['git', '--git-dir', '/mnt/c/workSpace/project/git4perforce/ispDevelop/stg_3_0/.git', 'rev-parse', '--git-dir']
Reading pipe: ['git', '--git-dir', '/mnt/c/workSpace/project/git4perforce/ispDevelop/stg_3_0/.git', 'rev-parse', '--git-dir']
Reading pipe: ['git', 'config', 'git-p4.largeFileSystem']
Reading pipe: ['git', 'config', 'git-p4.syncFromOrigin']
Reading pipe: ['git', 'cat-file', 'commit', 'HEAD^0']
Reading pipe: ['git', 'cat-file', 'commit', 'HEAD^1']
Reading pipe: ['git', 'cat-file', 'commit', 'HEAD^2']
fatal: Not a valid object name HEAD^2
Traceback (most recent call last):
File "/home/xuhuiliu/gitp4/git-p4.py", line 4438, in <module>
main()
File "/home/xuhuiliu/gitp4/git-p4.py", line 4432, in main
if not cmd.run(args):
File "/home/xuhuiliu/gitp4/git-p4.py", line 4295, in run
settings = self.findLastP4Revision(self.origin)
File "/home/xuhuiliu/gitp4/git-p4.py", line 4240, in findLastP4Revision
log = extractLogMessageFromGitCommit("{0}^{1}".format(starting_point, parent))
File "/home/xuhuiliu/gitp4/git-p4.py", line 875, in extractLogMessageFromGitCommit
for log in read_pipe_lines(["git", "cat-file", "commit", commit]):
File "/home/xuhuiliu/gitp4/git-p4.py", line 349, in read_pipe_lines
die('Command failed: %s' % str(c))
File "/home/xuhuiliu/gitp4/git-p4.py", line 156, in die
raise Exception(msg)
Exception: Command failed: ['git', 'cat-file', 'commit', 'HEAD^2']What's different between what you expected and what actually happened?
I want it to sync 4495953, but it failed.
Anything else you want to add:
I have fixed it locally.
It's because the line#4240 in function "findLastP4Revision" of git-p4.py:
log = extractLogMessageFromGitCommit("{0}^{1}".format(starting_point, parent))
I think it should be:
log = extractLogMessageFromGitCommit("{0}~{1}".format(starting_point, parent))Please review the rest of the bug report below. You can delete any lines you don't wish to share.
[System Info] git version: git version 2.28.0 cpu: x86_64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh uname: Linux 4.4.0-18362-Microsoft #836-Microsoft Mon May 05 16:04:00 PST 2020 x86_64 compiler info: gnuc: 9.3 libc info: glibc: 2.31 $SHELL (typically, interactive shell): /bin/bash
[Enabled Hooks]