Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propose alternate entry format optionally allowing descriptions ignor… #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

codingforfun
Copy link

Proposed solution for #91

I added some small changes to entry parsing for grouping to enable additional descriptions, that are ignored for grouping.
The change is backwards compatible with existing time log entries.
The additional format uses @ to split task and category and changes the meaning of : in the presence of a previous @ to split the general description from task and category.

Format:

task@category: some textual description -- tagA tagB

Example:

#1234@projectFoo: try to find that stupid bug XXX was talking about that day -- bug search
#1234@projectFoo: having a call about how to proceed to solve the problem -- call

Copy link
Member

@mgedmin mgedmin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still need to be convinced that this is necessary.

And I definitely would require unit tests and documentation updates before I would consider merging it.

self.notify('timelog')
self.tick(True)

def check_reload_tasks(self):
if self.tasks.check_reload():
if self.tasks and self.tasks.check_reload():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just seen this change in the other PR, haven't I?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. My mistake. I think I just forgot to go back to master before starting the new branch.

# if category string can be further partitioned into non empty strings by '@'
# use 1st as task and 2nd as category
cat, task = c, t
return cat, task
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given #181 you'll probably want to add a few .strip()s here and thee.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably Yes. I wasn’t sure if you accept #181.

@@ -283,6 +289,9 @@ def grouped_entries(self, skip_first=True):
work = {}
slack = {}
for start, stop, duration, tags, entry in self.all_entries():
cat, task = self.split_category(entry)
entry = task or ''
entry = cat and cat + ': ' + entry or entry
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think task is guaranteed to be a string, so the or '' shouldn't do anything.

I would prefer the ternary if expression instead of the x and a or b hack.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Task may also be None. See split_category()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer the ternary if expression instead of the x and a or b hack

If you prefer, I can change this. Just want to point out that x and a or b is not a hack but perfect valid and actually nice python syntax ;-)

@codingforfun
Copy link
Author

And I definitely would require unit tests and documentation updates before I would consider merging it.

Only fair. But currently this is just a proposal. To invest more time to make it nice and beauty I would like to have some tendency from you. I would regret using my weekend just to get this rejected based on general arguments against this.

@codingforfun
Copy link
Author

I still need to be convinced that this is necessary.

It’s natural and beautiful to write:
179@gtimelog: Argue with Marius Gedminas on GitHub -- convincing people

vs

gtimelog: Argue with Marius Gedminas on GitHub (179) -- convincing people

@codingforfun codingforfun force-pushed the alternate_format_w_descriptions branch from 2b051b1 to ee6f46f Compare May 1, 2020 18:46
@codingforfun
Copy link
Author

Rebased onto master, changed condition syntax

@mgedmin
Copy link
Member

mgedmin commented May 2, 2020

It’s natural and beautiful to write:

179@gtimelog: Argue with Marius Gedminas on GitHub -- convincing people

vs

gtimelog: Argue with Marius Gedminas on GitHub (179) -- convincing people

Uhh, the second looks more natural to me, although I'd put a # in front of the ticket number. And by having the project name in front you get to use completion.

I need to sit down and figure out all the consequences of this. How would the reports change, how would grouping change. Would the task list need support for this syntax as well?

I wonder if I could come up with a plugin API that would allow this kind of customization.

@codingforfun codingforfun force-pushed the alternate_format_w_descriptions branch from ee6f46f to 6f7e8fe Compare May 2, 2020 19:37
@codingforfun
Copy link
Author

How would the reports change, how would grouping change

Currently the reports don’t change, because it’s still the task and the project returned from parsing.
The point is just that the description get’s ignored when computing accumulations.

@codingforfun
Copy link
Author

And by having the project name in front you get to use completion.

That may be a point but is also a matter of taste. If you work a lot with a tracker you might have the number at hand while working at a task, so starting to type the number is maybe faster for completion then starting with the project and sort out from all the previous tasks on that project.

Uhh, the second looks more natural to me

I admit the 2nd looks a little bit nicer on reading. It still looks like this in the summary though.

My main points are:

  • find any way of having extra entry description ignored in summaries
  • no need for filtering to get per task summaries

If we can do this with another logical separator, that would be fine too.
We discussed this already, so any intuitive like ,, ;, -- is already out of the game for various reasons.
Using the @ is an option, but is only intuitive if the task comes first (task@project). The : makes a lot of sense then for the discription.

@andrewshadura
Copy link
Member

andrewshadura commented Sep 23, 2020

JFYI, we’re using (with our gTimeLog fork a nested format of task names:
customer: project: task-group: task-type: task-id: task description

Where task-id is not a part of the actual task name. Unfortunately, we have hardcoded the four level depth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants