git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* is git-p4 compatible with p4/linux?
@ 2013-04-17  4:31 Alexander Tomlinson
  2013-04-17  4:37 ` Alexander Tomlinson
  2013-04-19  0:09 ` Pete Wyckoff
  0 siblings, 2 replies; 8+ messages in thread
From: Alexander Tomlinson @ 2013-04-17  4:31 UTC (permalink / raw)
  To: git@vger.kernel.org

git-p4.py (1.8.2.1.418.gaec3f77) has at least two behaviors that
seem to be incompatible with the version of p4 that I recently
downloaded from perforce.com (P4/LINUX26X86_64/2013.1/610569).

TLDR: Is git-p4 written for an old version of p4 CLI with different
behavior?  Or for a windows or mac release of p4?  Or am I missing
something?

First issue
-----------

git-p4 assumes the output of 'p4 print' adds a newline to the
target.  To work around this, git-p4.py strips the last char from
symlinks as shown in the following snippet:

    if type_base =3D=3D "symlink":
        git_mode =3D "120000"
        # p4 print on a symlink contains "target\n"; remove the newline
        data =3D ''.join(contents)
        contents =3D [data[:-1]]

But my 'p4 print' does not output the newline:

    $ ls -l pcre
    lrwxrwxrwx 1 user group 12 Apr 16 10:27 pcre -> ../libs/pcre

    $ p4 print -q pcre | od -t x1a
    0000000  2e  2e  2f  6c  69  62  73  2f  70  63  72  65
             .   .   /   l   i   b   s   /   p   c   r   e
    0000014

If I use 'git p4 clone' the above file shows up in git as a
symlink to '../libs/pcr'.  I had another symlink whose target had
a strlen of 1 and the 'git p4 clone' failed b/c after stripping
the last char the result was an empty string.

Second issue
------------

git-p4 uses 'p4 print -q -o o FILE' to print a file to stdout.
At least that is how I interpret this snippet:

    text = p4_read_pipe(['print', '-q', '-o', '-', file['depotFile']])

However, p4/Linux prints to stdout by default and '-o -' will save
the output in a file named '-'.

My git and p4 versions:

    $ git --version
    git version 1.8.2.1.418.gaec3f77

    $ p4 -V
    Perforce - The Fast Software Configuration Management System.
    Copyright 1995-2013 Perforce Software.  All rights reserved.
    This product includes software developed by the OpenSSL Project
    for use in the OpenSSL Toolkit (http://www.openssl.org/)
    See 'p4 help legal' for full OpenSSL license information
    Version of OpenSSL Libraries: OpenSSL 1.0.1c 10 May 2012
    Rev. P4/LINUX26X86_64/2013.1/610569 (2013/03/19).

--Alex

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

end of thread, other threads:[~2013-04-20 13:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-17  4:31 is git-p4 compatible with p4/linux? Alexander Tomlinson
2013-04-17  4:37 ` Alexander Tomlinson
2013-04-19  0:09 ` Pete Wyckoff
2013-04-19  1:34   ` Alexander Tomlinson
2013-04-19 11:55     ` Pete Wyckoff
2013-04-19 15:20       ` Alex Tomlinson
2013-04-20 10:50   ` David Aguilar
2013-04-20 13:22     ` Pete Wyckoff

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 NNTP newsgroup(s).