| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bf39a12 commit 597de13
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,8 +66,13 @@ Name | Type | Description | |||
| 66 | 66 | `path`|`string` | **Required**. The relative path of the file to comment on. | |
| 67 | 67 | `position`|`integer` | **Required**. The line index in the diff to comment on. | |
| 68 | 68 | ||
| 69 | - Note: When passing the `commit_id`, use the SHA of the latest commit in the pull request or your comment may appear as "outdated" if the specified `position` has been modified in a subsequent commit. | ||
| 69 | + {{#tip}} | ||
| 70 | 70 | ||
| 71 | + When passing the `commit_id`, use the SHA of the latest commit in the pull request or your comment may appear as "outdated" if the specified `position` has been modified in a subsequent commit. | ||
| 72 | + | ||
| 73 | + To comment on a specific line in a file, you will need to first determine the position in the diff. GitHub offers a `application/vnd.github.v3.diff` media type which you can use in a preceding request to view the pull request's diff. The diff needs to be [interpreted](https://en.wikipedia.org/wiki/Diff_utility#Unified_format) to translate from the *line in the file* to a *position in the diff*. The `position` value is the number of lines down from the first "@@" hunk header in the file you would like to comment on. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the file's diff continues to increase through lines of whitespace and additional hunks until a new file is reached. | ||
| 74 | + | ||
| 75 | + {{/tip}} | ||
| 71 | 76 | ||
| 72 | 77 | #### Example | |
| 73 | 78 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments