From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: [PATCH v2 4/4] gc: remove broken symrefs Date: Mon, 28 Sep 2015 11:41:25 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Cc: Jeff King , git@vger.kernel.org To: Johannes Schindelin X-From: git-owner@vger.kernel.org Mon Sep 28 20:41:35 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 1ZgdMi-0000vh-76 for gcvg-git-2@plane.gmane.org; Mon, 28 Sep 2015 20:41:32 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750850AbbI1Sl2 (ORCPT ); Mon, 28 Sep 2015 14:41:28 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34242 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750727AbbI1Sl1 (ORCPT ); Mon, 28 Sep 2015 14:41:27 -0400 Received: by padhy16 with SMTP id hy16so181400911pad.1 for ; Mon, 28 Sep 2015 11:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=zAY71wf/3asRZi9pEeQ+ZfUiAG71oUKcxRuXMJCJrTo=; b=cvdKBpBt6gUj1QNzj78JbKToULFQpee6BpAv/y9+bcAdV5j92Pzh51C4odlIMDmqjz BRw5Hjj8SnSI1KUw0K5FwXMmSL1CU3fHTGHrFqxot1jwLKx6UHuhX5JJuiMMolqeGUaW o2/K97Ir4VROKO/3/I9kOsh18zkbZKsAFHE7X4unfP7PdKqvy/zePqQRZClzRW7cDr10 ncbMMqODJC/p98oZpW6IK3w4+7snkD14avmkrnxbBgzu88ujwnpHbi4m3ImFyaHrdcfO wWtPJMmHbMj2SR2UnRFoC4LDSe14lCcOfpQf2+f2WqRbc9X0NrnOG9ykoupTr2cljooo oIiQ== X-Received: by 10.68.100.226 with SMTP id fb2mr28470853pbb.92.1443465686697; Mon, 28 Sep 2015 11:41:26 -0700 (PDT) Received: from localhost ([2620:0:1000:861b:66:24f2:2685:8011]) by smtp.gmail.com with ESMTPSA id ol3sm6878411pbb.49.2015.09.28.11.41.25 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 28 Sep 2015 11:41:25 -0700 (PDT) In-Reply-To: (Johannes Schindelin's message of "Mon, 28 Sep 2015 16:02:08 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Johannes Schindelin writes: > When encountering broken symrefs, such as a stale remote HEAD (which can > happen if the active branch was renamed in the remote), it is more > helpful to remove those symrefs than to exit with an error. I think this depends on the perspective. One side of me says that a remote HEAD that points at refs/remotes/origin/topic that no longer exists is still giving me a valuable information and it should take a conscious action by the user to remove it, or evne better to repoint it to a more useful place. And from that point of view, removing is not all that helpful. Keeping them and not allowing them to exit with an error would be a real improvement. On the other hand, I can certainly understand a view that considers that such a dangling symbolic ref is merely a cruft like any other cruft, and "gc" is all about removing cruft. It just feels to me that this is a bit more valuable than other kinds of cruft, but maybe it is just me. > > This fixes https://github.com/git-for-windows/git/issues/423 > > Signed-off-by: Johannes Schindelin > --- > builtin/prune.c | 12 +++++++++++- > t/t6500-gc.sh | 2 +- > 2 files changed, 12 insertions(+), 2 deletions(-) > > diff --git a/builtin/prune.c b/builtin/prune.c > index d6f664f..337b12a 100644 > --- a/builtin/prune.c > +++ b/builtin/prune.c > @@ -6,6 +6,7 @@ > #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