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

git fsck and new repos / backup repos

From
SCSergio Callegari <scallegari@arces.unibo.it>
Date
Apr 10, 2007, 18:27 UTC
Message-ID
<loom.20070410T200901-466@post.gmane.org>

Hi, just posting a very very minor thing, that anyway might be easy to improve...

consider the following cases:
1) Empty repo

mkdir Foo cd Foo git --bare init git --bare fsck

error: HEAD is not a symbolic ref error: No default references

Should this be an error...? Of course fsck is not happy: HEAD points to master, but master does not exist. However, the newbie might find it weird that git complains over a brand new repo it has just made.

BTW also gitk dies badly in this case.
2) Backup repo

mkdir Foo-Backup cd Foo-Backup git --bare init

cd <path>/Foo-Workingtree git config --add remote.foobackup.url <url pointing to Foo Backup> git config --add remote.foobackup.push +refs/heads/*:refs/remotes/workplace1/* git push foobackup

cd <path>/Foo-Backup git --bare fsck error: HEAD is not a symbolic ref

Of course... again head points to master, but master does not exist.

Should maybe git init not just set up HEAD pointing to master, but also master pointing to 000000000000000000000000000 and then fsck recognize that 000000000000000000000000000 is a valid pointer to nothing, namely the starting point of a new branch?

Next: Junio C Hamano
Message 1 of 2 in “git fsck and new repos / backup repos”
  1. Sergio CallegariApr 10, 2007
  2. Junio C HamanoApr 11, 2007

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.