Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jul 2023 11:57:57 -0400
From:      Marc Branchaud <marcnarc@gmail.com>
To:        "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>, git@freebsd.org
Subject:   Re: fatal: unable to read <hash>
Message-ID:  <80c39b3e-9013-22c0-286d-a0ccd05dc21a@gmail.com>
In-Reply-To: <orqq0n25-14pq-nn97-o85p-1p6r107s20ns@yvfgf.mnoonqbm.arg>
References:  <orqq0n25-14pq-nn97-o85p-1p6r107s20ns@yvfgf.mnoonqbm.arg>

next in thread | previous in thread | raw e-mail | index | archive | help
Does the .git/gc.log file contain more info (I suspect not)?

I've seen file ownership/permission problems if one sometimes runs git 
commands as different users (particularly root and not-root) in the same 
repo.

So, first try to "chown -R me:mygroup ." at the top of your Git repo, to 
make sure you own all the files, particularly the ones in .git/.

I believe the gc operation is trying to read a file named
	.git/objects/b9/cdc058e6eb1b3d8b5e29ad9b911d3da98f65a7
(note the / after "b9").

If the chown doesn't fix things, take a look in .git/objects/b9/ and see 
what's up with the files there.  The b9 directory itself might also have 
bad juju.

(Don't forget to remove .git/gc.log before trying to run "git gc" manually!)

		M.


On 2023-07-25 20:21, Bjoern A. Zeeb wrote:
> Hi,
> 
> on one of my trees I am getting:
> 
> --- 8< 8< 8< -----------------------------------------------------------
> % git fetch freebsd
> Auto packing the repository in background for optimum performance.
> See "git help gc" for manual housekeeping.
> warning: The last gc run reported the following. Please correct the root 
> cause
> and remove .git/gc.log
> Automatic cleanup will not be performed until the file is removed.
> 
> fatal: unable to read b9cdc058e6eb1b3d8b5e29ad9b911d3da98f65a7
> fatal: failed to run repack
> --- 8< 8< 8< -----------------------------------------------------------
> 
> I am not concerned about the background gc but the fatal error about the
> hash displayed.
> 
> I have no clue how to solve this, nor do I know what object that hash
> is/was.
> 
> Does anyone know how to "repair" this wihtout having to blow away the
> local copy with all its development branches (which would be rather
> painful)?
> 
> /bz
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?80c39b3e-9013-22c0-286d-a0ccd05dc21a>