On 15 May 2018 at 11:01, Luke Diamand <l...@diamand.org> wrote: > This is a git-p4 unshelve command which detects when extra > changes are going to be included, and refuses to unhshelve. > > As in my earlier unshelve change, this uses git fast-import > to do the actual delta generation, but now checks to see > if the files unshelved are based on the same revisions that > fast-import will be using, using the revision numbers in > the "p4 describe -S" command output. If they're different, > it refuses to unshelve. > > That makes it safe to use, rather than potentially generating > deltas that contain bits from other changes.
Having been using this, when it works it's great, and it's nice that it errors out rather than creating a garbled patch. But it would be really useful if it could somehow automatically build some kind of diff-base for fast-import to use. Doing so is probably not that hard given that it already knows the versions that it wants for the error reports, but it's not completely trivial either. I think you'd need to get the list of base revisions you want, then hijack the P4Sync class to generate a commit via fast-import, then feed that to the next stage as the base commit. I think it would make sense to see if anyone other than me actually cares! Luke