5

I ask myself this every time I replace a Photoshop .psd file that I have under version control.

You can see with ls -l that PS has created a thumbnail icon in the resource fork.

1
  • updated my answer after your comment, removing obsolete information.
    – VonC
    Jul 16, 2009 at 5:51

2 Answers 2

5

Git will not track metadata, as those resources are not part of the content of the file (so your answer is "no").

In his "Cross-Platform Version Control" entry, Jakub Narębski comments:

The issue of extra metadata that is not SCM-sane, and which different filesystems can or cannot store.
Examples include full Unix permissions, Unix ownership (and groups file belongs to), other permission-related metadata such as ACL, extra resources tied to file such as EA (extended attributes) for some Linux filesystems or (in)famous resource form in MacOS (resource fork on MacOS vs. xattrs on Linux: issue 5 in Eric Sink article).

This is not an issue for SCM: source code management system to solve.
Preserving extra metadata indiscrimitedly can cause problems, like e.g. full permissions and ownership.
Therefore SCM preserve only limited SCM-sane subset of metadata.
If you need to preserve extra metadata, you can use (in good SCMs) hooks for that, like e.g. etckeeper uses metastore (in Git).


Thomas Tempelmann notes in the comments:

Actually, since macOS 10.12, textClippings store the info also in the data fork, in plist format, with the same keys and values of the resource fork's contents.

The only thing that won't work is QuickLook if the rsrc is missing, but opening these files will show the content.
Therefore, storing .textClipping files in Git is not hopeless.

6
  • That 2nd bullet point is about 15years out of date, these days PS only puts pointless stuff you don't want in the RF. Your "no" is correct, but the previous part seems to contradict that. Jul 15, 2009 at 21:56
  • 1
    "Adobe Photoshop 3.0.4 Software Development Kit, Copyright 1991- 1995 , Adobe Systems": @Rhythmic Fistman: good point. I will remove the first part (now obsolete) of my answer.
    – VonC
    Jul 16, 2009 at 5:46
  • Technically, a resource fork is file data, as a second (parallel) stream. Resource forks are not necessarily metadata, either. For instance, ".textClipping" files are solely storing their information in the resource fork, while the data fork remains empty, and the content is certainly not metadata. Jan 17, 2022 at 16:04
  • 1
    @ThomasTempelmann Good points (12 years later), thank you. Maybe this is why there was a PR proposed to ignore .textClipping in macOS.gitignore (github.com/github/gitignore/pull/3550)
    – VonC
    Jan 17, 2022 at 16:10
  • 1
    @ThomasTempelmann Interesting. I have included your comment in the answer for more visibility.
    – VonC
    Jan 18, 2022 at 7:16
2

Short answer is no.

On the mac, by default, git does not track resource forks, or xattrs or finder info.

git will "slice" your resource forks right off, which is exactly what I wanted.

Other tools, like cp and rsync have been patched on the mac to preserve
this metadata, which at times is convenient and at other times annoying.

git is not yet annoying. Or convenient, depending on your POV.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.