From: Brian Foster <brian.foster@innova-card.com>
To: Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil>
Cc: git@vger.kernel.org
Subject: Re: [Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do?
Date: Fri, 13 Aug 2010 09:22:23 +0200 [thread overview]
Message-ID: <201008130922.23717.brian.foster@innova-card.com> (raw)
In-Reply-To: <Xp6r8yG_6tK_gooNBRqAKdsGRTcXgRo-b1bJv3J7ckxs2iD_-UXlPw@cipher.nrlssc.navy.mil>
On Thursday 12 August 2010 19:02:49 Brandon Casey wrote:
> 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 .... ;-\
> 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-
prev parent reply other threads:[~2010-08-13 7:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-12 7:54 [Q] `git fetch tag NAME' into mirror repo does not update HEAD, what to do? Brian Foster
2010-08-12 8:33 ` Tomas Carnecky
2010-08-12 10:38 ` Brian Foster
2010-08-12 11:05 ` Tomas Carnecky
2010-08-12 12:16 ` [SOLVED] " Brian Foster
2010-08-12 12:32 ` Tomas Carnecky
2010-08-12 13:22 ` Brian Foster
2010-08-12 13:34 ` Tomas Carnecky
2010-08-13 7:03 ` Brian Foster
2010-08-12 17:02 ` [Q] " Brandon Casey
2010-08-13 7:22 ` Brian Foster [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201008130922.23717.brian.foster@innova-card.com \
--to=brian.foster@innova-card.com \
--cc=brandon.casey.ctr@nrlssc.navy.mil \
--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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).