All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luke Diamand <luke@diamand.org>
To: Junio C Hamano <gitster@pobox.com>, Vitor Antunes <vitor.hda@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH V3 0/2] git-p4: improve client path detection when branches are used
Date: Wed, 22 Apr 2015 21:47:42 +0100	[thread overview]
Message-ID: <553808EE.8020404@diamand.org> (raw)
In-Reply-To: <xmqqegncf5ps.fsf@gitster.dls.corp.google.com>

On 22/04/15 18:11, Junio C Hamano wrote:
> Vitor Antunes <vitor.hda@gmail.com> writes:
>
>> The updates introduced in the third revision of these two patches consist only
>> on updates to the commit messages to better clarify what they implement.
>>
>> Vitor Antunes (2):
>>    t9801: check git-p4's branch detection with client spec enabled
>>    git-p4: improve client path detection when branches are used
>>
>>   git-p4.py                |   13 ++++--
>>   t/t9801-git-p4-branch.sh |  106 ++++++++++++++++++++++++++++++++++++++++++++++
>>   2 files changed, 115 insertions(+), 4 deletions(-)
>
> Thanks; will re-queue.  Luke, could you comment?

First off: kudos to Vitor for daring to enter this particular dragon's 
den. The combination of branch-detection and use-client-spec isn't so 
bad, but throwing in the handling of excluding bits of the tree via the 
P4 client spec (like, who would even do that?) makes it into a real mind 
twister!

I've held off commenting as I don't feel I know the branch detection 
code as well as I would like. The change though seems a lot more robust 
now that the search is anchored. Having a test case is always good!

However, playing around with this (incredibly complex and obscure) 
scenario, I'm not yet sure about it.

I created a depot that had //depot/main and //depot/branch, and a branch 
mapping between the two. I cloned that in git using --use-client-spec 
and --branch-detect, and all was well.

I then modified my client spec to exclude //depot/main/excluded, and 
then started adding files in git to the 'excluded' directory. When I 
submit them, I get:

$ echo hello >excluded/f1.c
$ echo hello >f2.c
$ git add excluded/f1.c f2.c
$ git commit -m 'Partially excluded'
$ git-p4.py submit
DEBUG: self.useClientSpec = True
Perforce checkout for depot path //depot/main/ located at 
/home/lgd/p4-hacking/cli/main/
Synchronizing p4 checkout...
... - file(s) up-to-date.
Applying 51f187b Excluded added from git
excluded/c - file(s) not in client view.
excluded/c - file(s) not opened on this client.
Could not determine file type for excluded/c (result: '')

When I reverted this change, it failed differently, and appeared to be 
extremely confused in the way that I think Vitor originally describes, 
getting hopelessly baffled by the client spec layout.

It's entirely possibly I've messed up my manual testing though. I need 
to go and have a very strong cup of tea before I can look at this again.

Thanks!
Luke

  reply	other threads:[~2015-04-22 20:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 22:49 [PATCH V3 0/2] git-p4: improve client path detection when branches are used Vitor Antunes
2015-04-21 22:49 ` [PATCH V3 1/2] t9801: check git-p4's branch detection with client spec enabled Vitor Antunes
2015-04-21 22:49 ` [PATCH V3 2/2] git-p4: improve client path detection when branches are used Vitor Antunes
2015-04-22 17:11 ` [PATCH V3 0/2] " Junio C Hamano
2015-04-22 20:47   ` Luke Diamand [this message]
2015-04-23  8:37     ` Vitor Antunes
2015-04-23 10:03       ` Luke Diamand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=553808EE.8020404@diamand.org \
    --to=luke@diamand.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=vitor.hda@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.