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

Re: [PATCH] fetch set_head: fix non-mirror remotes in bare repositories

From
Christian Hesse <list@eworm.de>
Date
Jan 24, 2025, 14:07 UTC
Message-ID
<20250124150745.105593ea@leda.eworm.net>
In-Reply-To
<xmqqr04tqm86.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> on Thu, 2025/01/23 13:00:
Show 24 quoted lines
> Bence Ferdinandy <bence@ferdinandy.com> writes:
> 
> > In b1b713f722 (fetch set_head: handle mirrored bare repositories,
> > 2024-11-22) it was implicitly assumed that all remotes will be mirrors
> > in a bare repository, thus fetching a non-mirrored remote could lead to
> > HEAD pointing to a non-existent reference. Make sure we only overwrite
> > HEAD if we are in a bare repository and fetching from a mirror.
> > Otherwise, proceed as normally, and create
> > refs/remotes/<nonmirrorremote>/HEAD instead.
> >
> > Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
> > Reported-by: Christian Hesse <list@eworm.de>  
> 
> These should be chronological; somebody reports an issue, the patch
> gets written, and finally it is sent out with a Sign-off to certify
> that the patch is not a stolen property.
> 
> > ---
> >  builtin/fetch.c   | 15 ++++++++-------
> >  t/t5505-remote.sh | 10 ++++++++++
> >  t/t5510-fetch.sh  | 13 +++++++++++++
> >  3 files changed, 31 insertions(+), 7 deletions(-)  
> 
> We haven't heard from Chritian; has this been tested OK?
Sorry for the late reply...

Yes, with this patch applied git behaves as expected for me. Thanks a lot!

> What the patch does does look sensible.  Thanks.
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}
Previous: Eric SunshineNext: Junio C Hamano
Message 8 of 18 in “fatal: Not a valid object name HEAD”
  1. Christian HesseJan 11, 2025
  2. Bence FerdinandyJan 12, 2025
  3. Junio C HamanoJan 13, 2025
  4. fetch set_head: fix non-mirror remotes in bare repositoriesBence Ferdinandy, Jan 12, 2025
  5. Junio C HamanoJan 23, 2025
  6. Bence FerdinandyJan 23, 2025
  7. Eric SunshineJan 23, 2025
  8. Christian HesseJan 24, 2025
  9. Junio C HamanoJan 24, 2025
  10. Patrick SteinhardtJan 24, 2025
  11. Eric SunshineJan 24, 2025
  12. Junio C HamanoJan 24, 2025
  13. Bence FerdinandyJan 26, 2025
  14. Bence FerdinandyJan 26, 2025
  15. 1/2 fetch set_head: refactor to use remote directlyBence Ferdinandy, Jan 26, 2025
  16. 2/2 fetch set_head: fix non-mirror remotes in bare repositoriesBence Ferdinandy, Jan 26, 2025
  17. Patrick SteinhardtJan 27, 2025
  18. Junio C HamanoJan 27, 2025

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.