public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: git@vger•kernel.org
Subject: Should "git symbolic-ref -d HEAD" be forbidden?
Date: Thu, 01 Sep 2016 14:08:08 -0700	[thread overview]
Message-ID: <xmqqpoonuy4n.fsf@gitster.mtv.corp.google.com> (raw)

I think we should.

t1401 expects to be able to, but if you really do it:

	$ cd /tmp
	$ git init throwaway
        $ cd throwaway
        $ git symbolic-ref -d HEAD

the setup machinery considers that you are no longer in a working
tree that is controlled by a repository at .git/ because .git/ is
no longer a valid repository, so you cannot even do

	$ git symbolic-ref HEAD refs/heads/master

to recover.

             reply	other threads:[~2016-09-01 21:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01 21:08 Junio C Hamano [this message]
2016-09-01 21:19 ` Should "git symbolic-ref -d HEAD" be forbidden? Jeff King
2016-09-01 22:31   ` Junio C Hamano
2016-09-02  0:55     ` Jeff King
2016-09-02  9:19 ` Andreas Schwab

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=xmqqpoonuy4n.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    /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