0

I have bumped into an extreme edge case. I need to have an Ableton project in our perforce, and Ableton does not have any kind of source control integration. For the project to function correctly, we need to have all of the raw samples in the perforce as well. These raw samples will not change, they will only ever be added or deleted.

Having to check out everything by hand to make sure it works properly will be a major problem since the amount of files will quickly grow. Because of this we would like to just check out the entire project and then submit the entire project (yes, besides reconcile offline work this is the best way we could think of). The problem is that this creates new revisions for the raw samples when there are no changes made to them.

Is it possible to set up the p4ignore file in such a way that it lets people add and delete these raw samples, but not change them.

As a bonus, but I highly doubt this is possible, is there a way to kind of reconcile offline work in real-time? I know that using reconcile offline work will minimize the amount of needless revisions, but it could cause some problems in terms of people forgetting to communicate and accidentally overwriting etc... so is there a way to kind of run the reconcile offline work command at regular intervals so that files get checked out as they are changed?

I have already asked our teachers and they told us to use Reconcile offline work, and to communicate with the team who needs the files that day. This is by far the best solution. This does leave room for error in a way that I think I should be able to circumvent with some clever programming / setup.

2 Answers2

0

That's awesome you're using Ableton with Perforce. I've been interested in applications within music production, which usually doesn't have any version control.

Here are a few things to look at: Instead of trying to use an ignore file for your changes, I would recommend looking at the advanced tab of your workspace settings. There is a setting called On submit, which you can change from the default of "submit all selected files" to "Revert Unchanged Files." With that checked, it will compare all the submitted files and only create new revisions for ones that have actually changed. The only downside is that it can be a bit slow if you have a lot of files checked out because it is calculating md5 hashes for all the files to compare to what is on the server.

I agree with your teacher that using reconcile is probably a better workflow than checking out everything and then submitting it. Mostly because that means the server will more accurately know what files you are working on (and it will be faster, especially if you have the "Modtime" setting checked on your workspace). To run it regularly, there are a couple options to consider. One option is to work how you are currently and just write a super short script that runs the reconcile command. On Windows this could be a Powershell script or on Mac it would be a Bash script that just has a single line that says:

p4 -c <workspace_name> reconcile -ad <path/to/workspace/root>/...

Where you replace <workspace_name> with your workspace and the <path...> with the location of your workspace. The -ad flag tells reconcile to only look for Add and Delete operations. You can also remove that part if you want it to check for edits as well. (Docs on p4 reconcile: https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_reconcile.html )

Then in Windows Task Scheduler, you can set it up to run that script at a regular interval (however often you want). On Mac you would schedule it with the Automator app, which comes with MacOS.

But a potentially better option to look at is Helix Sync: https://www.perforce.com/products/helix-core-apps/helix-sync

In your case, basically, you could create a workspace like normal but set the workspace to "AllWrite" so the files aren't set to read-only. Then you run Helix Sync, login to your server, and the workspace should be selectable as long as it is AllWrite. Then Helix Sync will automatically monitor that folder and allows you to submit directly from there.

Hope that helps!

Jase
  • 76
  • 5
0

Perforce's workspaces are mostly configured via the client spec (using the p4 client command or the P4V equivalent); the P4IGNORE file is very specifically to configure the p4 add command and does not affect how edits or submits work.

To avoid submitting unchanged files, you probably want the leaveunchanged or revertunchanged option in your client spec (see p4 help client):

        SubmitOptions:  Flags to change submit behavior.

                submitunchanged     All open files are submitted (default).

                revertunchanged     Files that have content, type, or resolved
                                    changes are submitted. Unchanged files are
                                    reverted.

                leaveunchanged      Files that have content, type, or resolved
                                    changes are submitted. Unchanged files are
                                    moved to the default changelist.

                        +reopen     Can be appended to the submit option flag
                                    to cause submitted files to be reopened in
                                    the default changelist.
                                    Example: submitunchanged+reopen

I would tend to agree with your teacher that if you're not going to use the normal workflow of using p4 edit when needed, using p4 reconcile at regular intervals is a better strategy than opening everything for edit up front, since p4 reconcile will handle added/deleted files automatically.

Samwise
  • 68,105
  • 3
  • 30
  • 44