Open yukwunhang opened 2 years ago
Ah this would break the auto-resume for sure. As a quick workaround that might work right now, you may be able to create a new commit with the correct format by doing this:
$ git show HEAD # Record the commit ID and tree ID
$ git cat-file -p <latest commit ID> | grep tree
tree <tree ID>
$ vi commit.txt # Add the new commit message, but use the proper format that p4-fusion expects
$ echo "$(cat commit.txt)" | git commit-tree <tree ID> -p <latest commit ID>
<new commit ID>
$ git update-ref HEAD <new commit ID>
$ git show # Check if it worked
Naive implementation - p4-fusion should only consider the string from change =
up until the next newline character, and not the end of the entire commit message
Probably better implementation - p4-fusion should search for a line in the commit message that has the proper semantics i.e. [p4-fusion: depot-paths = "ABCDEFGH": change = XXXXXXXX]
, either by regex or only considering the line that starts with [p4-fusion
I used https://github.com/rtyley/bfg-repo-cleaner to purge large files from a repo generated by p4-fusion.
bfg
addsFormer-commit-id
to the commit messages:After that,
p4-fusion
is unable to parse the CL from commit message:814f
comes fromFormer-commit-id: 9885e208a53eb53e0f691fed688eae5565a814fd
.Workaround: run
bfg
with--private
to omitFormer-commit-id
from commit messages.