The content of this blog is my personal opinion only. Although I am an employee - currently of Nvidia, in the past of other companies such as Iagination Technologies, MIPS, Intellectual Ventures, Intel, AMD, Motorola, and Gould - I reveal this only so that the reader may account for any possible bias I may have towards my employer's products. The statements I make here in no way represent my employer's position, nor am I authorized to speak on behalf of my employer. In fact, this posting may not even represent my personal opinion, since occasionally I play devil's advocate.

See http://docs.google.com/View?id=dcxddbtr_23cg5thdfj for photo credits.

Saturday, September 10, 2016

Perforce: "Git ignore syntax is fully supported" - NOT :-(

---+ BRIEF

Posting in the hope of saving somebody else the trouble of figuring out that Perforce does not support full wildcards in P4IGNORE, even though they say "Git ignore syntax is fully supported".

Mildly annoyed.

But also amused: to work around Perforce's limitations, I did
heck!: echo {a,b,c,d,....}{a,b,c,d,...} >> .p4ignore Had to shrink to fit tweet. wc .p4ignore now 1418 lines. Had to shrink to fit tweet.
Combinatoric explosion is so much fun.  Should I go for three characters ???


I hate it when ... somebody, whether the help file, SW developer blog, or ads ... say that "something is fully supported", when it is not.

I was very excited to see that Perforce might support .gitignore-comparable wildcards.  I wasted any hour proving that, while P4V 2015.2 does support some .gitignore wildcards, it does not support all, specifically not the ? single character wildcard, or patterns such as ?? for 2 character filenames, etc.
@p4sven I won't bother you any more. Only did because you said "Git ignore syntax is fully supported". Wrong! ? wildcards are not 
P4IGNORE: Ignorance is Bliss | Perforce: "Git ignore syntax is fully supported"
'via Blog this'
It is okay to say "Perforce supports some or most .gitignore syntax, to the point where you can share .gitignore files with projects using git, and still use Perforce if you want to." - this is fine - honest,  and valuable even if not complete.

Even better if you can say what you do not support. So I don't waste time figuring out what isn't properly supported.

But to say that you have full support when you do not WASTES MY TIME.

Worse, git  is Open Source, it probably has test suites for .gitignore that Perforce could have looked at.  (Hmm, could that be a license violation? Don't use the code, just extract some test patterns...)

Worse comes to worst, some random file patterns could have been run on both p4 and git.


Why ? ??

I have a habit of creating files with single character filenames when doing emacs text wizardry to create lists of files to work on (ironically, to work around Perforce limitations).

E.g. filenames like "a", "b".  Also "a1", "a2".

Aside: Yeah, I have been bitten by "cc" and other two letter executables, back when I was doing OS releases for Gould and Motorola:
$ bash 1405 $>  ls /bin/??
/bin/cp* /bin/dd* /bin/df* /bin/ed* /bin/ln*
/bin/ls* /bin/mv* /bin/ps* /bin/rm* /bin/sh*
Why not "tmp*"?  Well, I use that too - but ? and ?? are shorter and easier to type.


See also http://stackoverflow.com/questions/18240084/how-does-perforce-ignore-file-syntax-differ-from-gitignore-syntax