Share, Vote, & Discuss Ideas

We're constantly looking for new ways to improve our products and are asking you to help us by sharing your own ideas, voting for ideas you like, and discussing them with the rest of the community.

Make p4ignore syntax match gitignore syntax.

(copied from my forum post here: http://forums.perforce.com/index.php?/topic/2881-are-there-any-plans-to-improve-gitignore-file-support/)

I'm pleased to see Perforce honoring gitignore files because we have many cases of generated files living in the same directory as hand-edited files. However, we've been burned by the lack of features in Perforce's parsing of .gitignore (or .p4ignore) files.

The full list of differences that I am aware of:

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

The biggest problem case for us is like so:

Suppose you have two files "toolbox/foo/bar.h" and "toolbox/foo/private/bar.h". The higher file is generated by stripping private information out of the copy in the "private" folder.

  toolbox/foo/bar.h <- derived
  toolbox/foo/private/bar.h <- hand-edited

In git, we can add "toolbox/foo/.gitignore" containing:

    # generated from private/bar.h
    /bar.h

In Perforce, we need to add two files:

toolbox/foo/.gitignore
    # generated from private/bar.h
    bar.h

and

toolbox/foo/private/.gitignore
    # not generated
    !bar.h

This gets really annoying when trying to ignore a file with a common name near the top of your working tree. For example, if you have a generated "Makefile" at the top of your tree and the rest of your Makefile's are hand-edited.

Thanks,
Ben Martin

 

 

  • Guest
  • Aug 17 2015