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

Re: [Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?

From
BFBrian Foster <brian.foster@innova-card.com>
Date
Aug 13, 2010, 07:22 UTC
Message-ID
<201008130922.23717.brian.foster@innova-card.com>
In-Reply-To
<Xp6r8yG_6tK_gooNBRqAKdsGRTcXgRo-b1bJv3J7ckxs2iD_-UXlPw@cipher.nrlssc.navy.mil>
On Thursday 12 August 2010 19:02:49 Brandon Casey wrote:
Show 26 quoted lines
> Brian Foster wrote:
> >  Bare repository ORIG's master looks like this [ I've updated
> >  all of the diagrams slightly to remove some confusion  -blf]:
> > 
> >    o--o--o--o--v1--o--v2--o--o--o [master &] HEAD
> > 
> >  where v1 and v2 are (annotated) tagged commits.
> > 
> >  Repository SLAVE is a mirror clone of ORIG which
> >  (very deliberately!) lags behind (i.e., [SLAVE's master's head]
> >  is one of the earlier (and usually tagged) commits
> >  on ORIG).  SLAVE's master was like this:
> > 
> >    o--o--o--o--v1 [master &] HEAD
> > 
> >  We wanted to update [SLAVE's master's head] to v2, so did:
> > 
> >    git fetch ORIG tag v2
> > 
> >  This gave us:
> > 
> >    o--o--o--o--v1 [master &] HEAD
> >                  \ 
> >                   o--v2
> > 
> >  It did not update SLAVE's [master's head] to v2, which we wanted[:]
       o--o--o--o--v1--o--v2 [master &] HEAD
> Are you using --mirror only so that the branch pointer in
> the mirror repository will be updated when you fetch?
 Correct.
> If you are not really interested in having a "real" mirror,
> then maybe you should set your mirror up to track a
> specific branch (or branches) in the mirrored repository.
 Now that seems like an excellent idea!
 The embarrassing thing is, we actually do _do_ something
 similar elsewhere in the process.  So we haven't got any
 great excuse for not thinking of it ....  ;-\ 
Show 19 quoted lines
> You could have a branch named for example "for_mirror/master",
> in the mirrored repository (ORIG) that you would prepare.
> You could update the for_mirror/master branch when you were
> ready using 'git branch' like this:
> 
>    git branch -f for_mirror/master v2
> 
> In the mirror repository (SLAVE), you would update the
> fetchspec so that the mirror mirrored the branches below
> the "for_mirror" namespace in the remote repository
> like this:
> 
>    fetch = +refs/heads/for_mirror/*:refs/heads/*
> 
> Then, a simple 'git fetch' would fetch the updates (including
> tags) and update the branch pointer in the mirror like you want
> it to do.  Tracking multiple branches this way is possible just
> by creating another branch in the ORIG repository with the proper
> name.
 Another nice point about the above is it could deal
 with another procedural issue we have, which is the
 lack of a “staging area” for final test (a “pre-SLAVE”).
 Whilst we haven't (yet) had any (known) screw-ups in
 the final released system (what “mirror” SLAVE contains),
 it can happen.  The known screw-ups were all detected
 before it went to SLAVE, but by accident (IM(H?)O).
 Thanks for the idea/observation.
cheers!
	-blf-
Previous: Brandon Casey
Message 11 of 11 in “[Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?”
  1. Brian FosterAug 12, 2010
  2. Tomas CarneckyAug 12, 2010
  3. Brian FosterAug 12, 2010
  4. Tomas CarneckyAug 12, 2010
  5. [SOLVED] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?Brian Foster, Aug 12, 2010
  6. Tomas CarneckyAug 12, 2010
  7. Brian FosterAug 12, 2010
  8. Tomas CarneckyAug 12, 2010
  9. Brian FosterAug 13, 2010
  10. Brandon CaseyAug 12, 2010
  11. Brian FosterAug 13, 2010

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.