Jump to content


Is it possible to "soft ignore" files in a workspace?


  • Please log in to reply
2 replies to this topic

#1 adams_s

adams_s

    Member

  • Members
  • PipPip
  • 20 posts

Posted 07 September 2020 - 02:57 PM

We have a project that has a bunch of large files that most developers don't work with - our regular dev stream excludes these files. Occasionally, a developer will want to sync, and possibly edit those files though - they create a workspace that points to a stream that doesn't exclude the large files. Simple enough, though at the expense of having two workspaces instead of one.

We were wondering if it's at all possible to do a kind of "soft" exclude on a file type or path so it doesn't get synced by default, but can still be fetched explicitly. In this way our devs can work in a single workspace that's synced normally, but avoid pulling ginormous assets unless wanted. I imagine this kind of use case would also be useful if you're working over a low-bandwidth connection and you want to sync only some file types in a stream, but still have the option to pull others.

#2 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 1191 posts

Posted 07 September 2020 - 03:34 PM

If you're using streams, you can do this within a single workspace fairly easily -- do most of your work in a filtered virtual stream, and switch to the parent when you want a wider view, being careful which files you sync while you're in the parent (use "p4 client -s -S stream" to switch instead of "p4 switch stream" to avoid auto-syncing everything).

Another possibility for a "soft exclude" would be to "p4 flush" ("p4 sync -k") the files you want to exclude, so that a "p4 sync -f" is required to fetch them.  I'm not sure if this is one that I'd actually recommend using in practice because any time you're deliberately putting the workspace into an inconsistent state the odds of confusing yourself are high -- I'd much rather deal with accidentally syncing files and having to Ctrl-C them than having things break more quietly because I didn't have the files synced that I thought I did.

#3 adams_s

adams_s

    Member

  • Members
  • PipPip
  • 20 posts

Posted 10 September 2020 - 10:33 AM

Thanks @Sambwise that did it for us. We made a "chunky" virt stream with everything in it, and then inherited a lean stream version from that which filtered out the bloat by folder, and people can switch between the two fast and and easily, using various Perforce clients. It doesn't seem to work on file type/extension as these presumably can't be added to a stream view (only an ignore list which doesn't help block syncing), but we can live with this.

p4 flush sounds a bit too complex, this work flow is intended for non-technical people mostly, so we want to keep command lining to a minimum.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users