All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: git@vger.kernel.org
Subject: Re: `git-rev-parse master` not referred to by any ref?
Date: Sun, 26 Aug 2007 14:26:28 -0700	[thread overview]
Message-ID: <7vir72ng1n.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: 20070826140645.GC20243@fieldses.org

"J. Bruce Fields" <bfields@fieldses.org> writes:

>> Oops, found it:
>> 
>> 	git$ cat .git/master
>> 	407c0c87e15b3cf60347f4fc0bcdb4d239de4163

It _might_ make it safer to refuse creating anything outside
refs/ if the name does not contain or ends with "HEAD" (or
perhaps names that have chars outside "[_A-Z]"), but that would
restrict future tools that might want to have HEAD-like files,
so I am a bit hesitant.

OTOH, a random file under .git/ does not count as a ref for the
purposes of fsck/prune, so it may make sense to teach 
check_ref_format() about the same set of "special" names that
can appear directly under .git without being in refs/ hierarchy
(currently I think only "HEAD" and possibly "ORIG_HEAD" are in
that set).

BTW, git-merge.sh and git-reset.sh should use "git update-ref ORIG_HEAD"
instead of doing it by hand using "echo >$GIT_DIR/ORIG_HEAD".

Also, I *think* objects that are only reachable via ORIG_HEAD
are not considered as reachable by fsck/prune --- we probably
would want to fix this.

  reply	other threads:[~2007-08-26 21:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-26 13:45 `git-rev-parse master` not referred to by any ref? J. Bruce Fields
2007-08-26 13:52 ` J. Bruce Fields
2007-08-26 14:06   ` J. Bruce Fields
2007-08-26 21:26     ` Junio C Hamano [this message]
2007-08-26 22:28       ` Shawn O. Pearce
2007-08-26 22:36       ` J. Bruce Fields

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=7vir72ng1n.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=bfields@fieldses.org \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.