I have been running a cron job that does a "git add" and "git commit"
of my entire home directory every minute.  It provides a record of
what I've been doing.  (Every night, I run a script to prune some of
the older commits to keep the disk usage under control.)

The "git add" would occasionally crash, leaving the Git lock file in
place.  After that, every minute, the two Git commands would complain
that there was a lock file in place.

Eventually, I worked out the general outline of the problem and its

Normally, "gid add" compresses a new file by calling the bzlib
library.  It does this by *mapping* the new file into memory and
calling a library function on the block of memory.  It looks like the
problem comes when the file is changed or deleted, causing some of
that block of memory to become un-mapped while bzlib is compressing

The solution is to build Git with the NO_MMAP configuration option (in
the Makefile).  This forces Git to read the file in the ordinary way,
which is not confused if the file is being changed simultaneously.


You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to