--->8---
$ git rebase -i HEAD~10
mv: cannot move
`c:/Users/kusma/src/rocket-git/.git/rebase-merge/git-rebase-todo.new'
to `c:/Users/kusma/src/rocket-git/.git/rebase-merge/git-rebase-todo'
# Not currently on any branch.
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# Debug Client/
# Debug/
# editor/Debug/
# editor/editor_vs2008.vcproj.Hue-PC.kusma.user
# example_bass/Debug Client/
# example_bass/Debug/
# example_bass/bass.dll
# example_bass/bass.h
# example_bass/bass.lib
# example_bass/example_bass_vs2008.ncb
# example_bass/example_bass_vs2008.suo
# example_bass/example_bass_vs2008.vcproj.Hue-PC.kusma.user
# example_bass/sync_cam.dist.track
# example_bass/sync_cam.rot.track
# example_bass/sync_clear.b.track
# example_bass/sync_clear.g.track
# example_bass/sync_clear.r.track
# sync_player_vs2008.vcproj.Hue-PC.kusma.user
# synctracker2_vs2008.ncb
# synctracker2_vs2008.suo
nothing added to commit but untracked files present (use "git add" to track)
Finished one cherry-pick.
Could not apply eae7524... remove C++ features from keytype enum
--->8---
This issue went away as quickly as it hit me - another try worked fine.
The first thing I tried was to grep for the error-string, "cannot
move", but I didn't find any candidates. Not so weird, really, the
"mv: "-prefix indicates that the error comes from my itself.
The line that generates the error seems to be "mv -f "$TODO".new
"$TODO" (git-rebase--interactive.sh:108).
Here's the code with some context:
--->8---
mark_action_done () {
sed -e 1q < "$TODO" >> "$DONE"
sed -e 1d < "$TODO" >> "$TODO".new
mv -f "$TODO".new "$TODO"
count=$(grep -c '^[^#]' < "$DONE")
total=$(($count+$(grep -c '^[^#]' < "$TODO")))
if test "$last_count" != "$count"
then
last_count=$count
printf "Rebasing (%d/%d)\r" $count $total
test -z "$VERBOSE" || echo
fi
}
--->8---
Unless my bashism is really horrible (well, it is), it looks like the
sed-instance on the previous line should have been finished with the
file before mv is invoked. There's no one else that I'm aware of
touching the file either.
Any ideas?
$ git --version
git version 1.6.5.1.1372.g025e4.dirty
--
Erik "kusma" Faye-Lund
Do you have a virus checker running? They commonly look at newly
written files and while examining the file may hold it locked
preventing it from being moved.
Pat Thoyts
Yes, I've recently installed Microsoft Security Essentials, and I've
got the "Real-time protection"-option turned on. This might very well
be the reason for this glitch, thanks.
Is there anything we can do to avoid problems when running with
antivirus on? I remember something about some patches to retry a
couple of times when unlink failed or something like that... Perhaps
patching 'mv' with something along those lines?
--
Erik "kusma" Faye-Lund
I imagine we can check just what error code was returned and try that.
I've encountered this before when using 'less' to view a file and
forgetting to close the program before switching to another branch.
There is an interesting article that attempts to find the program that
is holding the file open and launches a remote thread to close it -
but that requires privileged access and is really rude too.
(http://www.codeguru.com/cpp/w-p/files/fileio/article.php/c1287/)
Probably all that can really be done is to produce a sensible error
message. A quick retry might handle an on-demand virus checking
application.
Pat Thoyts