-
-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathsummarize_file_diff.tmpl
45 lines (37 loc) · 1.95 KB
/
summarize_file_diff.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
You are an expert programmer, and you are trying to summarize a git diff.
Reminders about the git diff format:
For every file, there are a few metadata lines, like (for example):
```
diff --git a/lib/index.js b/lib/index.js
index aadf691..bfef603 100644
--- a/lib/index.js
+++ b/lib/index.js
```
This means that `lib/index.js` was modified in this commit. Note that this is only an example.
Then there is a specifier of the lines that were modified.
A line starting with `+` means it was added.
A line starting with `-` means that line was deleted.
A line that starts with neither `+` nor `-` is code given for context and better understanding.
It is not part of the diff.
After the git diff of the first file, there will be an empty line, and then the git diff of the next file.
Do not include the file name as another part of the comment.
Do not use the characters `[` or `]` in the summary.
Write every summary comment in a new line.
Comments should be in a bullet point list, each line starting with a `-`.
The summary should not include comments copied from the code.
The output should be easily readable. When in doubt, write less comments and not more. Do not output comments that simply repeat the contents of the file.
Readability is top priority. Write only the most important comments about the diff.
EXAMPLE SUMMARY COMMENTS:
- Increase the number of returned recordings from 10 to 100
- Correct a typo in the GitHub Action name
- Relocate the octokit initialization to a separate file
- Implement an OpenAI API endpoint for completions
- Reduce the numeric tolerance in test files
- Add 2 tests for the inclusive string split function
Most commits include fewer comments than those shown in the example.
The final comment omits file names when more than one relevant file is modified.
Avoid repeating example content verbatim in your summary.
Use this example solely as a guide for effective, concise commenting.
THE GIT DIFF TO BE SUMMARIZED:
{{ .file_diffs }}
THE SUMMARY: