Re: git-rm -n leaves .git/index.lock if not allowed to finish

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: git-rm -n leaves .git/index.lock if not allowed to finish

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:48

Miklos Vajna [off-list ref] writes:
quoted hunk
On Fri, Dec 19, 2008 at 04:02:48AM +0800, jidanni@jidanni.org wrote:
quoted
Bug: if git-rm -n is not allowed to write all it wants to write, it
will leave a .git/index.lock file:
# git-rm -n -r . 2>&1|sed q
error: '.etckeeper' has changes staged in the index
# git-rm -n -r . 2>&1|sed q
fatal: unable to create '.git/index.lock': File exists
Can't reproduce:
diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh
index b7d46e5..1581691 100755
--- a/t/t3600-rm.sh
+++ b/t/t3600-rm.sh
@@ -251,4 +251,12 @@ test_expect_success 'refresh index before checking if it is up-to-date' '
 
 '
 
+test_expect_success 'test from jidanni' '
+
+	git reset --hard &&
+	git rm -n -r . 2>&1|sed q &&
+	git rm -n -r . 2>&1|sed q
+
+'
+
 test_done
passes here just fine. Yes, there are multiple files in the repo.
I think you need to have tons of files to cause the pipe buffer to fill up
with the "rm 'frotz'" output, triggering a SIGPIPE to kill the upstream
process of the pipe.

Re: git-rm -n leaves .git/index.lock if not allowed to finish

From: Miklos Vajna <hidden>
Date: 2016-06-15 22:45:48

On Thu, Dec 18, 2008 at 04:35:54PM -0800, Junio C Hamano [off-list ref] wrote:
I think you need to have tons of files to cause the pipe buffer to fill up
with the "rm 'frotz'" output, triggering a SIGPIPE to kill the upstream
process of the pipe.
Ah, you are right. I did exactly what is in the lockfile.c part of your
patch, but I did not think about "if I don't get a SIGPIPE for 2 lines,
I may get one for 1000 lines". ;-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help