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

Suggestion: better error reporting when setting HEAD

From
FMFrancois Marier <francois@debian.org>
Date
Dec 18, 2008, 05:58 UTC
Message-ID
<20081218055825.GQ6708@isafjordur.dyndns.org>
(Please CC me on your replies, thanks)
If you take any valid git repo and then do the following:
  git symbolic-ref HEAD master
  (instead of "git symbolic-ref HEAD refs/heads/master")
then other git commands (e.g. "git log") will return this error message:
  fatal: Not a git repository
I'd like to suggest two "usability" improvements:
1- changing the error message to explain why the directory is no longer
   considered a git repo. Maybe something along the lines of:
     fatal: Invalid reference in .git/HEAD
2- To prevent this error from happening in the first place, git-symbolic-ref
   could refuse to change HEAD to a non-existent ref.

Cheers, Francois

Next: Jeff King
Message 1 of 2 in “Suggestion: better error reporting when setting HEAD”
  1. Francois MarierDec 18, 2008
  2. Jeff KingDec 18, 2008

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.