René Scharfe <rene.scha...@lsrfire.ath.cx> writes:

> Before a branch is deleted, we check that it points to a valid
> commit.  With -d we also check that the commit is a merged; this
> check is not done with -D.
>
> The reason for that is that commits pointed to by branches should
> never go missing; if they do then something broke and it's better
> to stop instead of adding to the mess.  And a non-merged commit
> may contain changes that are worth preserving, so we require the
> stronger option -D instead of -d to get rid of them.
>
> If a branch consists of a symref, these concerns don't apply.
> Deleting such a branch can't make a commit become unreferenced,
> so we don't need to check if it is merged, or even if it is
> actually a valid commit.  Skip them in that case.  This allows
> us to delete dangling symref branches.

Purist in me tells me that we should be using "symbolic-ref -d" to
correct from such a misconfiguration, but ignoring that, the above
logic makes perfect sense to me, especially together with the next
change to tell what branch the symref was pointing at, which can be
used by the user when the user removes such a symbolic ref by
mistake.

Thanks.  Will queue all five.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to