{"thread":{"id":"40071","subject":"[PATCH jk/prune-mtime] prune: close directory earlier during loose-object directory traversal","startedAt":"2015-08-12T17:43:01Z","lastAt":"2015-12-14T19:02:25Z","messageCount":7,"participants":["Johannes Sixt","Jeff King","Johannes Schindelin","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"267924","messageId":"55CB85A5.5040802@kdbg.org","threadId":"40071","inReplyTo":"b9cf9e2168c3b2476bb5bb134a1528be@www.dscho.org","subject":"[PATCH jk/prune-mtime] prune: close directory earlier during loose-object directory traversal","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2015-08-12T17:43:01Z","receivedAt":"2015-08-12T17:43:01Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"27e1e22d (prune: factor out loose-object directory traversal, 2014-10-16)\nintroduced a new function for_each_loose_file_in_objdir() with a helper\nfor_each_file_in_obj_subdir(). The latter calls callbacks for each file\nfound during a directory traversal and finally also a callback for the\ndirectory itself.\n\ngit-prune uses the function to clean up the object directory. In\nparticular, in the directory callback it calls rmdir(). On Windows XP,\nthis rmdir call fails, because the directory is still open while the\ncallback is called. Close the directory before calling the callback.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n My Windows 8.1 machine does not require this fix for some unkonwn\n reason. But we still cater for Windows XP users, where this change\n is a real improvement.\n\n sha1_file.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/sha1_file.c b/sha1_file.c\nindex 4d1b26f..5cecc68 100644\n--- a/sha1_file.c\n+++ b/sha1_file.c\n@@ -3473,12 +3473,12 @@ static int for_each_file_in_obj_subdir(int subdir_nr,\n \t\t\t\tbreak;\n \t\t}\n \t}\n+\tclosedir(dir);\n+\n \tstrbuf_setlen(path, baselen);\n-\n \tif (!r && subdir_cb)\n \t\tr = subdir_cb(subdir_nr, path->buf, data);\n \n-\tclosedir(dir);\n \treturn r;\n }\n \n-- \n2.3.2.245.gb5bf9d3\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"267926","messageId":"20150812175629.GA24964@sigill.intra.peff.net","threadId":"40071","inReplyTo":"55CB85A5.5040802@kdbg.org","subject":"Re: [PATCH jk/prune-mtime] prune: close directory earlier during loose-object directory traversal","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-08-12T17:56:30Z","receivedAt":"2015-08-12T17:56:30Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Aug 12, 2015 at 07:43:01PM +0200, Johannes Sixt wrote:\n\n> 27e1e22d (prune: factor out loose-object directory traversal, 2014-10-16)\n> introduced a new function for_each_loose_file_in_objdir() with a helper\n> for_each_file_in_obj_subdir(). The latter calls callbacks for each file\n> found during a directory traversal and finally also a callback for the\n> directory itself.\n> \n> git-prune uses the function to clean up the object directory. In\n> particular, in the directory callback it calls rmdir(). On Windows XP,\n> this rmdir call fails, because the directory is still open while the\n> callback is called. Close the directory before calling the callback.\n\nMakes sense, and the patch looks good to me. Sorry for breaking things\non Windows.\n\nAcked-by: Jeff King <peff@peff.net>\n\n-Peff\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"267969","messageId":"557753b4c14eb3f90270007782bc3a73@www.dscho.org","threadId":"40071","inReplyTo":"55CB85A5.5040802@kdbg.org","subject":"Re: [PATCH jk/prune-mtime] prune: close directory earlier during loose-object directory traversal","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-08-13T07:32:14Z","receivedAt":"2015-08-13T07:32:14Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn 2015-08-12 19:43, Johannes Sixt wrote:\n> 27e1e22d (prune: factor out loose-object directory traversal, 2014-10-16)\n> introduced a new function for_each_loose_file_in_objdir() with a helper\n> for_each_file_in_obj_subdir(). The latter calls callbacks for each file\n> found during a directory traversal and finally also a callback for the\n> directory itself.\n> \n> git-prune uses the function to clean up the object directory. In\n> particular, in the directory callback it calls rmdir(). On Windows XP,\n> this rmdir call fails, because the directory is still open while the\n> callback is called. Close the directory before calling the callback.\n> \n> Signed-off-by: Johannes Sixt <j6t@kdbg.org>\n> ---\n>  My Windows 8.1 machine does not require this fix for some unkonwn\n>  reason. But we still cater for Windows XP users, where this change\n>  is a real improvement.\n\nI believe that we have a concrete bug report for that:\n\n    https://github.com/git-for-windows/git/issues/231\n\nCiao,\nJohannes\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"274286","messageId":"xmqqvb84epyl.fsf@gitster.mtv.corp.google.com","threadId":"40071","inReplyTo":"20150812175629.GA24964@sigill.intra.peff.net","subject":"Re: [PATCH jk/prune-mtime] prune: close directory earlier during loose-object directory traversal","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-12-11T19:37:54Z","receivedAt":"2015-12-11T19:37:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Wed, Aug 12, 2015 at 07:43:01PM +0200, Johannes Sixt wrote:\n>\n>> 27e1e22d (prune: factor out loose-object directory traversal, 2014-10-16)\n>> introduced a new function for_each_loose_file_in_objdir() with a helper\n>> for_each_file_in_obj_subdir(). The latter calls callbacks for each file\n>> found during a directory traversal and finally also a callback for the\n>> directory itself.\n>> \n>> git-prune uses the function to clean up the object directory. In\n>> particular, in the directory callback it calls rmdir(). On Windows XP,\n>> this rmdir call fails, because the directory is still open while the\n>> callback is called. Close the directory before calling the callback.\n>\n> Makes sense, and the patch looks good to me. Sorry for breaking things\n> on Windows.\n>\n> Acked-by: Jeff King <peff@peff.net>\n\nSorry for reviving this old thread, but I noticed that we do not\nhave this patch in our tree yet.  I'll queue to 'pu' for now lest I\nforget.  If I missed a good argument or concensus against the change\nplease let me know, otherwise I'll fast track the change to 2.7 final\n"},{"id":"274287","messageId":"20151211194103.GA5834@sigill.intra.peff.net","threadId":"40071","inReplyTo":"xmqqvb84epyl.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH jk/prune-mtime] prune: close directory earlier during loose-object directory traversal","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2015-12-11T19:41:03Z","receivedAt":"2015-12-11T19:41:03Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Dec 11, 2015 at 11:37:54AM -0800, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > On Wed, Aug 12, 2015 at 07:43:01PM +0200, Johannes Sixt wrote:\n> >\n> >> 27e1e22d (prune: factor out loose-object directory traversal, 2014-10-16)\n> >> introduced a new function for_each_loose_file_in_objdir() with a helper\n> >> for_each_file_in_obj_subdir(). The latter calls callbacks for each file\n> >> found during a directory traversal and finally also a callback for the\n> >> directory itself.\n> >> \n> >> git-prune uses the function to clean up the object directory. In\n> >> particular, in the directory callback it calls rmdir(). On Windows XP,\n> >> this rmdir call fails, because the directory is still open while the\n> >> callback is called. Close the directory before calling the callback.\n> >\n> > Makes sense, and the patch looks good to me. Sorry for breaking things\n> > on Windows.\n> >\n> > Acked-by: Jeff King <peff@peff.net>\n> \n> Sorry for reviving this old thread, but I noticed that we do not\n> have this patch in our tree yet.  I'll queue to 'pu' for now lest I\n> forget.  If I missed a good argument or concensus against the change\n> please let me know, otherwise I'll fast track the change to 2.7 final\n\nAh, thanks for doing that. I noticed it when picking through \"git branch\n--no-merged pu\" of your workspace a few weeks ago, but forgot to follow\nup. I certainly have no objections.\n\n-Peff\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"274345","messageId":"alpine.DEB.2.20.1512131425300.21630@virtualbox","threadId":"40071","inReplyTo":"20151211194103.GA5834@sigill.intra.peff.net","subject":"Re: [PATCH jk/prune-mtime] prune: close directory earlier during loose-object directory traversal","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2015-12-13T13:26:07Z","receivedAt":"2015-12-13T13:26:07Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio & Peff,\n\nOn Fri, 11 Dec 2015, Jeff King wrote:\n\n> On Fri, Dec 11, 2015 at 11:37:54AM -0800, Junio C Hamano wrote:\n> \n> > Jeff King <peff@peff.net> writes:\n> > \n> > > On Wed, Aug 12, 2015 at 07:43:01PM +0200, Johannes Sixt wrote:\n> > >\n> > >> 27e1e22d (prune: factor out loose-object directory traversal, 2014-10-16)\n> > >> introduced a new function for_each_loose_file_in_objdir() with a helper\n> > >> for_each_file_in_obj_subdir(). The latter calls callbacks for each file\n> > >> found during a directory traversal and finally also a callback for the\n> > >> directory itself.\n> > >> \n> > >> git-prune uses the function to clean up the object directory. In\n> > >> particular, in the directory callback it calls rmdir(). On Windows XP,\n> > >> this rmdir call fails, because the directory is still open while the\n> > >> callback is called. Close the directory before calling the callback.\n> > >\n> > > Makes sense, and the patch looks good to me. Sorry for breaking things\n> > > on Windows.\n> > >\n> > > Acked-by: Jeff King <peff@peff.net>\n> > \n> > Sorry for reviving this old thread, but I noticed that we do not\n> > have this patch in our tree yet.  I'll queue to 'pu' for now lest I\n> > forget.  If I missed a good argument or concensus against the change\n> > please let me know, otherwise I'll fast track the change to 2.7 final\n> \n> Ah, thanks for doing that. I noticed it when picking through \"git branch\n> --no-merged pu\" of your workspace a few weeks ago, but forgot to follow\n> up. I certainly have no objections.\n\nGit for Windows carries this patch since Git for Windows v2.5.0. So: no\nobjection from my side, either.\n\nCiao,\nDscho\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"274393","messageId":"xmqqvb80kg5a.fsf@gitster.mtv.corp.google.com","threadId":"40071","inReplyTo":"alpine.DEB.2.20.1512131425300.21630@virtualbox","subject":"Re: [PATCH jk/prune-mtime] prune: close directory earlier during loose-object directory traversal","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2015-12-14T19:02:25Z","receivedAt":"2015-12-14T19:02:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> > Sorry for reviving this old thread, but I noticed that we do not\n>> > have this patch in our tree yet.  I'll queue to 'pu' for now lest I\n>> > forget.  If I missed a good argument or concensus against the change\n>> > please let me know, otherwise I'll fast track the change to 2.7 final\n>> \n>> Ah, thanks for doing that. I noticed it when picking through \"git branch\n>> --no-merged pu\" of your workspace a few weeks ago, but forgot to follow\n>> up. I certainly have no objections.\n>\n> Git for Windows carries this patch since Git for Windows v2.5.0. So: no\n> objection from my side, either.\n\nThanks!\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"Git for Windows\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"}]}