git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Guidlines for error messages

From
Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>
Date
Jul 29, 2017, 02:57 UTC
Message-ID
<1501297078.2711.2.camel@gmail.com>
Hello all,

On reading the CodingGuidelines, I saw a section that specifies rules about the structure and formatting of error messages. I have reproduced it below,

    Error Messages
     - Do not end error messages with a full stop.
     - Do not capitalize ("unable to open %s", not "Unable to open %s")
     - Say what the error is first ("cannot open %s", not "%s: cannot open")

Having used git all these days, I have seen error messages that do seem to be violating the above guidelines (at least the first 2 points). A few are,

    Aborting commit due to empty commit message.
    fatal: There is no merge to abort (MERGE_HEAD missing).
    fatal: You have not concluded your merge (MERGE_HEAD exists).
    Please, commit your changes before you merge.
    error: Empty commit message.
    Not committing merge; use 'git commit' to complete the merge.
    error: pathspec 'hell' did not match any file(s) known to git.
    fatal: Not a valid object name foo
    fatal: ambiguous argument 'foo..bar': unknown revision or path not in the working tree.
    Use '--' to separate paths from revisions, like this:
    'git <command> [<revision>...] -- [<file>...]'
A few that do seem to be following the guideline are
    fatal: could not read log file 'imaginary_file': No such file or directory
    fatal: no input file given for in-place editing
    That makes me wonder, has the guideline changed ?
    Is this something that must be fixed ?
    Am I missing something ?
    -- 
    Kaartic
Next: Junio C Hamano
Message 1 of 2 in “Guidlines for error messages”
  1. Kaartic SivaraamJul 29, 2017
  2. Junio C HamanoJul 29, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.