git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* "git p4" fails when perforce login not needed
@ 2019-01-06 22:48 Peter Osterlund
  2019-01-07 10:10 ` Luke Diamand
  2019-01-07 23:56 ` Mazo, Andrey
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Osterlund @ 2019-01-06 22:48 UTC (permalink / raw)
  To: git; +Cc: Luke Diamand

Hi,

When I use "git p4 sync" to update a git repository from a perforce depot, 
the operation fails with error message:

     failure accessing depot: unknown error code info

When I run "p4 login -s" from a shell it reports:

     'login' not necessary, no password set for this user.

The following patch fixes the problem for me:

--- /usr/libexec/git-core/git-p4~        2018-12-15 14:51:07.000000000 +0100
+++ /usr/libexec/git-core/git-p4      2019-01-06 23:23:06.934176387 +0100
@@ -332,6 +332,8 @@
              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))


Not sure if this helps, but running "p4 -G login -s | hexdump" gives:

00000000  7b 73 04 00 00 00 63 6f  64 65 73 04 00 00 00 69  |{s....codes....i|
00000010  6e 66 6f 73 05 00 00 00  6c 65 76 65 6c 69 00 00  |nfos....leveli..|
00000020  00 00 73 04 00 00 00 64  61 74 61 73 35 00 00 00  |..s....datas5...|
00000030  27 6c 6f 67 69 6e 27 20  6e 6f 74 20 6e 65 63 65  |'login' not nece|
00000040  73 73 61 72 79 2c 20 6e  6f 20 70 61 73 73 77 6f  |ssary, no passwo|
00000050  72 64 20 73 65 74 20 66  6f 72 20 74 68 69 73 20  |rd set for this |
00000060  75 73 65 72 2e 30                                 |user.0|
00000066

Best regards,

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

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

* Re: "git p4" fails when perforce login not needed
  2019-01-06 22:48 "git p4" fails when perforce login not needed Peter Osterlund
@ 2019-01-07 10:10 ` Luke Diamand
  2019-01-07 23:56 ` Mazo, Andrey
  1 sibling, 0 replies; 3+ messages in thread
From: Luke Diamand @ 2019-01-07 10:10 UTC (permalink / raw)
  To: Peter Osterlund; +Cc: Git Users

On Sun, 6 Jan 2019 at 22:48, Peter Osterlund <peterosterlund2@gmail.com> wrote:
>
> Hi,
>
> When I use "git p4 sync" to update a git repository from a perforce depot,
> the operation fails with error message:
>
>      failure accessing depot: unknown error code info
>
> When I run "p4 login -s" from a shell it reports:
>
>      'login' not necessary, no password set for this user.
>
> The following patch fixes the problem for me:

That's my fault!

Your fix looks good, thanks!

Luke


>
> --- /usr/libexec/git-core/git-p4~        2018-12-15 14:51:07.000000000 +0100
> +++ /usr/libexec/git-core/git-p4      2019-01-06 23:23:06.934176387 +0100
> @@ -332,6 +332,8 @@
>               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))
>
>
> Not sure if this helps, but running "p4 -G login -s | hexdump" gives:
>
> 00000000  7b 73 04 00 00 00 63 6f  64 65 73 04 00 00 00 69  |{s....codes....i|
> 00000010  6e 66 6f 73 05 00 00 00  6c 65 76 65 6c 69 00 00  |nfos....leveli..|
> 00000020  00 00 73 04 00 00 00 64  61 74 61 73 35 00 00 00  |..s....datas5...|
> 00000030  27 6c 6f 67 69 6e 27 20  6e 6f 74 20 6e 65 63 65  |'login' not nece|
> 00000040  73 73 61 72 79 2c 20 6e  6f 20 70 61 73 73 77 6f  |ssary, no passwo|
> 00000050  72 64 20 73 65 74 20 66  6f 72 20 74 68 69 73 20  |rd set for this |
> 00000060  75 73 65 72 2e 30                                 |user.0|
> 00000066
>
> Best regards,
>
> --
> Peter Osterlund - peterosterlund2@gmail.com
> http://hem.bredband.net/petero2b

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

* Re: "git p4" fails when perforce login not needed
  2019-01-06 22:48 "git p4" fails when perforce login not needed Peter Osterlund
  2019-01-07 10:10 ` Luke Diamand
@ 2019-01-07 23:56 ` Mazo, Andrey
  1 sibling, 0 replies; 3+ messages in thread
From: Mazo, Andrey @ 2019-01-07 23:56 UTC (permalink / raw)
  To: peterosterlund2@gmail.com
  Cc: git@vger.kernel.org, luke@diamand.org, Mazo, Andrey

On Sun, 6 Jan 2019 at 22:48, Peter Osterlund <peterosterlund2@gmail.com> wrote:
> Hi,
> 
> When I use "git p4 sync" to update a git repository from a perforce depot, 
> the operation fails with error message:
> 
>      failure accessing depot: unknown error code info
>

I guess, this got broken in
commit 0ef67acdd78 ("git-p4: better error reporting when p4 fails", 2018-06-08)

> When I run "p4 login -s" from a shell it reports:
> 
>      'login' not necessary, no password set for this user.

In my case, I was getting (this is pretty printed `p4 -G` output):
    {b'code': b'info', b'level': 0, b'data': b'User <username> was authenticated by password not ticket.'}

I guess, that's because I have P4PASSWD variable exported and/or git-p4.password set.


> The following patch fixes the problem for me:
> 
> --- /usr/libexec/git-core/git-p4~        2018-12-15 14:51:07.000000000 +0100
> +++ /usr/libexec/git-core/git-p4      2019-01-06 23:23:06.934176387 +0100
> @@ -332,6 +332,8 @@
>               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))

This fixes the problem for me too.

> 
> Not sure if this helps, but running "p4 -G login -s | hexdump" gives:
> 
> 00000000  7b 73 04 00 00 00 63 6f  64 65 73 04 00 00 00 69  |{s....codes....i|
> 00000010  6e 66 6f 73 05 00 00 00  6c 65 76 65 6c 69 00 00  |nfos....leveli..|
> 00000020  00 00 73 04 00 00 00 64  61 74 61 73 35 00 00 00  |..s....datas5...|
> 00000030  27 6c 6f 67 69 6e 27 20  6e 6f 74 20 6e 65 63 65  |'login' not nece|
> 00000040  73 73 61 72 79 2c 20 6e  6f 20 70 61 73 73 77 6f  |ssary, no passwo|
> 00000050  72 64 20 73 65 74 20 66  6f 72 20 74 68 69 73 20  |rd set for this |
> 00000060  75 73 65 72 2e 30                                 |user.0|
> 00000066
> 
> Best regards,

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-06 22:48 "git p4" fails when perforce login not needed Peter Osterlund
2019-01-07 10:10 ` Luke Diamand
2019-01-07 23:56 ` Mazo, Andrey

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).