Skip to content

Conversation

@inkarkat
Copy link
Member

This avoids the lookup of the resulting task number when applying subsequent actions to the moved task (or when undoing an accidental move).

Prefixes (i.e. "TODO:") are used to indicate the active todo file; the full file name just clutters the output as both source and destination are in $TODO_DIR, anyway.

Before submitting a pull request, please make sure the following is done:

inkarkat added 2 commits May 20, 2025 18:49
…on prefix

The prefix (i.e. normally "TODO:" already indicates the active todo file; there's no need to repeat its file name.
As both source and destination files are relative to $TODO_DIR, printing the entire file path doesn't add relevant information and is just distracting.
For consistency, the destination should also be printed by its uppercased prefix only. This would only lead to ambiguities if subdirs below $TODO_DIR with identical files were used, which isn't recommended nor likely.
This avoids the lookup of the resulting task number when applying subsequent actions to the moved task (or when undoing an accidental move).

Resolves todotxt#461
@inkarkat inkarkat requested a review from karbassi October 2, 2025 06:15
@karbassi karbassi requested a review from Copilot October 3, 2025 20:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds destination task number reporting and short file prefixes to move command output, improving clarity and avoiding later lookups. Updates corresponding tests to reflect the new output format.

  • Compute destination line number after move and include it in verbose output
  • Replace full filenames with uppercase file prefixes via getPrefix
  • Adjust error message and test expectations accordingly

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
todo.sh Adds dest line number lookup and updates verbose and error messages to use file prefixes
tests/t1850-move.sh Updates expected output messages to match new format including destination task number and prefixes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@karbassi karbassi left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏽

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.

Tell user on which position a task has been moved to

2 participants