Commit graph

113 commits

Author SHA1 Message Date
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
5df03337d9 Merge pull request 'minor-ent-fixes' (#8) from minor-ent-fixes into main
Reviewed-on: #8
Reviewed-by: sigil-03 <sigil@glyphs.tech>
2025-07-07 18:57:29 -06:00
035c150f4c ent: better error reporting 2025-07-07 18:17:34 -06:00
4307ab98a0 better interface to looking up issue 2025-07-07 18:13:46 -06:00
b789a3d293 ent show: show dependencies, if any 2025-07-07 18:13:46 -06:00
seb
bd41704906 Merge pull request 'Add User Control Over State Transitions' (#7) from 03/state-transitions into main
Reviewed-on: #7
2025-07-07 18:13:06 -06:00
bcc8ba4f21 update CLI to have optional state control 2025-07-07 16:49:25 -06:00
964803716f Merge pull request 'always render issue UUIDs as 128 bit hex numbers' (#6) from fix-issue-uuids into main
Reviewed-on: #6
2025-07-07 13:53:31 -06:00
0f46eb7817 add State command to CLI 2025-07-07 13:29:09 -06:00
a6d2f7d1e8 issue.rs: add fmt::Display for State 2025-07-07 13:29:09 -06:00
ed1b4488b2 issue.rs: add state getter/setter 2025-07-07 13:29:01 -06:00
172055c480 always render issue UUIDs as 128 bit hex numbers 2025-07-07 12:53:05 -06:00
seb
343e43a762 Merge pull request 'Use Logging Crate To Avoid STDOUT Spam' (#5) from 03/logging into main
Reviewed-on: #5
2025-07-07 12:45:33 -06:00
seb
4d4d0d336b Merge pull request 'Add Simple Install Script' (#4) from 03/install-script into main
Reviewed-on: #4
2025-07-07 12:44:12 -06:00
15f0ce57d5 install.sh: use /usr/local/bin not /usr/bin 2025-07-07 12:40:03 -06:00
1e5d328ab4 add logging crate to reduce unnecessary stdout spam 2025-07-07 12:31:09 -06:00
seb
0b5e6f7379 Merge pull request 'ent-new-edit-show' (#3) from ent-new-edit-show into main
Reviewed-on: #3
2025-07-07 12:04:49 -06:00
24df544a03 add install.sh script 2025-07-07 12:03:03 -06:00
3023576fec did some todo items 2025-07-06 00:36:51 -06:00
3f2d3b1520 add ent show 2025-07-06 00:22:30 -06:00
ba0862f5a6 add ent edit 2025-07-06 00:22:30 -06:00
09373cda56 add ent new 2025-07-06 00:22:30 -06:00
5e482edb5c rename ReadIssueError to just IssueError
Error handling is pretty broken in this project :-(
2025-07-06 00:22:30 -06:00
5b1c7a52b9 git: add git_commit_file() 2025-07-06 00:22:30 -06:00