Bug reports, change descriptions, asking for help
Beginner Core Git
Why this matters
Three kinds of writing dominate a technical team's day, and each has a shape that makes it work. Getting them right is the fastest way to be someone colleagues like working with, and it is entirely learnable.
A bug report someone can act on
Six parts. Miss one and the first reply is a question rather than a fix.
| Part | Example |
|---|---|
| What you did | python3 src/trailguide.py --list |
| What you expected | A table of ten trails |
| What happened | A crash, with the exact error text |
| Where | data/trails.csv, version 1.2.0, macOS 15 |
| How often | Every time, or once in ten runs |
| Evidence | The error text in a code block, not a screenshot |
## What I did
Ran `python3 src/trailguide.py --list` on a fresh clone of `main`.
## Expected
A table of ten trails.
## Actual
Traceback (most recent call last):
File "src/trailguide.py", line 41, in main
km = float(row["distance_km"])
ValueError: could not convert string to float: ''
## Where
Commit d3b92ec, macOS 15.1, Python 3.12.
## How often
Every time, since I added a trail with an empty distance to `data/trails.csv`.Two rules carry most of the value. Paste text, not screenshots, for anything that is text: it can be searched, copied into a test and quoted in a fix. And say where, precisely: a file, a version, a commit, a URL. "The FAQ is wrong" costs someone ten minutes of hunting before any work starts.
A change description a reviewer can use
Four parts, and the reviewer needs nothing else (lesson 9.7):
## What
Adds the Windows steps to the installation guide, and links them from the FAQ.
## Why
Support gets this question weekly; issue #12 has three examples.
## How to check
Follow `docs/getting-started.md` on Windows, or read the rendered preview.
Closes #12What in one sentence, why with evidence, how to check so the reviewer can verify rather than trust, and the closing keyword so the issue closes itself. If your project has a template, fill in its headings rather than replacing them.
The commonest failure is a description that repeats the diff: "changed getting-started.md" tells the reviewer what they can already see and nothing they need.
Asking a Git question that gets answered
Git questions get slow answers when they lack state. Include four things and the answer usually arrives in one reply:
- What you were trying to do, in plain words: "get my branch up to date with main".
- The exact command you ran, copied, not retyped.
- The exact output, in a code block, including the hints Git printed.
- The state: the output of
git statusandgit log --oneline -3.
I'm trying to update my branch from main. I ran:
git push
and got:
! [rejected] docs/12-windows -> docs/12-windows (non-fast-forward)
error: failed to push some refs
`git status` says:
On branch docs/12-windows
Your branch and 'origin/docs/12-windows' have diverged,
and have 1 and 1 different commits each.
What should I do?That question is answerable in one line. The same question as "my push isn't working, any ideas?" takes four messages to reach the same point.
Say what you have already tried, too. It saves the answerer suggesting it and tells them how you are thinking.
Where to ask
| Question | Where |
|---|---|
| About a specific change | On the merge request, in a thread |
| About a specific bug | On the issue |
| "How does this work?" | The team channel, then write down the answer somewhere durable |
| Urgent and blocking | Chat, then summarise the resolution in the issue |
The principle: ask where the answer will be found again. A Git question answered in a private message helps one person once; the same answer in the merge request helps everyone who reads it later, including you in six months.
How to do it
The three commands that make a good question, run before asking:
$ git status
$ git log --oneline -3
$ git branch -vvPaste all three. Nine times out of ten the answerer's first request would have been exactly this.
Copy output from the integrated terminal rather than screenshotting it. The Source Control view's Git output channel (View → Output → Git) shows the commands VS Code ran, which is what to paste when a button did something unexpected.
The Git tool window's Console tab shows every command and its output, and is the right thing to copy into a question about something the IDE did.
Ask in the issue or the merge request thread rather than in chat, so the answer is attached to the work. Use code blocks with triple backticks for output, and /label ~needs-info when you are the one who needs more from a reporter.
The same, with issue and pull request comments. Discussions are the right place for questions that are not about one specific change (lesson 10.6).
Common mistakes
- A screenshot of text. It cannot be searched, copied or quoted.
- "It doesn't work." Which command, on what, with what output.
- Omitting
git statusfrom a Git question, which is the first thing anyone will ask for. - A change description that restates the diff.
- Asking in chat where the answer disappears.
- Not saying what you already tried.
- Retyping error text rather than copying it, which introduces mistakes into the one part that must be exact.
Try it yourself
Goal: write the three pieces of writing well, once.
- Break something in your practice project deliberately: add a row with an empty value, or a heading level that fails the linter.
- Write a bug report with all six parts, pasting the real output.
- Fix it on a branch, and write the change description with what, why, how to check and
Closes #N. - Now write the question you would ask if you were stuck, including the output of
git statusandgit log --oneline -3. - Read all three back and remove anything a reader would not need.
Expected result: three short pieces of writing that a colleague could act on without asking you anything.
Show solution
Step 5 is what separates good technical writing from thorough technical writing. Everything in a bug report should either help reproduce the problem or help judge its importance; anything else is politeness at the reader's expense.