google / google/git-appraise

Filename or path using in comment is not validated

Open
#41 4 comments 0 reactions 1 assignee Claimed by @ojarjur View on GitHub
bug
Dominant language
Go
Stars
5.3k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

The command below falsely succeeds, even though the filename or path is invalid:
`git appraise comment -f missspelled.go -m 'some message'`

These comments seem to end up in the object referenced by .git/refs/notes/devtools/discuss and cause an error when listing with:

``` bash
git appraise show
> comments (2 threads):
> ... comment 1 ...
> fatal: Path 'missspelled.go' does not exist in ''
```

All comments, including the bad one, can be seen in the `--json` output.

It would also be nice to have guidance on editing/amending comments before pushing, since naively using `git notes remove ` does not appear to work(?)

In the meantime I discovered that it was possible to checkout the comments into their own branch and remove the problem comment using`git rebase --interactive`:

``` bash
git checkout -B comments refs/notes/devtools/discuss
git rebase -i HEAD~2
drop the commit, and manually fix the merge after git rebase --continue
git update-ref refs/notes/devtools/discuss comments
git checkout master
git branch -D comments
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.