Subject: Re: is git-p4 compatible with p4/linux?

From: Pete Wyckoff <[email-masked]>
Date: Fri, 19 Apr 2013 07:55:13 -0400

[email-masked] wrote on Thu, 18 Apr 2013 20:34 -0500:
> Perhaps it is a configuration item on the server and/or client.   It seems we
> are running the same version of p4.  But just to be sure, check yours against
> mine:
> 
> $ cksum $(which p4)
> 3254530484 2420552 /usr/bin/p4
> 
> If yours if different, can you email a copy of your p4 executable to me
> so I can check if it works differently than mine?

It is the same binary.  Assuming you're running p4d 2013.1 too?

    $ p4 info
    [..]
    Server version: P4D/LINUX26X86_64/2013.1/610569 (2013/03/19)

I'm using these p4 client settings:

    Options:        noallwrite noclobber nocompress unlocked nomodtime normdir
    SubmitOptions:  submitunchanged
    LineEnd:        unix

Running "strace -vf -s 2000 p4 print -q symlink" shows that the
newline is embedded in the response from p4d:

    read(7, "...\0\0\0symlink-target\n\0func\0\23...", 4096) = 277

Also the file depot/symlink,v in the p4d depot area includes the
\n in the RCS file too, somewhat surprisingly:

    $ cat depot/symlink,v
    head     1.6;
    [..]
    @@
    text
    @symlink-target
    @

> I will also check with coworkers here to see how their client behaves.
> > This code only happens on utf16 files.  But running it by hand,
> > I cannot reproduce the different behavior:
> > 
> >    $ p4 print -q //depot/f-ascii
> >    three
> >    line
> >    text
> > 
> >    $ p4 print -o - -q //depot/f-ascii
> >    three
> >    line
> > 
> >    $ ls ./-
> >    ls: cannot access ./-: No such file or directory
> > 
> > I'm again confused.  Any hints you can give would be helpful.
> 
> This "second issue" is a non-issue.  It seems "-o -" does send to
> stdout for files.  For symlinks, it creates a symlink named "-".
> Example:
> 
> $ ls -l pcre
> lrwxrwxrwx 1 atomlinson atomlinson 12 Apr 18 17:17 pcre -> ../libs/pcre/
> $ ls -l ./- ./xxx
> /bin/ls: cannot access ./-: No such file or directory
> /bin/ls: cannot access ./xxx: No such file or directory
> $ p4 print -q -o - pcre
> $ p4 print -q -o xxx pcre
> $ ls -l ./- ./xxx
> lrwxrwxrwx 1 atomlinson atomlinson 12 Apr 18 20:25 ./- -> ../libs/pcre/
> lrwxrwxrwx 1 atomlinson atomlinson 12 Apr 18 20:25 ./xxx -> ../libs/pcre/

Me too.  That's annoying behavior, but not used by git-p4 fortunately.
The "-o -" option is only used for odd utf16 files where "p4 print"
generates invalid output.

		-- Pete