From: Pete Wyckoff <pw@padd.com>
To: David Aguilar <davvid@gmail.com>
Cc: Alexander Tomlinson <alex@aivor.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: is git-p4 compatible with p4/linux?
Date: Sat, 20 Apr 2013 09:22:33 -0400 [thread overview]
Message-ID: <20130420132233.GA2094@padd.com> (raw)
In-Reply-To: <CAJDDKr4gLWev=N-yMw3j0norzVxBp99ie_EYAbNcUvWcL-_70w@mail.gmail.com>
davvid@gmail.com wrote on Sat, 20 Apr 2013 03:50 -0700:
> On Thu, Apr 18, 2013 at 5:09 PM, Pete Wyckoff <pw@padd.com> wrote:
> >> 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 == "symlink":
> >> git_mode = "120000"
> >> # p4 print on a symlink contains "target\n"; remove the newline
> >> data = ''.join(contents)
> >> contents = [data[:-1]]
>
> This line could be made more robust by changing it to:
>
> contents = [data.rstrip('\n')]
>
> That way it only strips off newlines if they exist, which essentially
> papers over these rogue depot files.
> Alternatively, it could use rstrip() with no arguments to cast a wider
> net and catch all whitespace.
I was tempted to do that, but it is possible to put \n and other
space characters in the target of symlinks. It's unfortunate
that p4 always appears to tack on a newline itself.
We'll see if Alex comes up with a pattern that shows how he ended
up with the odd symlinks.
-- Pete
prev parent reply other threads:[~2013-04-20 13:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=20130420132233.GA2094@padd.com \
--to=pw@padd.com \
--cc=alex@aivor.com \
--cc=davvid@gmail.com \
--cc=git@vger.kernel.org \
/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.