aboutsummaryrefslogtreecommitdiffhomepage
path: root/tag-util.c
Commit message (Collapse)AuthorAge
* cli: add missing \n in error messageGravatar Jani Nikula2014-03-06
| | | | The error messages returned by illegal_tag() don't contain newlines.
* cli: export function for illegal tag checkingGravatar Jani Nikula2014-03-06
| | | | | This lets us check for forbidden tags consistently across the cli. No functional changes.
* tag-util: do not reset list in parse_tag_command_lineGravatar Peter Wang2013-06-29
| | | | | | | The 'insert' command will be better served if parse_tag_command_line modifies a pre-populated list (of new.tags) instead of clobbering the list outright. The sole existing caller, notmuch_tag_command, is unaffected by this change.
* tag-util: move out 'tag' command-line checkGravatar Peter Wang2013-06-29
| | | | | | Move an error condition specific to the 'tag' command out of parse_tag_command_line so that parse_tag_command_line can be used for the forthcoming 'insert' command.
* cli: make caller check tag count in parse_tag_command_lineGravatar Jani Nikula2013-03-30
|
* notmuch-tag.c: convert to use tag-utilGravatar David Bremner2013-01-07
| | | | | | | | | Command line parsing is factored out into a function parse_tag_command_line in tag-util.c. There is some duplicated code eliminated in tag_query, and a bunch of translation from using the bare tag_op structs to using that tag-utils API.
* tag-util: factor out rules for illegal tags, use in parse_tag_lineGravatar David Bremner2013-01-06
| | | | | This will allow us to be consistent between batch tagging and command line tagging as far as what is an illegal tag.
* dump/restore: Use Xapian queries for batch-tag formatGravatar Austin Clements2013-01-06
| | | | | | | | | | | | | | This switches the new batch-tag format away from using a home-grown hex-encoding scheme for message IDs in the dump to simply using Xapian queries with Xapian quoting syntax. This has a variety of advantages beyond presenting a cleaner and more consistent interface. Foremost is that it will dramatically simplify the quoting for batch tagging, which shares the same input format. While the hex-encoding is no better or worse for the simple ID queries used by dump/restore, it becomes onerous for general-purpose queries used in batch tagging. It also better handles strange cases like "id:foo and bar", since this is no longer syntactically valid.
* parse_tag_line: use enum for return value.Gravatar David Bremner2012-12-26
| | | | | This is essentially cosmetic, since success=0 is promised by the comments in tag-utils.h.
* tag-utils: use the tag_opt_list_t as talloc context, if possible.Gravatar David Bremner2012-12-22
| | | | | | | | | The memory usage discipline of tag_op_list_t is never to free the internal array of tag operations before freeing the whole list, so it makes sense to take advantage of hierarchical de-allocation by talloc. By not relying on the context passed into tag_parse_line, we can allow tag_op_list_t structures to live longer than that context.
* tag-util: optimization of tag applicationGravatar David Bremner2012-12-09
| | | | | | | | | The idea is not to bother with restore operations if they don't change the set of tags. This is actually a relatively common case. In order to avoid fancy datastructures, this method is quadratic in the number of tags; at least on my mail database this doesn't seem to be a big problem.
* tag-util.[ch]: New files for common tagging routinesGravatar David Bremner2012-12-09
These are meant to be shared between notmuch-tag and notmuch-restore. The bulk of the routines implement a "tag operation list" abstract data type act as a structured representation of a set of tag operations (typically coming from a single tag command or line of input).