[PATCHv2,0/3] git-p4: improved unshelving - small fixes
mbox series

Message ID 20181015111408.17618-1-luke@diamand.org
Headers show
Series
  • git-p4: improved unshelving - small fixes
Related show

Message

Luke Diamand Oct. 15, 2018, 11:14 a.m. UTC
This is the same as my earlier patch other than fixing the
documentation to reflect the change to the destination branch,
as noticed by Junio.

Luke Diamand (3):
  git-p4: do not fail in verbose mode for missing 'fileSize' key
  git-p4: unshelve into refs/remotes/p4-unshelved, not
    refs/remotes/p4/unshelved
  git-p4: fully support unshelving changelists

 Documentation/git-p4.txt | 10 ++---
 git-p4.py                | 90 +++++++++++++++++++++++-----------------
 t/t9832-unshelve.sh      | 75 ++++++++++++++++++++++++++-------
 3 files changed, 117 insertions(+), 58 deletions(-)

Comments

Junio C Hamano Oct. 16, 2018, 4:27 a.m. UTC | #1
Luke Diamand <luke@diamand.org> writes:

> This is the same as my earlier patch other than fixing the
> documentation to reflect the change to the destination branch,
> as noticed by Junio.

Also you set up when-finished driver for clean-up before running
clone, which I think is a good change, too.

Will replace.  Thanks.

>
> Luke Diamand (3):
>   git-p4: do not fail in verbose mode for missing 'fileSize' key
>   git-p4: unshelve into refs/remotes/p4-unshelved, not
>     refs/remotes/p4/unshelved
>   git-p4: fully support unshelving changelists
>
>  Documentation/git-p4.txt | 10 ++---
>  git-p4.py                | 90 +++++++++++++++++++++++-----------------
>  t/t9832-unshelve.sh      | 75 ++++++++++++++++++++++++++-------
>  3 files changed, 117 insertions(+), 58 deletions(-)
Luke Diamand Oct. 24, 2018, 11:51 a.m. UTC | #2
On Tue, 16 Oct 2018 at 05:27, Junio C Hamano <gitster@pobox.com> wrote:
>
> Luke Diamand <luke@diamand.org> writes:
>
> > This is the same as my earlier patch other than fixing the
> > documentation to reflect the change to the destination branch,
> > as noticed by Junio.
>
> Also you set up when-finished driver for clean-up before running
> clone, which I think is a good change, too.
>
> Will replace.  Thanks.

At the moment the parent commit file revisions are constructed by
p4-printing the relevant files at the required version. That's because
it's easy to do - I can just make use of the existing infrastructure
for grabbing P4 changes.

However, in most cases we will already have these files present in the
git repo - it's just that we don't know where. I think it ought to be
possible to look at the revisions of each file, and then search
through the git revision history for that file to find the magic
comment marker that git-p4 inserts (which has the P4 changelist
embedded in it) and then use that - rather than going back to the
Perforce depot.

In most cases that ought to be quite a bit faster, especially for large files.

For now I'm not proposing to do this as it's quite a bit more work
(this isn't really my day job!) and for the typical use case (at least
the ones I encounter) the performance of unshelving isn't really that
important - the fact that it does it at all is quite amazing.

But anyway, if someone somewhere finds that git-p4 unshelve
performance is too slow, then that's the change to make.

Luke