What's your method for resolving resource.json git conflicts?

To come back to the original question:

What’s your method for resolving resource.json git conflicts?

With the tool @PGriffith created we now use the following workflow with git hookscripts (hopefully temporary):

  • Add */resource.json to gitignore
    • This is what we have been waiting for all the time :slight_smile:
  • pre-commit: pack all resource files in the repository into one big json file. Drop all autogenerated content (signature), add original path information.
    • This way you keep the important metadata and even the last change information (if needed) in your repository. You only have one file that changes and only if you willingly apply changes to project resources.
  • post-commit, post-checkout, post-merge: Unpack the packed resource json into the original, individual files. Run the helper tool to generate new valid signatures using the metadata which is stored in the packed json file.
    • This ensures you always have a consistent repository after checking out a new branch and even directly after cloning a new repository.
    • You can slightly modify the rust tool to take your original timestamp and user as parameters if you want to keep this information.

Optional but useful: ensure that git hook scripts are always executed on all systems you are using!

  • configure the system wide git setting to use a different hook script path (a path in your repository)
  • place the hook scripts in this path in your repository
    • Now if you clone a remote repository which contains the hook scripts, the resource files are automatically unpacked and your project is ready directly after the clone.

Quite an effort only to avoid autogenerated content in the repository, but so far this works just fine. Maybe this helps someone to create his own personalized workaround.

6 Likes