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

someone changed the contents of my HEAD.

From
DJDave Jones <davej@redhat.com>
Date
Feb 28, 2006, 03:04 UTC
Message-ID
<20060228030446.GA23490@redhat.com>

I just tried to check in some changes to some trees on master.kernel.org, and found after the first checkin that git claimed..

fatal: Not a git repository

A lot of head-scratching later, I think I've figured out what's happened. It seems there was a recent upgrade to the version of git on m.k.o, which is incompatible with the helper scripts I used before.

When checking in changes previously, I used this..

#!/bin/sh export GIT_AUTHOR_NAME="$1" export GIT_AUTHOR_EMAIL="$2" tree=$(git-write-tree) || exit 1 commit=$(git-commit-tree $tree -p HEAD) || exit 1 echo $commit > .git/HEAD

and called it thus..
commit-as "Dave Jones" "<davej@redhat.com>"

Previously, this updated .git/HEAD to a ptr to the latest committed change. All was well, as I only ever have one HEAD in my trees.

With the new .git however, when I clone a new tree, .git/HEAD contains ref: refs/heads/master, so my script destroys the git metadata.

For my newly created repos, this isn't a problem, as I can fudge my commit-as script to write to .git/refs/heads/master instead, but my concern now is the unpulled changes in the existing repos I have on master. Will Linus be able to pull those into his tree with git 1.2.3, or will I have to recreate those repos with the new-style .git/HEAD ?

		Dave
Next: Junio C Hamano
Message 1 of 3 in “someone changed the contents of my HEAD.”
  1. Dave JonesFeb 28, 2006
  2. Junio C HamanoFeb 28, 2006
  3. Dave JonesFeb 28, 2006

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.