public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: "René Scharfe" <rene.scharfe@lsrfire•ath.cx>
Cc: Git mailing list <git@vger•kernel.org>,
	Johan Herland <johan@herland•net>, Miklos Vajna <vmiklos@suse•cz>
Subject: Re: [PATCH 4/5] branch: skip commit checks when deleting symref branches
Date: Thu, 18 Oct 2012 14:34:23 -0700	[thread overview]
Message-ID: <7vpq4flb1c.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <507FF0EF.3070702@lsrfire.ath.cx> ("René Scharfe"'s message of "Thu, 18 Oct 2012 14:07:11 +0200")

René Scharfe <rene.scharfe@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.

  reply	other threads:[~2012-10-18 21:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15  8:50 BUG when trying to delete symbolic refs Johan Herland
2012-10-16 10:05 ` René Scharfe
2012-10-16 10:22   ` [PATCH] refs: lock symref that is to be deleted, not its target René Scharfe
2012-10-16 16:09   ` BUG when trying to delete symbolic refs Junio C Hamano
2012-10-18 11:59     ` René Scharfe
2012-10-18 12:02       ` [PATCH 1/5] branch: factor out check_branch_commit() René Scharfe
2012-10-18 12:04       ` [PATCH 2/5] branch: factor out delete_branch_config() René Scharfe
2012-10-18 12:05       ` [PATCH 3/5] branch: delete symref branch, not its target René Scharfe
2012-10-18 12:07       ` [PATCH 4/5] branch: skip commit checks when deleting symref branches René Scharfe
2012-10-18 21:34         ` Junio C Hamano [this message]
2012-10-21 10:40           ` [PATCH 0/2] Fix remaining issue when deleting symrefs Johan Herland
2012-10-21 10:40             ` [PATCH 1/2] t1400-update-ref: Add test verifying bug with symrefs in delete_ref() Johan Herland
2012-10-21 10:40             ` [PATCH 2/2] Fix failure to delete a packed ref through a symref Johan Herland
2012-10-21 17:46               ` René Scharfe
2012-10-21 19:09               ` Junio C Hamano
2012-10-18 12:08       ` [PATCH 5/5] branch: show targets of deleted symrefs, not sha1s René Scharfe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vpq4flb1c.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=johan@herland$(echo .)net \
    --cc=rene.scharfe@lsrfire$(echo .)ath.cx \
    --cc=vmiklos@suse$(echo .)cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox