git-annex-metadatagit-annexhttp://git-annex.branchable.com/git-annex-metadata/git-annexikiwiki2021-03-02T22:09:45Zadding metadata to keys that don't point to any contents is ok, correct?http://git-annex.branchable.com/git-annex-metadata/comment_1_45492400069021adbe048978be6957ef/Ilya S2018-09-08T22:36:06Z2018-09-08T22:36:06Z
<p>I want to store a simple mapping in git-annex on the git-annex branch, from string keys to values. I figured I can just do
git annex metadata --key=WORM-s0-m0--mykey -s myfield+=myvalue
and after git annex sync these mappings will propagate to copies of the repo. But the keys won't point to any file in any remote.
Will that break anything in git-annex? Will they get garbage-collected automatically in some circumstances?</p>
comment 2http://git-annex.branchable.com/git-annex-metadata/comment_2_12e615b99bf9999df0678cb6dc09d398/joey2018-09-11T16:49:51Z2018-09-11T16:33:15Z
<p>The only risk in doing this is that if you somehow later add a file that
actually uses that key it will have this metadata.</p>
<p>There's no garbage collection of metadata except for keys that have been
marked as dead with <code>git annex dead</code>.</p>
question about .gitattributeshttp://git-annex.branchable.com/git-annex-metadata/comment_3_6537bd785997501a9708682acd91f9f6/yarikoptic2019-05-03T15:21:41Z2019-05-03T15:21:41Z
<p>Joey, I feel like I have asked it before, but can't quickly search it up, so asking again (sorry if repeating). By</p>
<blockquote><p>To attach metadata to a particular path, rather than a particular key, use .gitattributes .</p></blockquote>
<p>you meant attaching some other metadata, not really "git-annex" metadata, right?
Or there is a way to specify metadata <code>key=value</code> pairs to be attached to annexed files, e.g. smth like</p>
<pre><code>*_scans.json annex.metadata=(distribution-restrictions=sensitive)
</code></pre>
<p>?</p>
comment 4http://git-annex.branchable.com/git-annex-metadata/comment_4_49c885bd5840aba9f9e011a1618931a1/joey2019-05-03T15:38:38Z2019-05-03T15:34:07Z
<p>I did not write that, Ilya did. I agree that it was confusing that it was
talking about some entirely different kind of metadata, and have reworded
it.</p>
comment 5http://git-annex.branchable.com/git-annex-metadata/comment_5_b4f928a4e8a81165e3845219483a9b25/Ilya_Shlyakhter2019-05-03T15:50:43Z2019-05-03T15:50:43Z
<p>I think I added that line to the docs, and yes, it's not for git-annex metadata. I'll clarify the page.</p>
<p>I'm not sure there is a well-defined way to set git-annex metadata via .gitattributes, given the different semantics of git-annex metadata (it's tied to timestamps, and is shared between all branches). Maybe one could define some unified-metadata, which interprets git-annex metadata on an annexed file as implicitly setting .gitattributes for that file in that directory.</p>
meanwhilehttp://git-annex.branchable.com/git-annex-metadata/comment_6_11b1fa357953736925cfbbc1079590dd/yarikoptic2020-06-17T01:18:32Z2019-09-20T18:53:03Z
<p>I am <a href="https://github.com/datalad/datalad/issues/3696">thinking about some abominations</a> to workaround inability to specify smth like</p>
<pre><code>licenses/* annex.commit.metadata=(distribution-restrictions=sensitive)
</code></pre>
<p>in <code>.gitattributes</code>. IMHO by limiting to <code>.commit</code> the scope when annex should add metadata becomes clear. Sure thing it could leak across files with the same content (0-length files are most prone) but it is unrelated IMHO since a direct call to <code>git annex metadata licenses/* -s ...</code> would have the same effect anyways.</p>
Get list of files with specific metadatahttp://git-annex.branchable.com/git-annex-metadata/comment_7_fe7d15a1a4cd729b6ffec26f49d8b47a/tobiasBora2020-06-17T01:18:32Z2019-09-23T13:16:11Z
<p>Hello,
I would like to know, is it possible to get in one command all files with a particular tag, or a list of tags (like "give all files that have tag foo or tag bar"). Note that I don't want to change the current view. Also, are you aware of any music player that could use these tags to find some songs to play and add them to some playlist?</p>
comment 8http://git-annex.branchable.com/git-annex-metadata/comment_8_54cff011e3e13882cfbd7a30fb43d078/joey2020-06-17T01:18:32Z2019-09-23T14:12:55Z
<p>See <a href="http://git-annex.branchable.com/git-annex-matching-options/">git-annex-matching-options</a> for ways to query for metadata.</p>
<p>For example:</p>
<pre><code>git annex find --metadata tag=foo --or --metadata tag=bar
</code></pre>
comment 9http://git-annex.branchable.com/git-annex-metadata/comment_9_a14b21109aa12eaf13e8c215e108cc29/tobiasBora2020-06-17T01:18:32Z2019-09-24T14:49:21Z
Ok thank you! If you also have names of music playes that can actually read tags from git annex, let me know!
comment 10http://git-annex.branchable.com/git-annex-metadata/comment_10_278fca1c579d0acdcce819449aec8eee/AlbertZeyer2021-03-02T22:09:45Z2021-01-03T22:07:02Z
<p>From this man page, it's not totally clear how/where the metadata is stored. Is it inside the Git repo (i.e. as regular file), or inside the Annex, or somewhere else? Is this information synced when you do <code>git push</code> (as part of Git), or via <code>git annex sync</code>?</p>
<p>How does it resolve any conflicts?</p>
<p>Is the metadata itself under version control? (If it is in Git itself, then clearly yes, but that's not clear to me.)</p>
comment 11http://git-annex.branchable.com/git-annex-metadata/comment_11_deee9a4c3a812c9c8097d89f2f6c7d76/joey2021-03-02T22:09:45Z2021-01-04T16:06:02Z
<p>@AlbertZeyer, this man page says it is "stored in the git-annex branch."</p>
<p>That branch is synced whenever you push it, which git-annex sync does do,
but git push can also be set up to do. The branch is automatically merged.</p>