git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: Should "git symbolic-ref -d HEAD" be forbidden?
Date: Fri, 02 Sep 2016 11:19:29 +0200	[thread overview]
Message-ID: <87wpiuy7z2.fsf@linux-m68k.org> (raw)
In-Reply-To: <xmqqpoonuy4n.fsf@gitster.mtv.corp.google.com> (Junio C. Hamano's message of "Thu, 01 Sep 2016 14:08:08 -0700")

On Sep 01 2016, Junio C Hamano <gitster@pobox.com> wrote:

> 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.

git init recovers it, though.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

      parent reply	other threads:[~2016-09-02  9:19 UTC|newest]

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

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=87wpiuy7z2.fsf@linux-m68k.org \
    --to=schwab@linux-m68k.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).