If you ask AI to write a commit message from a git diff, what is missing, and how do you check the result?
Suggested answer
The interviewer wants to know that you use AI as a controlled helper, and that you understand what a good commit message should contain.
What AI is missing is the reason. A diff only shows which lines were added or removed, that is, "what changed". The "why" lives in your head: which bug users hit, why you chose this approach over another. If you only give it the diff, you often get a message like "add bot.catch to handle errors", which is literally correct but tells a later reader nothing about what happened. That is why I always add a sentence or two about the intent to the prompt.
I check the result in three steps. First, read each sentence against the diff: if the message says "added tests" and the diff has no test file, that is an invention and it has to go. Second, check whether the first line has the project's format (for example type(scope): description, short, starting with a verb). Third, check whether the body explains why instead of retelling each line of code.
One more point: AI writes well only when the diff contains a single piece of work. If you pile a spec, a feature and tests into one commit, no message can describe it well. Split the commits by meaning first (git add -p helps you pick individual hunks), and only then ask AI.
Bonus points: mention that the person responsible for what a commit says is you, not the tool, and that in a pull request the "how I tested it" section has to be filled in by you from real results.