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

[TI-85] :adjust creates overlapping interval #89

Closed
taskwarrior opened this issue Feb 11, 2018 · 5 comments
Closed

[TI-85] :adjust creates overlapping interval #89

taskwarrior opened this issue Feb 11, 2018 · 5 comments
Milestone

Comments

@taskwarrior
Copy link

@taskwarrior taskwarrior commented Feb 11, 2018

Tim Ruffing on 2017-07-31T12:12:46Z says:

See the following description (emphasis added):

~ ❯❯❯ timew start [redacted1] 15min ago
 You cannot overlap intervals. Correct the start/end time, or specify the :adjust hint.
 ~ ❯❯❯ timew start [redacted1] 15min ago :adjust
 Tracking [redacted1]
   Started 2017-07-31T13:07:23
   Current               22:23
   Total               0:15:00
 ~ ❯❯❯ timew stop
 You cannot overlap intervals. Correct the start/end time, or specify the :adjust hint.
 ~ ❯❯❯ timew
 Tracking [redacted1]
   Started 2017-07-31T13:07:23
   Current            14:04:51
   Total               0:57:28
 ~ ❯❯❯ timew s
 Wk  Date       Day Tags            Start    End      Time   Total
 W31 2017-07-31 Mon [redacted1]     0:00:00  1:26:02 1:26:02
                    [redacted2]     9:12:53  9:42:56 0:30:03
                    [redacted3]     9:42:56 10:07:19 0:24:23
                    [redacted3]    10:21:06 10:56:15 0:35:09
                    [redacted2]    11:29:24 13:07:34 1:38:10
                    [redacted1]    13:07:23        - 0:57:31 5:31:18```

                                                           
                                                    5:31:18
@taskwarrior taskwarrior added this to the 1.1.0 milestone Feb 11, 2018
@taskwarrior
Copy link
Author

@taskwarrior taskwarrior commented Feb 11, 2018

Migrated metadata:

Created: 2017-07-31T12:12:46Z
Modified: 2017-12-14T20:59:24Z

@taskwarrior
Copy link
Author

@taskwarrior taskwarrior commented Feb 11, 2018

Thomas Lauf on 2017-11-21T20:38:54Z says:

In my opinion, automatic overlap resolution is not always possible, so I would resort to interactive resolution. A short analysis brought me to this result:

  • There are four main cases when intervals overlap.
  • For each the user can choose between three resolutions:
    • discard old: the old interval is truncated
    • discard new: the new interval is truncated
    • merge: the overlap is converted into a new interval with tags from both.

Resolution cases:

  • Start date of new interval within old interval:
    {code:java}
    | DISCARD OLD | DISCARD NEW | MERGE
    NEW [--A---] | | |
    | [--B|--A--] | [---B--|A-] | [-B|A-B|A-]
    OLD [---B--] | | |
    {code}

  • End date of new interval within old interval:
    {code:java}
    | DISCARD OLD | DISCARD NEW | MERGE
    NEW [---A--] | | |
    | [---A--|B-] | [-A|--B---] | [-A|A-B|B-]
    OLD [--B---] | | |
    {code}

  • New interval encloses old interval:
    {code:java}
    | DISCARD OLD | DISCARD NEW | MERGE
    NEW [----A----] | | |
    | [----A----] | [-A|-B-|A-] | [-A|A-B|A-]
    OLD [-B-] | | |
    {code}

  • New interval enclosed by old interval:
    {code:java}
    | DISCARD OLD | DISCARD NEW | MERGE
    NEW [-A-] | | |
    | [-B|-A-|B-] | [----B----] | [-B|A-B|B-]
    OLD [----B----] | | |
    {code}

Remarks:

  • Identical start and end dates are only special cases of these where a resulting interval is empty – and can be omitted/deleted.
  • Cases with open intervals are covered by cases where the other interval's end date is within the interval.
  • When an interval overlaps with more than one interval, the resolution can be performed iteratively.

@taskwarrior
Copy link
Author

@taskwarrior taskwarrior commented Feb 11, 2018

Paul Beckingham on 2017-12-02T18:45:20Z says:

I agree with your anaylsis.  This would yield a fully functioning :adjust.

But it would not be magic.  My assumption has been that :adjust would obey various settings (favor this or that approach to auto resolution) that would allow it to automatically choose, without interaction.  I'm not sure how realistic my assumptions are.

@taskwarrior
Copy link
Author

@taskwarrior taskwarrior commented Feb 11, 2018

Thomas Lauf on 2017-12-02T19:22:41Z says:

As a first step, I would implement an automatic approach (one approach for all cases) as it is easier than user interaction. Depending on this one can decide whether it is feasable and durable and proceed.

@taskwarrior
Copy link
Author

@taskwarrior taskwarrior commented Feb 11, 2018

Paul Beckingham on 2017-12-02T19:25:40Z says:

Agreed.  The less interactive Q & A in a CLI tool the better.  We can always solve it with additional hints, for example:

$ timew ... :adjust :merge```

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

Successfully merging a pull request may close this issue.

None yet
1 participant