diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-07-25 13:51:03 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-07-25 13:51:03 -0400 |
commit | 4ee3e4194a716273f68641ba0312339ab7c70b8b (patch) | |
tree | dc8787232551a1c87d46a4c2f812aba27b6839b2 | |
parent | 96c1fb357cbf034b96d0f511599b2a68de72ad87 (diff) |
design
-rw-r--r-- | doc/todo/metadata_--batch/comment_4_c72eb16b630b200265e125ebaf7d0d36._comment | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/todo/metadata_--batch/comment_4_c72eb16b630b200265e125ebaf7d0d36._comment b/doc/todo/metadata_--batch/comment_4_c72eb16b630b200265e125ebaf7d0d36._comment new file mode 100644 index 000000000..4cd0f2d34 --- /dev/null +++ b/doc/todo/metadata_--batch/comment_4_c72eb16b630b200265e125ebaf7d0d36._comment @@ -0,0 +1,36 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 4""" + date="2016-07-25T17:39:37Z" + content=""" +--batch mode should be usable to get current metadata, set new +metadata, and remove existing metadata. The non-batch metadata command has +different syntaxes for all of these, but it would be good to have a single +interface that handles all three in batch mode. + +It could read a line containing the file or key, with any metadata +fields that should be changed: + + {"file":"foo"} + {"file":"foo","author":["bar"]} + {"key":"SHA...","author":[]} + +And reply with *all* the metadata, in nearly the same format: + + {"file":"foo","key":"SHA...","author":["bar"],lastchanged:["date"],"success":true} + +And that reply could in turn be edited and fed back in to change the +metadata. + +---- + +There's a DRY problem here because there's the current JSON generator code, +and I'd have to add an Aeson parser to parse the JSON input. But, Aeson +parsers also automatically have a matching generator, which is guaranteed +to generate code that the parser can parse. + +So, it would be nice to use the Aeson JSON generator, instead of the +current one, but that can only be done if the JSON is formatted the same, +or close enough that nothing currently consuming `metadata --json` will +break. +"""]] |