taskwarrior icon indicating copy to clipboard operation
taskwarrior copied to clipboard

[TW-1882] Attempt to add tag instead modifies description

Open taskwarrior opened this issue 7 years ago • 10 comments

John Florian on 2017-01-03T14:27:52Z says:

I wanted to add the tag run-iso to a task, so I did: task 118 modif +run-iso

However that changed the description as can be seen in the undo I needed:

The last modification was made 1/3/2017

             Prior Values                                                            Current Values                      
description  Add a CPU speed governor CLI option that employs the cpulimit package.  +run-iso                            
entry        20160422                                                                20160422
modified     20160422                                                                20170103                            
project      builder                                                                 builder
status       pending                                                                 pending
tags         feature                                                                 feature
uuid         13d9b37b-53e8-4644-95cb-2bd906d353c2                                    13d9b37b-53e8-4644-95cb-2bd906d353c2

The undo command is not reversible.  Are you sure you want to revert to the previous state? (yes/no) yes
Modified task reverted.

Later, I tried task 118 modif +foo to confirm my general syntax and that worked as expected. As a work around, I wound up using task 118 edit.

Also tried and failed was task 118 modif +'run-iso'.

taskwarrior avatar Feb 14 '18 20:02 taskwarrior

Migrated metadata:

Created: 2017-01-03T14:27:52Z
Modified: 2017-01-08T20:50:19Z

taskwarrior avatar Feb 14 '18 20:02 taskwarrior

Eric Hymowitz on 2017-01-03T17:34:40Z says:

https://taskwarrior.org/docs/examples.html

"Tags are simply one-word alpha-numeric labels"

Punctuation is not allowed.

taskwarrior avatar Feb 14 '18 20:02 taskwarrior

Paul Beckingham on 2017-01-07T14:51:30Z says:

Hi John, Eric is right. The '-' in the tag looks like a mathematical operator, and the tags attribute is being evaluated for algebraic expressions. This shouldn't happen, it is not useful to derive a tag from an expression, so this feature will be removed at some point.

I'm refactoring the attribute processing now, at glacial speed, so at some point we'll have attribute-specific processing to do the right thing in each case.

Workaround: Use an alternate character like 'run_iso' for now.

taskwarrior avatar Feb 14 '18 20:02 taskwarrior

John Florian on 2017-01-08T16:36:08Z says:

I think the docs Eric referenced could be more explicit on this requirement, but overall I believe this must change. In task I'm tracking numerous software packages I maintain and use the package name for the task project. Most of these packages provide numerous executables and I wish to use their name as the task tag so that I can quickly see just those parts of project relevant to one executable. For now I limp along by setting these with task edit and all other aspects seem to cope.

FWIW, I previously accomplished this by dotting the project into sub-projects, but that can make overly long project names in the reports. I have some reports without the tag column so this new approach definitely can help keep things more compact. Plus it enables me to associate multiple executables for a single task, something I sometimes need to do.

Anyway, that's my use case. And ... I fully comprehend the difficulty in making a parser cope with all possible scenarios. What if math operators required a space around them? Seems like that would help immensely in decoding the intention.

taskwarrior avatar Feb 14 '18 20:02 taskwarrior

Paul Beckingham on 2017-01-08T20:50:01Z says:

I think the best solution here is that math is not necessary for manipulating tags, and will be shut off. Tags will also be defined more precisely as not containing spaces. Instead of:

<alpha> <alpha-numeric>

It will probably be:

<alpha> <non-whitespace>

Expect this in 2.6.0. The spaces around operators is not a bad idea, for non-tag attributes that is. I'm thinking over a couple of other solutions too. Thanks!

taskwarrior avatar Feb 14 '18 20:02 taskwarrior

Has any work been done on this? I ran into it today when trying to use tickets as tags

austb avatar Oct 12 '18 16:10 austb

I have recently started using bugwarrior and this inserts the name of the gitlab project from which issues are imported as a tag. Most of my projects have hyphens in them and to match this I wanted to convert the tags in my existing tasks for these projects to the imported style by doing

task +myproject modify -myproject +my-project

But this tried to replace the description of all tasks with +my-project.

In short, is this bug still on the radar?

kreetrapper avatar Feb 15 '19 15:02 kreetrapper

Same here

I was trying to tag task with issue numbers. The format is as follows:

task n modify +PER-543 It just changes n task's description to 'PER-543'

Same as the above, is this bug still being looked at?

Pastitas avatar Jun 18 '19 15:06 Pastitas

Reproduced on 2.6.0.

tbabej avatar Jan 31 '21 10:01 tbabej

Sadly this is still an issue on 2.6.1 Just as @Pastitas I'd like to use issue numbers as tags. Single or double quotes do not prevent the current behavior.

Turil avatar Jun 26 '23 09:06 Turil