git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git-p4: fix problem when p4 login is not necessary
@ 2019-01-07 20:51 Peter Osterlund
  2019-01-07 22:05 ` Luke Diamand
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Osterlund @ 2019-01-07 20:51 UTC (permalink / raw)
  To: Git Users; +Cc: gitster, Luke Diamand

In a perforce setup where login is not required, communication fails 
because p4_check_access does not understand the response from the p4 
client. Fixed by detecting and ignoring the "info" response.

Signed-off-by: Peter Osterlund <peterosterlund2@gmail.com>
---
  git-p4.py | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/git-p4.py b/git-p4.py
index 1998c3e141..3e12774f96 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -332,6 +332,8 @@ def p4_check_access(min_expiration=1):
              die_bad_access("p4 error: {0}".format(data))
          else:
              die_bad_access("unknown error")
+    elif code == "info":
+        return
      else:
          die_bad_access("unknown error code {0}".format(code))


-- 
Peter Osterlund - peterosterlund2@gmail.com
http://hem.bredband.net/petero2b

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-p4: fix problem when p4 login is not necessary
  2019-01-07 20:51 [PATCH] git-p4: fix problem when p4 login is not necessary Peter Osterlund
@ 2019-01-07 22:05 ` Luke Diamand
  2019-01-07 22:24   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Luke Diamand @ 2019-01-07 22:05 UTC (permalink / raw)
  To: Peter Osterlund; +Cc: Git Users, Junio C Hamano

On Mon, 7 Jan 2019 at 20:51, Peter Osterlund <peterosterlund2@gmail.com> wrote:
>
> In a perforce setup where login is not required, communication fails
> because p4_check_access does not understand the response from the p4
> client. Fixed by detecting and ignoring the "info" response.

This is caused by my earlier change in this area. I think this fix
looks good, thanks.
Ack.

>
> Signed-off-by: Peter Osterlund <peterosterlund2@gmail.com>
> ---
>   git-p4.py | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/git-p4.py b/git-p4.py
> index 1998c3e141..3e12774f96 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -332,6 +332,8 @@ def p4_check_access(min_expiration=1):
>               die_bad_access("p4 error: {0}".format(data))
>           else:
>               die_bad_access("unknown error")
> +    elif code == "info":
> +        return
>       else:
>           die_bad_access("unknown error code {0}".format(code))
>
>
> --
> Peter Osterlund - peterosterlund2@gmail.com
> http://hem.bredband.net/petero2b

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] git-p4: fix problem when p4 login is not necessary
  2019-01-07 22:05 ` Luke Diamand
@ 2019-01-07 22:24   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2019-01-07 22:24 UTC (permalink / raw)
  To: Luke Diamand; +Cc: Peter Osterlund, Git Users

Luke Diamand <luke@diamand.org> writes:

> On Mon, 7 Jan 2019 at 20:51, Peter Osterlund <peterosterlund2@gmail.com> wrote:
>>
>> In a perforce setup where login is not required, communication fails
>> because p4_check_access does not understand the response from the p4
>> client. Fixed by detecting and ignoring the "info" response.
>
> This is caused by my earlier change in this area. I think this fix
> looks good, thanks.
> Ack.
>
>>
>> Signed-off-by: Peter Osterlund <peterosterlund2@gmail.com>
>> ---
>>   git-p4.py | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/git-p4.py b/git-p4.py
>> index 1998c3e141..3e12774f96 100755
>> --- a/git-p4.py
>> +++ b/git-p4.py
>> @@ -332,6 +332,8 @@ def p4_check_access(min_expiration=1):
>>               die_bad_access("p4 error: {0}".format(data))
>>           else:
>>               die_bad_access("unknown error")
>> +    elif code == "info":
>> +        return
>>       else:
>>           die_bad_access("unknown error code {0}".format(code))
>>
>>
>> --
>> Peter Osterlund - peterosterlund2@gmail.com
>> http://hem.bredband.net/petero2b

The patch was whitespace damaged, but for a two-liner like this, I
can type it myself instead, so no need to resend.

Thanks, both.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-07 22:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-07 20:51 [PATCH] git-p4: fix problem when p4 login is not necessary Peter Osterlund
2019-01-07 22:05 ` Luke Diamand
2019-01-07 22:24   ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).