Re: [PATCH] Proof-of-concept patch to remember what the detached HEAD was
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 14, 2009, 10:33 UTC
- Message-ID
- <alpine.DEB.1.00.0910141233060.4985@pacific.mpi-cbg.de>
- In-Reply-To
- <20091014050851.GE31810@coredump.intra.peff.net>
Hi,
On Wed, 14 Oct 2009, Jeff King wrote:
Show 16 quoted lines
> On Wed, Oct 14, 2009 at 12:44:34AM -0400, Daniel Barkalow wrote:
>
> > +char *get_detached_head_string(void)
> > +{
> > + char *filename = git_path("DETACH_NAME");
> > + struct stat st;
> > + if (stat(filename, &st) || !S_ISREG(st.st_mode))
> > + return NULL;
> > + struct strbuf buf = STRBUF_INIT;
> > + strbuf_read_file(&buf, filename, st.st_size);
> > + strbuf_trim(&buf);
> > + return strbuf_detach(&buf, 0);
> > +}
>
> Would it hurt to tuck this information into HEAD itself, as we already
> put arbitrary text into FETCH_HEAD?AFAIR we still remember HEAD to be a symlink.
Ciao, Dscho