git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] HEAD, ORIG_HEAD and FETCH_HEAD are really special.

From
Pierre Habouzit <madcoder@debian.org>
Date
Sep 7, 2007, 12:42 UTC
Message-ID
<20070907124253.GB27754@artemis.corp>
In-Reply-To
<46E145BF.4070403@eudaptics.com>
On Fri, Sep 07, 2007 at 12:36:15PM +0000, Johannes Sixt wrote:
Show 12 quoted lines
> Junio C Hamano schrieb:
> >But he has a stray .git/master file,
> >perhaps created by hand by mistake (it would be very interesting
> >to find how that file got there in the first place),
> 
> It is easy to get one there if, in a brave moment, you try
> 
>    git update-ref master $some_other_ref
> 
> instead of the correct
> 
>    git update-ref refs/heads/master $some_other_ref
  I was about to say the same :)
  I'd have added though that maybe update-ref should print a warning for
the references that do not match the restriction Junio added. This could
be done using the function Junio proposed un update_ref() in refs.c
  note that it's a sane thing to do anyways, I would not bet a lot of
money on what happens if you ask git to:
  git update-ref $foo $sha
  for foo in (completely random :P): index config packed-refs ...
  If a tool needs a new reference namespace, it can create a
subdirectory under refs/ so it does not really causes harm IMHO.
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org
Previous: Johannes SixtNext: Junio C Hamano
Message 8 of 17 in “rebase from ambiguous ref discards changes”
  1. Keith PackardSep 6, 2007
  2. Pierre HabouzitSep 6, 2007
  3. Junio C HamanoSep 6, 2007
  4. Keith PackardSep 7, 2007
  5. Pierre HabouzitSep 7, 2007
  6. HEAD, ORIG_HEAD and FETCH_HEAD are really special.Junio C Hamano, Sep 7, 2007
  7. Johannes SixtSep 7, 2007
  8. Pierre HabouzitSep 7, 2007
  9. Junio C HamanoSep 7, 2007
  10. Pierre HabouzitSep 7, 2007
  11. Alex RiesenSep 8, 2007
  12. Keith PackardSep 7, 2007
  13. Keith PackardSep 7, 2007
  14. Nicolas PitreSep 7, 2007
  15. Junio C HamanoSep 7, 2007
  16. Carl WorthSep 7, 2007
  17. Junio C HamanoSep 7, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.