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

Consider adding an event to represent editing a comment #67

Closed
ojarjur opened this issue Jan 4, 2017 · 0 comments · Fixed by #86
Closed

Consider adding an event to represent editing a comment #67

ojarjur opened this issue Jan 4, 2017 · 0 comments · Fixed by #86

Comments

@ojarjur
Copy link
Collaborator

ojarjur commented Jan 4, 2017

The comment schema defines a record of discussion events (e.g. "User A added a comment at line B").

The schema as it currently stands can encode two types of events:

  1. A user adding a new comment
  2. A user responding to an existing comment

We might want to also provide a way to represent an edit event; where a user modifies an existing comment.

I do not think that support for updating a comment needs to be added to the command-line surface, as I imagine that user experience would be rather clunky. However, supporting it in the schema (and making the CLI display such comments properly) would make it easier to support comment editing in user experiences that can support it well (such as GUIs).

The simplest approach I can think of is to add an original field to the schema that would be similar to the parent field. That would specify that the comment is an update to the specified, prior comment.

We could also use this event to represent removing a comment, by having all of the fields other than original being empty.

When building the CommentThread objects, we would include all of the versions of a comment, but only display the last one. That would allow the user to still see all versions of a comment by displaying the JSON format of the review.

This would be very similar to the current support for updating a review request.

ojarjur added a commit that referenced this issue Feb 16, 2018
This change adds read-only support for comment edit actions. These
are represented in the JSON format using a new "original" field that
references the original, unedited comment.

By default, when displaying a comment thread that has been edited,
only the current version of comment is displayed. The full history of
the comment can be viewed by adding the `--json` flag to the
`git appraise show` command, to display the review in JSON format.

This change defines how edits are represented in git-notes and makes
the tool properly display edited comments, but does not add any support
to the tool for creating edits.

This fixes #67
ojarjur added a commit that referenced this issue Feb 27, 2018
Support edited comments.

This change adds read-only support for comment edit actions. These
are represented in the JSON format using a new "original" field that
references the original, unedited comment.

By default, when displaying a comment thread that has been edited,
only the current version of comment is displayed. The full history of
the comment can be viewed by adding the `--json` flag to the
`git appraise show` command, to display the review in JSON format.

This change defines how edits are represented in git-notes and makes
the tool properly display edited comments, but does not add any support
to the tool for creating edits.

This fixes #67
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant