Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] scm next steps

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Eric Sandall <eric AT sandall.us>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] scm next steps
  • Date: Thu, 04 May 2006 13:33:17 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeremy Blosser (emrys) wrote:
> On Apr 12, Jeremy Blosser (emrys) [jblosser-smgl AT firinn.org] wrote:
>> The current identified SCMs to try are git, svk, and svn. git is most
>> similar to bzr (which the other teams are already using) and has a very
>> robust feature set. svk is most similar to p4. svn is probably in the
>> widest general community use. Is this the right list? Do we have some
>> volunteer gurus/sections for each?
>
> Ok, I think git is ready for people to try. Sorry it's taking so long, git
> is really rather flexible and David Brown and I had to do some research and
> tests on the right way to approach setting it up for grimoire work. I
> really wanted to have all 3 working by now, with a script to generate the
> tarballs from all, but I don't want to make people wait for that anymore.
> I still need to get git pushing to the commits ML and get gitweb up but it
> should be useable now. If someone wants to take this and dump it onto the
> wiki I'd appreciate it, else I'll try to find time. I need to work on svn
> next.
>
> If you want to work on a section in git, let me know and I'll get you
> access.
>
> Sizes
> =====
> First, some numbers for those who are worried about disk space of having
> the repository history on your disk:
>
> ~/smgl/scm/p4/sgl/grimoires $ du -chs devel test stable-rc/0.4 stable/0.3
> 113M devel
> 110M test
> 110M stable-rc/0.4
> 98M stable/0.3
> 430M total
>
> ~/smgl/scm/git/smgl/grimoire $ du -chs .
> 127M grimoire
> ~/smgl/scm/git/smgl/grimoire $ git branch
> devel
> * master
> origin
> stable-0.3
> stable-rc-0.4
>
> So that means the git grimoire repository, with all branches, is around
> 1/4th - 1/3rd the size of what you get checked out from p4 right now to get
> the same. Yes, that doesn't include history yet, but you can fit a fair
> amount of history in that much space. More on those branches later...
>
> Notes
> =====
> - The server is using git 1.3.0 from current test grimoire, you probably
> want that version too.
>
> - git has a ton of commands because it's a unix-style app with a util for
> everything and then aggregate commands that call things the ways that
> make sense for day to day work. Other frontends like cogito are
> replacements for the aggregation layer. git has docs for every command,
> and they're worth reading. Or just follow the basic list below.
>
> - Some of this is going to look very different to what you're used to.
> Some of it I didn't like at first either. I tried to forget my
> assumptions and be open-minded to internalizing the 'git way' and found
> that once I broke through, it made a lot of sense and is a very unix
> approach to SCM. git does revisions and it does branching really, really
> well. Those tools let you do about anything you can think of, but the
> answer to your difficult use case / question is quite possibly going to
> involve 'make a [temporary] branch'. Try to give it a fair chance, I
> promise it is not so bad. :-)
>
> - There's a ton of stuff I could get into, I will try to keep this to the
> basic things and FAQs, that will be long enough for now.
>
> Repository
> ==========
> I built the repository for this trial as follows:
> 1) init a git repository off of stable/0.3
> 2) make a stable-0.3 branch from this
> 3) bring in the stable-rc/0.4 changes and commit them
> 4) branch stable-rc-0.4 from this
> 5) bring in the test changes and commit them
> 6) make a devel branch and change to it
> 7) bring in the devel changes and commit them
>
> - We said we weren't going to keep a standing devel except for when we had
> WIP stuff, but branches in git are repository-wide, so making it a
> regular branch now (but not the trunk) made sense.
>
> - This ancestry isn't perfect, since stable-0.3 should be a child of
> stable-rc-0.3 instead of directly from test... some examples below show
> merging to 0.3 from -rc/0.4, which isn't correct, either. But during the
> trial this works.
>
> - I did the updates by copying and committing per-spell, so we have a
> commit per spell per branch. This isn't a perfect match for the changes
> made in p4, but hopefully it's enough for a trial. It lets you guys do
> per-spell integrations for most existing changes. If we decide on a full
> trial for git and we can get diff-level history out of p4 we can probably
> script a full replay conversion.
>
> - This sync is a couple of days old now, you'll want to check p4 to make
> sure you have the latest before you work on things.
>
> - Sync back to p4 is definitely not implemented right now, I'll leave it to
> Arwed to call how that needs to work out.
>
> Commands
> ========
> Get a copy of the grimoire:
> $ git clone http://scm.sourcemage.org/smgl/grimoire.git [<dest dir>]
> or
> $ git clone ssh://scm.sourcemage.org/smgl/grimoire.git [<dest dir>]
>
> - This gets you a full copy of the upstream grimoire repository and all of
> its branches. As noted above, this is currently around 130MB total.
> - The first is unauthenticated, the second will go over ssh. I'm going to
> put the http one up for now and invite anyone to check it out, but I need
> to reserve the right to shut it down if we get a lot of non-devs hitting
> it excessively to pull stuff. We don't have infinite bandwidth on this.
> - Also note it's named grimoire.git for now because we will also have a
> grimoire.svn and .svk under that smgl dir, once we pick something we'll
> just have a "grimoire" path.
>
> $ cd grimoire
>
> See what you got:
> $ git branch
> devel
> * master
> origin
> stable-0.3
> stable-rc-0.4
>
> - Without an argument git-branch lists the defined branches.
> - The '*' shows that 'master' is the active checkout.
> - 'master' is the default name of the local repository's trunk; this is our
> 'test' (I think we can rename it 'test' in git if we really want to, but
> I don't see the point).
> - 'origin' is a special branch on cloned repositories that is the pristine
> state of 'master' on upstream. You should treat this branch as
> read-only.
>
> Tell git who you are:
> $ git repo-config user.name "Foo Bar"
> $ git repo-config user.email "foobar AT sourcemage.org"
>
> - The name defaults to your local GECOS entry or $GIT_AUTHOR_NAME.
> - The email defaults to the local login@hostname or $GIT_AUTHOR_EMAIL.
> - You can also edit .git/config directly.
>
> Switch the working copy to stable:
> $ time git checkout stable-0.3
> real 0m8.790s
> user 0m4.670s
> sys 0m2.950s
> And back:
> $ time git checkout master
> real 0m23.256s
> user 0m4.610s
> sys 0m2.550s
>
> - The way we ended up building this, the branches are local branches of one
> repository instead of their own branched repositories. This is necessary
> to allow cherry-picking; that works between local branches but not remote
> branches. We could have used separate repos and required temporary local
> branches for any cherry-pick, but that would have probably gotten
> annoying. See notes above about being open-minded. :-)
>
> Decide you want a permanent checkout of devel and test for local system
> grimoires:
> $ git clone --shared . /var/lib/sorcery/codex/devel.git
> $ pushd /var/lib/sorcery/codex/devel.git
> $ git checkout devel
> $ popd
> $ git clone --shared . /var/lib/sorcery/codex/test.git
> $ pushd /var/lib/sorcery/codex/test.git
> $ git checkout master
> $ popd
>
> - These clones are 'shared', which will make them just point to the primary
> local copy for their repository meta-information. In other words, on
> disk they're just the spell files for that branch of the grimoire and a
> pointer to the primary local copy's git data.
>
> Keep the above updated periodically:
> $ pushd /var/lib/sorcery/codex/devel.git; git pull; popd
> $ pushd /var/lib/sorcery/codex/test.git; git pull; popd
>
> - This updates those clones and their working copies to the latest state of
> the local repository they were cloned from.
>
> Now let's do some real work. A new version of spell foo is out, and we
> need to put it in test:
> $ git pull
> $ cd section/foo
> $ <edit/test/edit/test>
> $ git status (optional)
> $ git diff (optional)
> $ git add . (if there were new files)
> $ git commit .

Just an FYI here, but you'll need to do
$ cd ../..

As you need to be in the 'root' of the checkout, otherwise you will be
told: Not a git repository: '.git'.

> $ git push ssh://scm.sourcemage.org/smgl/grimoire.git master:master
<snip>

Is there a way we can avoid having to use a URL when pushing to the
server we checked out from and with the branch we're currently in
without setting an alias?

- -sandalle
- --
Eric Sandall | Source Mage GNU/Linux Developer
eric AT sandall.us | http://www.sourcemage.org/
http://eric.sandall.us/ | SysAdmin @ Shock Physics @ WSU
http://counter.li.org/ #196285 | http://www.shock.wsu.edu/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEWmUNHXt9dKjv3WERAkS8AJ9P2ngCOU5cGBW1yX+Qrrq/R8m+lACgrUmA
KHu707foxn6uNVM6ttnHirs=
=B5WS
-----END PGP SIGNATURE-----




Archive powered by MHonArc 2.6.24.

Top of Page