Re: fatal: unable to read after commit - deeper analysis
- Date: Sat, 13 Apr 2019 10:21:36 +0100
- From: Klaus Ethgen <Klaus@xxxxxxxxx>
- Subject: Re: fatal: unable to read after commit - deeper analysis
-----BEGIN PGP SIGNED MESSAGE-----
I did a deep analysis of the problem and found that the trouble finally
was caused of some change in git (I did not search, when this changed.
But maybe you can tell me.)
Finally, the error was a combination of 4 tools, git, vim, the mentioned
vim-addon and task with a task-hook for committing pending.data.
When I do a git commit which invokes vim, then the following variables
- - GIT_INDEX_FILE
- - GIT_AUTHOR_DATE
- - GIT_PREFIX
- - GIT_EXEC_PATH
And $GIT_INDEX_FILE is the source of trouble here. The task-hook clears
respective sets the variables GIT_DIR and GIT_WORK_TREE. However, the
GIT_INDEX_FILE environment is set (in some cases) to an absolute path
pointing to .git/index.lock or .git/index (I have no idea when it is
taking the .lock variant).
Now we have a mismatch of GIT_DIR and GIT_WORK_TREE on one hand and the
absolute path of GIT_INDEX_FILE on the other. So the trouble is set. The
following "git add pending.data" did break all. It does something to an
index that does not belong to the git repo.
Mystery is when and why this changed in git. It was definitively changed
in some recent version.
Klaus Ethgen http://www.ethgen.ch/
pub 4096R/4E20AF1C 2011-05-16 Klaus Ethgen <Klaus@xxxxxxxxx>
Fingerprint: 85D4 CA42 952C 949B 1753 62B3 79D0 B06F 4E20 AF1C
-----BEGIN PGP SIGNATURE-----
Comment: Charset: ISO-8859-1
-----END PGP SIGNATURE-----