Jump to content

Old repositories


Guest freghar
 Share

Recommended Posts

Just a few words of warning ahead - I don't know if it deserves an "announcement", but it's one of those almost-official and frequently asked things, .. it can also fall under "News".

This smallish article is about getting and controling old mangos svn history in it's git form.

So, basically there are two old git repositories I know about (+ svn one):

http://github.com/freghar/mangos-svn/commits

and http://github.com/freghar/mangos-svn-backup .

The first one can be called "primary" as that's the one you should use. The second one shouldn't be normally used, it's previuos name was git-svn-archive, I renamed it to make it's purpose more clear - it's a mere backup, nothing for everyday search/usage.

So for the rest of this post, I'll show some examples of the "primary" repo usage.

First of all - there are no branches. Everything is referenced by tags. Right, no master branch as it's useless here. Github has probably some web-interface-display problem with that (on "tree" page), but that isn't related to git at all.

Tags are divided into three parts; mangos version tags (v0.1, v0.5, etc.), client version tags (c1.2.0, c1.3.1, etc.) and a "head" (lowercase!) tag, pointing to last commit in the repo (= 6767). Client version tags point to the most recent commits with support for target client. Ie. if you checkout c1.12.1, you'll get the last commit with 1.12.1 support, which is the same as for 1.12.2, NOT the point where 1.12.2 became supported as well, in addition to 1.12.1.

So enough of theory, some examples:

I want to get old 1.12.2 source, just before 2.x switch

$ git clone git://github.com/freghar/mangos-svn.git mangos-svn
Initialized empty Git repository in /root/delme/mangos-svn/.git/
remote: Counting objects: 62811, done.
remote: Compressing objects: 100% (13742/13742), done.
remote: Total 62811 (delta 52111), reused 59637 (delta 48937)
Receiving objects: 100% (62811/62811), 35.25 MiB | 232 KiB/s, done.
Resolving deltas: 100% (52111/52111), done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.
$ cd mangos-svn/
$ ls -l
total 0
$ 

As you may see, the cloned directory is empty, no files in there. This is because the repo has no master branch, in this example, it saves you some time and keeps things cleaner (no local master branch), because a master checkout would be useless for you. The clone warning informs us about that.

So now we simply checkout the c1.12.2 tag:

$ git checkout -q c1.12.2
$ ls
AUTHORS  COPYING  ChangeLog  Makefile.am  NEWS  README  THANKS  bcpp.cfg  configure.ac  contrib  dep  doc  sql  src  win
$ 

Now you have 1.12.2 source! That's all!

I want to see all tags

$ git tag
c1.10.1
c1.10.2
c1.12.1
c1.12.2
c1.6.0
c1.6.1
c1.6.2
c1.7.0
c1.8.2
c1.8.3
c1.9.2
c1.9.4
c2.0.12
c2.1.2
c2.1.3
c2.2.3
c2.3.0
c2.3.2
c2.3.3
c2.4.1
c2.4.2
c2.4.3
head
v0.1
v0.10
v0.11
v0.5
v0.6
v0.7
v0.8
v0.9

It may change over time, new tags added for example, simply use the "git tag" command.

What about revision numbers?

$ git log -1
commit 908a3dbe7788c89eaffac4f08076513267a0a36a
Author: vladimir_mangos <[email protected]>
Date:   Sun Apr 15 16:15:54 2007 +0000

   [3462] Fixed compiler warning at float->uint32 conversion
   Revert talent related code changes from [3460] until additional research.
$ 

Every commit has a revision number on the beginning of it's first line in the commit message. Therefore to checkout revision 1234, simply

$ git checkout -q [1234]
$  git log -1
commit 67b29444a89fc4120282f1b89dedf67fe758113e
Author: theluda <[email protected]>
Date:   Tue May 9 06:43:52 2006 +0000

   [1234] Fixed #161 --- .setpoi command crashes the server when no creature is selected.
$ 

How to get hash from revision number or vice versa?

As written above, using git log;

$ git log -1 --pretty=oneline [4321]
ff44bde9096e565e4877b9f97013154b485b00a7 [4321] * Fixed: prevent return in quest list deleted timed quests at character loading. Optimize access to quest status data at load/add.
$ git log -1 --pretty=oneline ff44bde9096e
ff44bde9096e565e4877b9f97013154b485b00a7 [4321] * Fixed: prevent return in quest list deleted timed quests at character loading. Optimize access to quest status data at load/add.
$ 

I want to browse the source on github

Well that's a bit tricky, but:

* go to http://github.com/freghar/mangos-svn/commits

* find your favorite tag from the tag menu (below the source/commits/wiki/download/etc bar) if you don't know it already

* use http://github.com/freghar/mangos-svn/tree/c1.12.2 for example (substitute c1.12.2 for the tag / commit hash you want)

I want to download source without any git usage

Right, there's this nice download page: http://github.com/freghar/mangos-svn/downloads

I want to checkout the latest revision in the svn, so I can use git-blame

$ git checkout -q head
$ 

Simply.

There are some revision numbers missing

Yes, that's because they changed stuff only outside trunk/, like moved files to tags. The truth is, that mangos svn had two branches, theluda-dev and bleach-dev. From what I understood, those were only temporary branches with very few commits and nothing really interesting, but if you really _need_ them for some strange reason, use mangos-svn-backup repo and "git log -- branches/".

If you find such a missing number, simply use a lower one.

What else? Just a note to more git-advanced users; the repository has been under heavy changes, I connected the very old history r1 - r400 (no trunk) with the trunk-only history, it took some filter-branching, rebasing (hah, even found "rebase -i" bug), fine tuning (emails, commiter == author, old dates for commits, etc.), so if you really don't want to lose whole evening for setting up a fine-tuned git repo from the old svn, use this one.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use