merge a tag with a value of another tag
First of all, TMSU is a great and efficient tool that conforms with the Unix philosophy: It does one thing - tagging files under a semantic file system using symlinks - and does it very well! And the program itself is written in Go - a very young language co-created by Ken Thompson, the father of Unix philosophy, as a response to his own dismay with C++.
TMSU is a project still under development. Of course it has shortcomings (for example the directories are not tracked actively and repair does not work very well) but current TMSU tools - especially when combined with other Unix tools, such as ls, find, xargs, sed, head, tail, etc - help overcome those shortcomings (for example doing file rename, move and delete operations with tmsu-fs-mv and tmsu-fs-rm).
The "tmsu merge" tool is very useful for combining a tag with another. However, as far as I see, the merge does not work with a tag as the first argument and the value of another tag as the second argument since TMSU sees the "tag=value" pair as an undefined tag.
Anyway, TMSU is the solution I was looking for in order to arrange my e-books library. Thanks Paul!
Serhat
Hi,
Thanks for the kind words.
With regards to merging, yeah you can't merge a tag with a tag=value pair right now. I was just thinking the other day how handy it would be to have the following syntax:
tmsu tag --where="tagA and tagB" blah
Which would let you apply tags (and values) to files matching the predicate. As a follow on, the 'merge' subcommand would be pretty much redundant then as you could almost as easily run:
tmsu tag --where=tagA tagB
tmsu delete tagA
And you would also be able to do what you would like to do:
tmsu tag --where=tagA tagB=valueA
tmsu delete tagA
So it's a lot more flexible, but perhaps less intuitive.
Let me know what you think
Thanks Paul
On 25 Nov 2016 23:36, "Serhat Cevikel" [email protected] wrote:
First of all, TMSU is a great and efficient tool that conforms with the Unix philosophy: It does one thing - tagging files under a semantic file system using symlinks - and does it very well! And the program itself is written in Go - a very young language co-created by Ken Thompson, the father of Unix philosophy, as a response to his own dismay with C++.
TMSU is a project still under development. Of course it has shortcomings (for example the directories are not tracked actively and repair does not work very well) but current TMSU tools - especially when combined with other Unix tools, such as ls, find, xargs, sed, head, tail, etc - help overcome those shortcomings (for example doing file rename, move and delete operations with tmsu-fs-mv and tmsu-fs-rm).
The "tmsu merge" tool is very useful for combining a tag with another. However, as far as I see, the merge does not work with a tag as the first argument and the value of another tag as the second argument since TMSU sees the "tag=value" pair as an undefined tag.
Anyway, TMSU is the solution I was looking for in order to arrange my e-books library. Thanks Paul!
Serhat
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/oniony/TMSU/issues/100, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAXB0rVhXtpd5HCpJr10X4LAJthLnvaks5rB3EKgaJpZM4K8wcl .
That would be a good solution. However:
-
It is better that we have a generalized solution including the case in which both tagA and tagB have values - so they are both pairs. And currently, the delete only applies to tags not tag=value pairs - correct me if I'm wrong.
-
"merge" would not be redundant, since it halves the line count from 2 to 1 :). But it may be simply written as a shell script as "tmsu-merge" or "tmsu-tag-merge" under "TMSU/misc/bin/" directory just like tmsu-fs-merge, mv or rm.
Thanks for your immediate response.
Serhat
I've implemented the --where idea. This will give you kludge solution for now (and, more importantly, is genuinely useful in, and of, itself).
I'll next look to expand merge to do this more elegantly..