public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Pete Wyckoff <pw@padd•com>
To: Tor Arvid Lund <torarvid@gmail•com>
Cc: git@vger•kernel.org
Subject: Re: [PATCH 7/8] git-p4: decode p4 wildcard characters
Date: Tue, 8 Feb 2011 18:26:06 -0500	[thread overview]
Message-ID: <20110208232606.GA32491@arf.padd.com> (raw)
In-Reply-To: <AANLkTi=Gah9yeYYnHPZ2Z6-OZQ2-CU5Kub=o5SqWAXht@mail.gmail.com>

torarvid@gmail•com wrote on Tue, 08 Feb 2011 10:09 +0100:
> On Sat, Feb 5, 2011 at 11:52 PM, Pete Wyckoff <pw@padd•com> wrote:
> > +    # The p4 wildcards are not allowed in filenames.  It complains
> > +    # if you try to add them, but you can override with "-f", in
> > +    # which case it translates them into %xx encoding.  Search for
> > +    # and fix just these four characters.  Do % last so it does
> > +    # not inadvertantly create new %-escapes.
> > +    def wildcard_decode(self, path):
> > +        path = path.replace("%23", "#") \
> > +                   .replace("%2A", "*") \
> 
> This probably works fine on UNIX platforms, but the asterisk '*'
> character is not allowed in windows filenames. I don't really know
> what perforce does in that scenario. Does it make the most sense to
> just keep the %2A in the filename if we are running on windows (??)

I changed it to do the "*" translation if not self.isWindows, so
%2A will remain in the filename.  Good that you noticed it.

Just for giggles, I found a windows VM to test perforce on.
Built two files with different wildcards on a unix box, then
pointed a windows client at it:

C:\DOCUME~1\ADMINI~1\DESKTOP>set P4PORT=192.168.2.1:1666

C:\DOCUME~1\ADMINI~1\DESKTOP>p4 files //depot/...
//depot/file%25percent#1 - add change 1 (binary)
//depot/file%2Astar#1 - add change 1 (binary)

C:\DOCUME~1\ADMINI~1\DESKTOP>p4 client
Client soulfree saved.

C:\DOCUME~1\ADMINI~1\DESKTOP>p4 sync
//depot/file%25percent#1 - added as c:\Documents and Settings\Administrator\Desktop\file%percent
//depot/file%2Astar#1 - added as c:\Documents and Settings\Administrator\Desktop\file*star
open for write: c:\Documents and Settings\Administrator\Desktop\file*star: The filename, directory name, or volume label syntax is incorrect.

And only the one file was synced to the windows client.  So "*" is not
well handled in perforce on windows anyway.

Docs are not helpful:

http://www.perforce.com/perforce/doc.current/manuals/cmdref/o.fspecs.html#1041962

For git, leaving a %2A in a filename is better than an error, I believe.

Thanks for the other acks.

		-- Pete

  reply	other threads:[~2011-02-08 23:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-05 22:48 [PATCH 0/8] git-p4 fixes and enhancements Pete Wyckoff
2011-02-05 22:51 ` [PATCH 1/8] git-p4: test script Pete Wyckoff
2011-02-06 18:00   ` Vitor Antunes
2011-02-07  2:22   ` Junio C Hamano
2011-02-07 22:26     ` Pete Wyckoff
2011-02-05 22:51 ` [PATCH 2/8] git-p4: fix key error for p4 problem Pete Wyckoff
2011-02-05 22:51 ` [PATCH 3/8] git-p4: add missing newline in initial import message Pete Wyckoff
2011-02-08  8:48   ` Tor Arvid Lund
2011-02-05 22:52 ` [PATCH 4/8] git-p4: accommodate new move/delete type in p4 Pete Wyckoff
2011-02-08  8:52   ` Tor Arvid Lund
2011-02-05 22:52 ` [PATCH 5/8] git-p4: reinterpret confusing p4 message Pete Wyckoff
2011-02-05 22:52 ` [PATCH 6/8] git-p4: better message for "git-p4 sync" when not cloned Pete Wyckoff
2011-02-08  8:55   ` Tor Arvid Lund
2011-02-05 22:52 ` [PATCH 7/8] git-p4: decode p4 wildcard characters Pete Wyckoff
2011-02-08  9:09   ` Tor Arvid Lund
2011-02-08 23:26     ` Pete Wyckoff [this message]
2011-02-05 22:52 ` [PATCH 8/8] git-p4: support clone --bare Pete Wyckoff
2011-02-08  9:18   ` Tor Arvid Lund

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=20110208232606.GA32491@arf.padd.com \
    --to=pw@padd$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=torarvid@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox