From: Junio C Hamano Date: Mon, 28 Sep 2015 18:49:50 GMT Subject: Re: [PATCH v2 4/4] gc: remove broken symrefs Message-ID: In-Reply-To: Junio C Hamano writes: > 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. Sorry, it is a bad habit of me to send out without concluding remark, leaving the recipient hanging without knowing what the next step should be. I meant to say that I plan to, and I indeed did, queue these 4 without changes. I am not opposed to the removal so strongly to reject [4/4]. The above comment was that I just do not know if this is the right thing to do, or it will be hurting users. Thanks. > >> >> 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