Commit graph

136 commits

Author SHA1 Message Date
b02807eaca Issue: add tags field 2025-07-12 12:28:53 -06:00
665f02cbe8 when changing state, include old state in git log message
Before this commit:
    change state of issue f3990ac13cd93a925f2a66e6a72eb0f2 to backlog

After this commit:
    change state of issue 406e2330695040fed5fdbcaae5d2b331, new -> inprogress
2025-07-12 10:02:51 -06:00
65316da0bd teach ent edit to edit Comments as well as Issues 2025-07-11 20:30:50 -06:00
seb
928e592722 Merge pull request 'cleanups-and-show-log-in-ent-sync' (#17) from cleanups-and-show-log-in-ent-sync into main
Reviewed-on: #17
2025-07-11 20:28:57 -06:00
08e0698418 git::sync(): show somewhat ugly git logs of stuff fetched and pushed 2025-07-11 13:09:23 -06:00
d642004ee0 refactor ent comment
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.
2025-07-11 13:07:47 -06:00
1c8d994fd9 better ent assign log message 2025-07-11 12:49:58 -06:00
ab86e6369c Issue::set_state(): better git commit message 2025-07-11 11:50:33 -06:00
1477322f81 Issue: refactor to simplify & make better git log messages
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.
2025-07-11 11:50:26 -06:00
7b6efdf925 rename git::add_file() to just add(), it can add directories too 2025-07-11 10:17:11 -06:00
seb
0d6c43d266 Merge pull request 'handle read-only operations' (#16) from read-only-ops into main
Reviewed-on: #16
2025-07-11 10:11:42 -06:00
ce36626b7a ent: handle issue database source & worktrees better
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`.
2025-07-10 13:04:55 -06:00
f8d35e13ff add git::Worktree::new_detached()
This makes a detached worktree, useful for read-only operations on the
issues database branch.
2025-07-10 12:39:03 -06:00
6ea0b98963 ent show: blank line between comment header and description
This makes it a little easier to read.
2025-07-10 10:01:33 -06:00
seb
6cff355e4a Merge pull request 'empty-descriptions-and-dropped-worktrees' (#15) from empty-descriptions-and-dropped-worktrees into main
Reviewed-on: #15
2025-07-10 09:48:21 -06:00
e09e4b9cb7 simplify ent new 2025-07-09 22:36:24 -06:00
acf539c683 handle user abort in ent comment
The user saving an empty description is a normal user-initiated abort,
not an error.
2025-07-09 22:36:24 -06:00
a199fbc7f7 handle aborts in ent edit ISSUE
The user saving an empty description file is a normal user-initiated
abort, not an error.
2025-07-09 22:36:24 -06:00
fc658009f5 Comment: handle empty description 2025-07-09 22:34:55 -06:00
211bf92dde Issue: handle empty description from user
This fixes issue a26da230276d317e85f9fcca41c19d2e.
2025-07-09 22:33:58 -06:00
bfdf6178f4 add git::commit() 2025-07-09 22:33:58 -06:00
16de030b8e add git::add_file() 2025-07-09 22:33:58 -06:00
ac72251e0e add git::restore_file()
This restores a file from the index to the worktree.
2025-07-09 22:33:58 -06:00
1509c42734 add git::worktree_is_dirty()
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.
2025-07-09 22:33:58 -06:00
ca353352f8 git::Worktree::drop() now force-drops the worktree
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!
2025-07-09 22:31:07 -06:00
seb
f5055a9ac7 Merge pull request 'Update Speech Bubble Emoji From Right to Left' (#14) from 03/fix-emoji into main
Reviewed-on: #14
2025-07-09 13:06:30 -06:00
da35631f2d update right-speech-bubble to use left-speech-bubble
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
2025-07-09 12:51:39 -06:00
df7b5c6aa4 add ent list filter by assignee
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".
2025-07-09 10:20:23 -06:00
seb
86a22f88f3 Merge pull request 'Add a couple of features' (#13) from couple-of-usability-features into main
Reviewed-on: #13
2025-07-09 10:20:10 -06:00
a676bd9cdd ent list: show assignee, if any 2025-07-08 20:59:02 -06:00
d21b811bee add ent assign ISSUE PERSON 2025-07-08 20:59:02 -06:00
645062d10c add optional 'assignee' to Issue 2025-07-08 20:59:02 -06:00
400e0ca26f ent list: show comment count for each issue 2025-07-08 20:59:02 -06:00
ba57f629e3 make ent list sort issues first by state, then by ctime 2025-07-08 20:59:02 -06:00
e8b37cd86a add author and timestamp to Issue 2025-07-08 20:59:02 -06:00
7acd94f7c0 add author to Comment 2025-07-08 20:59:02 -06:00
seb
304b6b0d17 Merge pull request 'give Comment a timestamp, display in chronological order' (#11) from sort-comments-chronologically into main
Reviewed-on: #11
2025-07-08 20:58:42 -06:00
a2c7ce34a3 fix git::git_log_oldest_timestamp() when there are multiple log entries 2025-07-08 18:42:14 -06:00
be362517fb give Comment a timestamp, display in chronological order
This commit makes a couple of changes:

- `ent show ISSUE` now displays the Issue's Comments in chronological
  order

- the Comment struct now includes a timestamp, which is the Author Time
  of the oldest commit that touches the comment's directory

- the Issue struct now stores its Comments in a sorted Vec, not in
  a HashMap

- The Comment's uuid moved into the Comment struct itself, instead of
  being the key in the Issue's HashMap of Comments
2025-07-08 18:42:14 -06:00
seb
431c67d43d Merge pull request 'ent list now accepts a filter, default "state=New,Backlog,Blocked,InProgress"' (#10) from filter-list into main
Reviewed-on: #10
2025-07-08 18:41:19 -06:00
seb
5cfb7401db Merge pull request 'add ent sync' (#12) from ent-sync into main
Reviewed-on: #12
Reviewed-by: sigil-03 <sigil@glyphs.tech>
2025-07-08 12:25:05 -06:00
2106c69271 ent sync: report success if it all worked 2025-07-08 11:10:03 -06:00
9c54a92152 add ent sync
In a worktree with the `entomologist-data` branch checked out in it:
1. `git fetch REMOTE`
2. `git merge REMOTE/BRANCH`
3. `git push REMOTE BRANCH`

Pretty straight-forward.  If anything goes wrong we error out and ask
the human to help.
2025-07-08 10:50:37 -06:00
ccabfa4ec8 remove an old debug log message from Issue::new_comment() 2025-07-08 10:50:37 -06:00
7d9284bf91 ent list now accepts a filter, default "state=New,Backlog,Blocked,InProgress" 2025-07-07 23:46:14 -06:00
seb
4d6e18a9f4 Merge pull request 'start adding support for comments on issues' (#9) from comments into main
Reviewed-on: #9
2025-07-07 22:35:31 -06:00
cd4eb82067 remove a useless debug message 2025-07-07 22:33:29 -06:00
8ac4ca4c54 add ent comment, to add a comment on an issue 2025-07-07 21:16:08 -06:00
9870d42fdc ent show: include comments 2025-07-07 21:16:08 -06:00
50509dcf59 basic comment support in lib 2025-07-07 21:16:08 -06:00