Before this commit:
change state of issue f3990ac13cd93a925f2a66e6a72eb0f2 to backlog
After this commit:
change state of issue 406e2330695040fed5fdbcaae5d2b331, new -> inprogress
Instead of a two-step process handled by the application
(`Issue::new_comment()` and `Comment::set_description()` or
`Comment::edit_description()`), make a simpler-to-use single-step
`Issue::add_comment()`.
Move the implementation details from Issue to Comment.
Better log message when adding a comment.
This starts cleaning up the Issue API.
* Start separating the public API from the internal API.
* Make `Issue::new()` and `Issue::edit_description()` better behaved,
simpler, reduce code duplication, and also produce better git log
messages.
* Update `ent` to call the changed `new()` function.
* Add some comments documenting the Issue API.
* `ent new` and `ent edit` now use the editor specified by the EDITOR
environment variable, if any. Defaults to `vi` if unspecified.
This makes each command in `handle_command()` handle its own issues
database. The commands that only need read-only access to the issues
make a detached worktree, while the commands that need read-write access
make a normal worktree with the `entomologist-data` branch checked out.
This lets us run any number of read-only operations (like `ent list`,
`ent show`, etc), even when a long-lived read-write operation (like
`ent new` or `ent edit`) is running.
Fixes `ent 317ea8ccac1d414cde55771321bdec30`.
This returns Ok(true) if the worktree has any modified files (staged or
unstaged), or any added (staged) files. Ok(false) if not.
Ignores untracked files.
This avoids leaving prunable worktrees around if we dirtied the worktree
and didn't commit.
This can happen in the following situation:
1. User runs `ent new`.
2. ent creates a new directory for the issue.
3. ent opens an editor to let the user type in the description of the
new issue. The editor saves to `ISSUE/description`.
4. User changes their mind and no longer wants to make a new issue, so
they save an empty buffer and exit the editor.
5. ent sees that the file is empty, and returns an error from
Issue::edit_description().
6. ent propagates the error up through program exit, and eventually
the git::Worktree struct is dropped. Since the worktree is dirty
(it has the new issue dir with an empty description file in it),
`git worktree remove` fails.
But `git worktree remove --force` works!
right-speech-bubble is not part of the recommended unicode
emoji presentation set, but left-speech-bubble is and therefore, it's
more commonly supported
I'm not sure about the filter format...
There are two independent filters: "state" and "assignee". The "state"
filter defaults to including issues whose state is InProgress, Blocked,
Backlog, or New. The "assignee" filter defaults to including all issues,
assigned or not.
The two filters can be independently overridden by the `ent list
FILTER` command. FILTER is a string containing chunks separated by
":", like the PATH environment variable. Each chunk is of the form
"name=value[,value...]". "name" can be either "state" or "assignee".
The "value" arguments to the "state" filter must be one of the valid
states, or it's a parse error.
The "value" arguments to the "assignee" filter are used to
string-compare against the issues "assignee" field, exact matches are
accepted and everything else is rejected. A special assignee filter of
the empty string matches issues that don't have an assignee.
Some examples:
* `ent list` shows issues in the states listed above, and don't filter
based on assignee at all.
* `ent list assignee=seb` shows issues in the states listed above,
but only if the assignee is "seb".
* `ent list assignee=seb,` shows issues in the states listed above,
but only if the assignee is "seb" or if there is no assignee.
* `ent list state=done` shows all issues in the Done state.
* `ent list state=done:assignee=seb` shows issues in the Done state that
are assigned to "seb".