Re: [SPAM] Re: GIT mirror not updating

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-www(at)postgresql(dot)org, Jeff Davis <pgsql(at)j-davis(dot)com>, Kris Jurka <books(at)ejurka(dot)com>, Dave Page <dpage(at)pgadmin(dot)org>
Subject: Re: [SPAM] Re: GIT mirror not updating
Date: 2008-12-30 09:58:00
Message-ID: 4959F0A8.9070704@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-www

Heikki Linnakangas wrote:
> I propose that I will try
> that dummy "branch commit" hack in cvsps, and if it works out, create a
> new GIT repository using that. That would replace the current
> repository, which means that people working against that repository will
> need to use "git-fetch --force" to update their clones, and rebase their
> own branches. It would also be good to contribute the hack into upstream
> cvsps (whatever fork is considered upstream).
>
> I'd like to move to git-cvsimport because:
> - it converts tags
> - I'm more familiar with it than fromcvs/togit.

I tried that, but gave up after a while. I hacked cvsps to create the
dummy commits, but it choked on some files that exist some branches but
not others. It might be fixable, but I'm now convinced that
fromcvs/togit is the simplest solution after all. The lack of tags is
slightly annoying, but not a show-stopper. And we can add them manually
if we really want them, we don't tag that often.

togit normally looks at all the branches, and retrieves all commits from
CVS with date later than the latest commit on any branch in the GIT
repository. I think that's why the back-branches stopped updating after
there was even a single commit on master with later date. I modified it
so that each branch is treated separately. I'm not sure how we ended up
with duplicated history, though.

I have a recipe to fix the repository, and we don't even need to
recreate it from scratch. I'd appreciate that, because I have some
pretty complex stuff in my GIT repository with merges and everything
that could be a lot of work to rebase. This fixes the back-branches, too.

0. Backup

1. Apply the attached patch to togit.

2. Use git-reset to rewind the branches back to the state they were
before breakage. Attached rewind-branches.sh script does that for all
the branches.

3. Run togit.

After that, pulling from a repository that was last updated before Dec
13th (when it was screwed up), you get a nice fast-forward as usual. If
you have already pulled the duplicated history, you have to use
"git-pull --force" or git-pull will refuse to update because "history
has changed".

It should be safe, but not necessaery, to always use the modified togit
script. After fixing the repository, incremental updates should work
with unmodified togit as well, I think. The patched version is slower,
because it skips already-applied commits at a later stage, but most of
the time is spent in parsing the RCS logs anyway, so it might not be
important.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
fromcvs-fromdate-per-branch.patch text/x-diff 2.1 KB
rewind-branches.sh application/x-sh 1.9 KB

In response to

Browse pgsql-www by date

  From Date Subject
Next Message Emanuel Calvo Franco 2008-12-30 13:17:49 LInk problems in NLS Status Tables
Previous Message Greg Sabino Mullane 2008-12-29 23:35:09 Re: [SPAM] Re: GIT mirror not updating