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

commit-id fails after cg-init

From
PRPavel Roskin <proski@gnu.org>
Date
May 3, 2005, 20:03 UTC
Message-ID
<1115150585.28520.11.camel@dv>
Hello!

I tried to start a new project using cogito (current snapshot) and I was immediately greeted by a bug (or a buglet if you want). Let's do this in a clean directory:

$ cg-init defaulting to local storage area $ cg-diff cat: .git/refs/tags/: Is a directory cat: .git/refs/heads/: Is a directory Invalid id: usage: git-cat-file [-t | tagname] <sha1> usage: git-cat-file [-t | tagname] <sha1> Invalid id: usage: diff-cache [-r] [-z] [-p] [--cached] <tree sha1> mkdir: cannot create directory `/tmp/gitdiff.k4FHLY/': File exists $

Not nice.  Trivial debugging shows that it's commit-id that fails:
$ sh -x commit-id 
+ SHA1='[A-Za-z0-9]{40}'
+ SHA1ONLY='^[A-Za-z0-9]{40}$'
+ id=
+ '[' '!' '' ']'
++ cat .git/HEAD
+ id=
+ echo
+ egrep -vq '^[A-Za-z0-9]{40}$'
+ '[' -r .git/refs/tags/ ']'
++ cat .git/refs/tags/
cat: .git/refs/tags/: Is a directory
...

$ ls -al .git/HEAD lrwxrwxrwx 1 proski proski 17 2005-05-03 15:50 .git/HEAD -> refs/heads/master $ cat .git/refs/heads/master $

So, cg-init created an empty .git/refs/heads/master and made .git/HEAD a symlink to it. Now, commit-id reads that file and gets confused.

If anybody has an idea what to put to .git/refs/heads/master please speak up so that cg-init could be fixed.

-- 
Regards,
Pavel Roskin
Next: Petr Baudis
Message 1 of 7 in “commit-id fails after cg-init”
  1. Pavel RoskinMay 3, 2005
  2. Petr BaudisMay 3, 2005
  3. David A. WheelerMay 4, 2005
  4. H. Peter AnvinMay 4, 2005
  5. Alexey NezhdanovMay 5, 2005
  6. David A. WheelerMay 6, 2005
  7. Joel BeckerMay 3, 2005

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.