From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Schindelin Subject: [PATCH v3 0/2] Fix gc failure when a remote HEAD goes stale Date: Tue, 06 Oct 2015 15:57:58 +0200 Organization: gmx Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Jeff Kind , git@vger.kernel.org To: Junio C Hamano X-From: git-owner@vger.kernel.org Tue Oct 06 15:58:20 2015 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZjSkz-00034K-JJ for gcvg-git-2@plane.gmane.org; Tue, 06 Oct 2015 15:58:18 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751706AbbJFN6N (ORCPT ); Tue, 6 Oct 2015 09:58:13 -0400 Received: from mout.gmx.net ([212.227.15.19]:57154 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751408AbbJFN6M (ORCPT ); Tue, 6 Oct 2015 09:58:12 -0400 Received: from dscho.org ([87.106.4.80]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0LkxLZ-1aJLrx3ToD-00ak6A; Tue, 06 Oct 2015 15:58:00 +0200 In-Reply-To: X-Sender: johannes.schindelin@gmx.de User-Agent: Roundcube Webmail/1.1.2 X-Provags-ID: V03:K0:m34F0du5qju4eogpzi/T06/ocHPqYK50zoqLUmuGkRw3r5FXX0j BWCVC0de2cBktHT/Zm2D6o3VPRHG7On6SVNdbMI3HDR9QXJdeD+dPxpD58IWDWJNJsE6uVq vsztpZ0vvnJ7fZAWdtR9NCqD+QssDlGv55SnCoSI7wCbFJac4qSS7rtfXbdmy35QMWtvmFf PikIyKia0gDYXKwjzX3Ww== X-UI-Out-Filterresults: notjunk:1;V01:K0:0P88gytJqaM=:eVBFxkDyeESkq5IXnjl8cW 0Y74FfA9d2bV0GBrheWThsMvAI4DA6Tqkie3Z11I0zTZG3z2EVdFq/dZfIpBfVJgqVFmpi+LT 0L69fw3FUPqlzdi+IT7uPi2W/m20ROGT4cDqqM6/zlxvD6gqpHvSGKUzJVSRpZT8cnXEEcVDE CMtZEZc8N3nmMaCMhi60wcpjM21t151/xs1aKGRuqGvmmTVlIMvYA7RH7pG/PBYwh4xKbgg02 D3vOho9gR/2GYdZfQop5g6suNacI5h6ZJa7KUtDNmKRwI3epFkwYBO8xkE6BRYrGLzIPRUHae 8kh0yxfl1DD0T+N7xyE1lnfliRvlqPY0NeTj3FzfE1Z25G3yc82ZBorpNG5Lq+rb4bkbFJ0bY vqwKHtYyiamaPHmOKe8Ut9uCr+nOQTly2Sbh9UWDTjwggSaKe+2V1tBTCDQtAE0z9DcJppoyv WrbMt8EQJRioNTay3WrOrgujg+8D5nKF0G8x4CNkTxUIvJ0K7omsjrNVlCTR1eDdDtTerzH7R LqUTpJLw2KD8ev8ZWXrrlAYB4JpTX4zuc6eZtyL+FeJIu1e0gfZFpFYeC166T+CknbdfKz1Yt nEHIj9PAAq2nYRDH8W/aQ8Kbo25pw/QDAQpBI7radbdlVAbAyStewS3rG4Z4NxeAdszuGYG0F H/BmRQIWDODravt10SSOwLEOIzXUrR3q+uDqKM1wUVciV35nkKb+ilKxzUtaYt2Wpa17lTKqb wdfr5TJyh7drsJSVSsaxZNda/ep5NZbUbnekfT5cXzZDbMSN6CEIkru6fRRSyoOE+sg0wxDv Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: There has been a report in the Git for Windows project that gc fails sometimes: https://github.com/git-for-windows/git/issues/423 It turns out that there are cases when a remote HEAD can go stale and it is not the user's fault at all. It can happen, for example, if the active branch in the remote repository gets renamed. Thanks to Junio and Peff for their really valuable sanity check. Interdiff re: v2 after the diffstat (3/4 and 4/4 were dropped, I am no longer removing the broken symrefs). Johannes Schindelin (2): gc: demonstrate failure with stale remote HEAD pack-objects: do not get distracted by broken symrefs reachable.c | 8 +++++++- t/t6500-gc.sh | 13 +++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/builtin/prune.c b/builtin/prune.c index 337b12a..10b03d3 100644 --- a/builtin/prune.c +++ b/builtin/prune.c @@ -6,7 +6,6 @@ #include "reachable.h" #include "parse-options.h" #include "progress.h" -#include "refs.h" static const char * const prune_usage[] = { N_("git prune [-n] [-v] [--expire