Perforce Software p4ideax


Share your Idea

Use this form to quickly share you idea with us. Remember, please keep it constructive.

Don't have an account? Sign up.

Make the ignore feature work out the box

Posted almost 2 years ago by Golf Hotel
Idea Status: new

The p4ignore feature doesn't work out the box — you have to set an environment variable telling Perforce what filename rule lists will have. This makes it hard to share rules with other developers

It also means you can't hack on two projects with different names for the ignore lists.

Why not just work like Git, which takes rules from all files called `.gitignore`. Everyone can share rules just by committing them

http://stackoverflow.com/a/13126496/284795

6 Comments

Matt Attaway

Posted almost 2 years ago

Strangely enough the reason we make it configurable is to support .gitignore files. A request we had during the design was tobe able to support Git ignore files in Perforce as well.

Still, I agree that a sensible default would make a lot of sense. People could always override the value.

Flag as inappropriate

Golf Hotel

Posted almost 2 years ago

Hi Matt. That makes sense. Ok, so any solution mustn't break that popular use case.

What if? The convention for ignore files were specified by the *repository*, rather than the user. Then, the ignore files would work out the box for all contributors. And developers could happily hack on two repositories with different conventions.

But what about personal rules? They could go somewhere in the user's home folder, as with Git https://www.kernel.org/pub/software/scm/git/docs/gitignore.html

Flag as inappropriate

Golf Hotel

Posted almost 2 years ago

But that's a big change.

A simple choice of default for the existing behaviour would solve my woes. I hack on precisely one repository. I want the rules I share to work out the box.

Flag as inappropriate

David Ludwig

Posted 2 months ago

Perhaps add the ability to allow ignore files to take on multiple file names? That way, p4 could look at both .gitignore files, and whatever else a user wanted to use (such as .p4ignore, p4ignore.txt, .ignore, etc.). A server-side list of defaults could be provided too, which p4d server admins could adjust to their users' needs.

Flag as inappropriate

Hoverbird

Posted about 1 month ago

Right. There seem top be two issues being conflated here.

1) It would be nice if a team could take advantage of the ignore list without needing to set environment variables

2) It would be nice if a developer could have multiple, project specific ignore lists.

#2 doesn't really affect me, but #1 affects my whole team. We have a lot of non-technical folks and this adds a step to our machine setup process (and one that's different across Mac, PC and Linux)

Seems like you could have still met your design goal of interop with .gitignore files without neccesitating this extra step. What about: p4V checks for the P4IGNORE environment variable. If set, it will look for a file at this path. If it's not set, it will look for a file at a default path (seems sensible to make this the project root, with the file being named either p4ignore.txt or .p4ignore, makes no difference to me)

Does that make sense? A .gitignore file works similarly... you can match the convention and it "just works", or you can use an ENV var to configure the filepath the way you want.

BONUS: if the default location is a relative path (the project root), then by following the convention you've solved issue #2 as well, if I'm not mistaken.

Flag as inappropriate

Hoverbird

Posted about 1 month ago

Right. There seem top be two issues being conflated here.

1) It would be nice if a team could take advantage of the ignore list without needing to set environment variables

2) It would be nice if a developer could have multiple, project specific ignore lists.

#2 doesn't really affect me, but #1 affects my whole team. We have a lot of non-technical folks and this adds a step to our machine setup process (and one that's different across Mac, PC and Linux)

Seems like you could have still met your design goal of interop with .gitignore files without neccesitating this extra step. What about: p4V checks for the P4IGNORE environment variable. If set, it will look for a file at this path. If it's not set, it will look for a file at a default path (seems sensible to make this the project root, with the file being named either p4ignore.txt or .p4ignore, makes no difference to me)

Does that make sense? A .gitignore file works similarly... you can match the convention and it "just works", or you can use an ENV var to configure the filepath the way you want.

BONUS: if the default location is a relative path (the project root), then by following the convention you've solved issue #2 as well, if I'm not mistaken.

Flag as inappropriate