threads / discuss / 3092

[QUESTION] What is a tag for?

Subject: [QUESTION] What is a tag for?

## tl;dr

12 messages between Jan 17, 2006 and Jan 25, 2006.

replies: 11people: 5as markdown or json

Alex Bennee· Jan 17, 2006, 22:52 UTC · lore
Hi,

So I want to track Linus's 2.6 git tree as well as do a little small time hacking. I'm not brave enough to sit on the very bleeding edge and build what ever happens to be at the "HEAD" of the tree. However when a kernel releases I'd like to build *that* kernel.

I keep thinking of tags like labels in the old convetional SCM case. Is this correct? I can see once I've done my update (fetch/cogito what ever) that these tags apear in my local tree:

22:42 alex@malory [linux-2.6] >cat .git/refs/tags/v2.6.16-rc1 f3bcf72eb85aba88a7bd0a6116dd0b5418590dbe

So what do I do with them now? Are they only for branch points? Is the only way to know I'm building 2.6.16-rc1 to branch from it as described in git-branch, even if I'm not planning on doing any development?

Is this part of the concept that branches are cheap and you should feel free to create and throw them away at will?

I look forward to your elucidation and the ah! moment that finally gets my head around git ;-)

Cheers,
--
Alex, homepage: http://www.bennee.com/~alex/
Zoe: "So.. Trap?" Mal: "Trap." Zoe: "We goin' in?" Mal: "Ain't nothin'
but a few hours out." Wash: "But, remember the part where it's a trap?"
Petr Baudis· Jan 17, 2006, 23:05 UTC · re: Alex Bennee · lore

Re: [QUESTION] What is a tag for?

  Hi,

Dear diary, on Tue, Jan 17, 2006 at 11:52:24PM CET, I got a letter where Alex Bennee <kernel-hacker@bennee.com> said that...

Show 15 quoted lines
> So I want to track Linus's 2.6 git tree as well as do a little small
> time hacking. I'm not brave enough to sit on the very bleeding edge and
> build what ever happens to be at the "HEAD" of the tree. However when a
> kernel releases I'd like to build *that* kernel.
> 
> I keep thinking of tags like labels in the old convetional SCM case. Is
> this correct? I can see once I've done my update (fetch/cogito what
> ever) that these tags apear in my local tree:
> 
> 22:42 alex@malory [linux-2.6] >cat .git/refs/tags/v2.6.16-rc1
> f3bcf72eb85aba88a7bd0a6116dd0b5418590dbe
> 
> So what do I do with them now? Are they only for branch points? Is the
> only way to know I'm building 2.6.16-rc1 to branch from it as described
> in git-branch, even if I'm not planning on doing any development?
  the simplest thing to do in Cogito if you just want to follow tags
around is to cg-fetch periodically (that will get the changes to your
local database, but will not check them out), and cg-seek around to
whatever tag you want:
	$ cg-fetch
	$ cg-seek v2.6.16-rc1
	$ cg-fetch
	... no new tag ...
	$ cg-fetch
	... still no new tag ...
	$ cg-fetch
	... Linus, are you sleeping? ...
	$ cg-fetch
	$ cg-seek v2.6.16-rc2
	...
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Of the 3 great composers Mozart tells us what it's like to be human,
Beethoven tells us what it's like to be Beethoven and Bach tells us
what it's like to be the universe.  -- Douglas Adams
Junio C Hamano· Jan 18, 2006, 01:41 UTC · re: Alex Bennee · lore

Re: [QUESTION] What is a tag for?

Alex Bennee <kernel-hacker@bennee.com> writes:
> ... I'm not brave enough to sit on the very bleeding edge and
> build what ever happens to be at the "HEAD" of the tree. However when a
> kernel releases I'd like to build *that* kernel.

Then maybe its time to change your e-mail address from kernel-hacker to kernel-builder? ;-) ;-) ;-)

> I keep thinking of tags like labels in the old convetional SCM case. Is
> this correct?
Correct.

Tags are just labels. So you can think of them as a shorthand that lets you easily communicate a set of selected well-known versions with others (either people, or git tools). Instead of saying 2664b25051f7ab96b22b199aa2f..., you can say v2.6.16-rc1.

All of the things I demonstrate below, you can substitute v2.6.X with their commit object names and things work the same way. It is more convenient and human friendly to use tags.

Except one thing: signed tags can be verified, if you have GPG public key of the signer (in this case Linus), with "git verify-tag".

<offtopic> Does anybody know where to obtain the public key to verify v2.6.16-rc1 tag? </offtopic>

> So what do I do with them now? Are they only for branch points?

That is one of the things often done. To build on top of v2.6.16-rc1:

	$ git checkout -b myhack v2.6.16-rc1
	$ hack hack hack
        $ git commit -s -m 'Add support for frotz videocard.
	This adds frotz videocard support.  Blah Blah Blah...'

You could also use them to see what happened during a given timeframe. For example:

	$ git log v2.6.14..v2.6.15 | git shortlog

would list you all the changes between these two releases, for example.

If you know something used to work at a given version, say v2.6.15, and now it does not work, you can use it as good/bad input for the bisection bug hunting:

	$ git bisect good v2.6.15 && git bisect bad master
> Is the
> only way to know I'm building 2.6.16-rc1 to branch from it as described
> in git-branch, even if I'm not planning on doing any development?

I do not quite understand. Immediately after the above example checkout, before or after doing the hackhack and commit, git branch would probably say:

	$ git branch
          origin
	  master
        * myhack

Immediately after the example checkout, "git describe myhack" would answer v2.6.16-rc1. OTOH, after the hackhack and commit, it would answer v2.6.16-rc1-gXXXXXXXX where XXXX part is an abbreviated commit object name of the commit you have at the tip of myhack branch.

To see what you did in the branch, the tag, if you remember where you forked from, can be used this way:

	$ git whatchanged -p v2.6.16-rc1..myhack
However, the above is equivalent to saying this:
	$ git whatchanged -p master..myhack

So in that sense tag is not that useful for the purpose of getting list of commits (or, more precicely, naming a development track).

It is useful to name a specific version:
	$ git diff v2.6.16-rc1 myhack
compares two versions; it is not equivalent to "git diff master myhack".
> Is this part of the concept that branches are cheap and you should feel
> free to create and throw them away at will?

That depends on what you exactly mean by "this", but all of the above are quite cheap. If the "myhack" practice turned out to be useless, you can just:

	$ git checkout master
        $ git branch -D myhack
to come back to the tip of the mainline and delete your side branch.
Linus Torvalds· Jan 18, 2006, 04:00 UTC · re: Junio C Hamano · lore

Re: [QUESTION] What is a tag for?

On Tue, 17 Jan 2006, Junio C Hamano wrote:
Show 5 quoted lines
> 
> <offtopic>
> Does anybody know where to obtain the public key to verify
> v2.6.16-rc1 tag?
> </offtopic>

Do a google search for "torvalds" and "tag signing key", and you'll find the thread that has the original key in it.

In fact, if you search for "torvalds" "tag" and "BEGIN PGP PUBLIC KEY BLOCK", it will be the first hit.

Anyway, here it is again. Linus' tag signing key. I could do what you do, but I feel that it's kind of pointless to put the public key with the project, since if you don't trust the project, you shouldn't trust the key it contains as being from me.

You fundamentally want to have some _other_ reason to trust the key, like the fact that you can find it independently with google ;)

		Linus
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.1 (GNU/Linux)

mQGiBEJqZ4s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hm0 ilHRM7OIbmm7uvFSlUJmUasuJRsrhibilbvNiEkEGBECAAkFAkJqZ4wCGwwACgkQ F3YsRnbiHLsolQCfRVImDkgijhPGmwyI7T19bWltXwsAniMi9gakkN+9DT8E5kli e8uTEk8f =PRrZ -----END PGP PUBLIC KEY BLOCK-----

Junio C Hamano· Jan 18, 2006, 04:40 UTC · re: Linus Torvalds · lore

Re: [QUESTION] What is a tag for?

Linus Torvalds <torvalds@osdl.org> writes:
> You fundamentally want to have some _other_ reason to trust the key, like 
> the fact that you can find it independently with google ;)
>
> 		Linus
True.  Here is mine, for google.
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.2 (GNU/Linux)

mQGiBEAXWL4RBAC1hDSYXpgyl8Dyyd+fcVH6wKiCTKsCv1AkdTQP0M+N/+2JbS1n okt+7UBbI31s2ZtXRmXjru1Kzq6Z/HLLsZCF1fH8iLXMe1YtVN81Rn9jpqPvs+l/ zvbVoVE/qwx0eHj/nl4jI9D8RYp8x+Ixor2MzNh/MKs02UtT8egPZVU3bwCgn7vF D+xpLwmUnWRaAqFhlRnjGKsD+wSAspa3k70LqatuasE8urLTUnDw+AYLfSI4QYXA S/uEDcV3VmeLpcV51YgsVqCDJk5jLe3EYENM6cFA5kGRZEPXqtwihXqXZuKD5m7j g/3cbrKELEZuYiGrRzgJwW43RWc1FpA2TwpxI8k+XlI5u1p2AXo8vP5OoZ28ePZX tXHdBACKlYxpeqspxgfZbFBlu1d0yPJqZkIaHzrZv7UOQPzvnFzTZSBk3ctx7ev8 AqYTUDZCm68yql4olTOvqlS/e6iQEU131NbEHvnq3BcXaKmr3L/rpo2b+LUyNKvu vrBrNIznnPobWMZQ+nAzcKg5QrJ7IMr4RbYBMrULkYtu62HoqLQfSnVuaW8gQyBI YW1hbm8gPGp1bmtpb0Bjb3gubmV0PoheBBMRAgAeBQJAF1i+AhsDBgsJCAcDAgMV AgMDFgIBAh4BAheAAAoJEMDG2aTzEZuau1EAoITfGTTGbFY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HgECF4AACgkQwMbZpPMRm5p1jACeJJpN/pzhXNIyIvHonUz/TOPzKVwA nRopEwhA93VM6wCRV3zoSIYdswRiuQGNBEAXWMEQBgCDx+4Wn6bUxy3BDkUV9Tu6 ozi+z4FVwmgUgR5loLp2ay1wksE8QresmJuY1Hxypb7ODpqqoEiXtULf5XEsUJCQ asYTkpWsUJjolfpiNwNaypfhZlA9rVpEhNEpupHmH4yqwd9NsULtE8Fy+8SWqPDm Is5/Nj1Z5XvOaZBSBMVGgNDbK6PN702tYU9b9PMDF0D4auIA6vZxmncF+fcTgCEZ kZjbwnQJgyb1bUpHyVwx2JIxHXVp8kyAKCezGYhrQx8AAwUGAIEzIeVo7C+Y5S8f QzIXjorF6TALyrjCAlr+/tGsRBl5XwXuSyMZ71JR6lJ751wjhW48qjOuWnJjNLP+ 6/AUjj/qibdoyZ/4Le9QlEbWJ6Et2wMdi1Dxp16EYoKO2EsGJOisxegJ4shUut0Q 2lETT5l2P78XmY+v8ZmaApRTPCVTIV4DQHoqPrmW7u9mfijR8KjqbLdfq7HCcXTV ZOu31gagtrjVRRtM2B0k/3wHADRR4O9rYLuJO4bQgFk95Uv7R4hJBBgRAgAJBQJA F1jBAhsMAAoJEMDG2aTzEZuanFQAn1O290ssuCN2APIWNs04nsOSYJV7AJwL+mWe 3ZMYGVhS3LY9Pa5ynxZLOA== =avEp -----END PGP PUBLIC KEY BLOCK-----

Petr Baudis· Jan 18, 2006, 09:58 UTC · re: Junio C Hamano · lore

Re: [QUESTION] What is a tag for?

Dear diary, on Wed, Jan 18, 2006 at 05:40:54AM CET, I got a letter where Junio C Hamano <junkio@cox.net> said that...

Show 8 quoted lines
> Linus Torvalds <torvalds@osdl.org> writes:
> 
> > You fundamentally want to have some _other_ reason to trust the key, like 
> > the fact that you can find it independently with google ;)
> >
> > 		Linus
> 
> True.  Here is mine, for google.

And here is my SuSE public key (which I use for signing Cogito tags) for Google to mine. (And for a record, my personal PGP key which I normally use for non-job related stuff is different and is available at my homepage; I've also signed this mail with it, FWIW.)

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.2 (GNU/Linux)

mQGiBELIc0YRBADDsuMs8bWaEB85db2PLgGan0vXLp2ztfhuG0iSvFqRxhqwLW4F RJuFp8+53dHzgSVSw7QETX0HeQCycg+dflKirhfQwJGmcm2Gkn9L3BtAhz855rug WLct4RL/j3eusIR6wyOfMaNsHglVXzQT5h9kn6p0h5pP2E+v177qlnhqKwCgmYbq eF5cEBUV2P/BMmXzVqBelGkD/jjAnsE38s+schg4xYZLTF1GLwnf7na3ddMLd2Pj o2V0KSSMZMaDJ7dHgCl9dTwiE2IDJxnqMbHuaE5QuUrzbpi7X47IkK8wHIbSUHOZ hyQBLiIJ2PXOSxwn6J4zIn2oysKwOsxbBE4RRJ90f/jpHw3q0P2YNtIgiQeyZZxi MbltBACv56gQKBNAebms4AXx/8pFHc+YeYaK1STMpRnR6pNKkREz/nfa0IGkf59n F+gARxEqjOPaCrNLEjwymAEmPJC/F46sgfOR5djihOs+GX4E4msqDE1Ht+jIc6xS 2M0tXLEZ5RAogJ53XyDsQnFBW1JyM9FKYiojoiRzlJB8FWuiPLQnUGV0ciBCYXVk aXMgKFN1U0UgTGFicykgPHBhc2t5QHN1c2UuY3o+iF4EExECAB4FAkLIc0YCGwMG CwkIBwMCAxUCAwMWAgECHgECF4AACgkQoqZU+9z5OURXUQCdHeDMjOoWkRZ47wJ4 7BkVu+siXC0Anjv9n+q15/h1My9e4NAr6X8GS217uQINBELIc0oQCAC1BRdneY8m Goayc37lc0/aSlypmpwNTu8CRFoxl/JTXoqW31czfVFes1tlSJaLRidBFF9gW/An KOIMhbOtMRZ4RGxorhrMYDjLQzYVkb1kJspMkG0BdCz3Cy3WKz/f4uvgImqOVx3E uP/6DwsidUite4m0xPPXMRip4bRuoBatI3K/6UyUkxxDJ44Mnd7CqpF4+4YXgZTy UuXRLo1P9/KcbcW+gngUBCQOjOYNLxup1rrRtcmP1qc2gmaNxUop6/zsBwuQPPVL 7iTgw00q9aVLSvFEXpjDl5qy+oau+kCeuza6liApOc5H18b6mXzEczn7vDF9XZwB /diPXrZsiYFfAAMHCACZD9PrSCSmYdnfgKX+qElOmOXHi59CYj2B/o8Qn0Yh0jjK 63aBdVviqUGfunkC+dZgcMYvS5anfiGzeOFa90/z9O2Mr+WdCR/JG3DHXpKhFSKj Ko6iQ6N6qnDcN1tskjfyv0cW+lEyCZjmgNqGBM7jGYVZ7JlOKtM/Jd9nzEo7HKjr m+MihsduyXzqkEqn6H8k1ZxvcxgnQwBaZUBMSbBbYNTewBR7GkOoiGwPUFUaIBjP CEyWjCEZmHRpGnKKxBLsxf7aUkr1JlEPFjDmx50YzxBAJ0oX1Y/ftePItPq9SzQM j5GItjrP0KKNdm6R7SgVyiq5jLDVHeKh3zMjRspliEkEGBECAAkFAkLIc0oCGwwA CgkQoqZU+9z5OUS99gCfV8ufkdnRSxVlv9Ej6nyUP1JBNo0An1/oDuJn8fcbfBFj RDJA/3ar4p+f =q7rT -----END PGP PUBLIC KEY BLOCK-----

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Of the 3 great composers Mozart tells us what it's like to be human,
Beethoven tells us what it's like to be Beethoven and Bach tells us
what it's like to be the universe.  -- Douglas Adams
Petr Baudis· Jan 18, 2006, 10:07 UTC · re: Junio C Hamano · lore

Re: [QUESTION] What is a tag for?

Dear diary, on Wed, Jan 18, 2006 at 02:41:27AM CET, I got a letter where Junio C Hamano <junkio@cox.net> said that...

Show 13 quoted lines
> Alex Bennee <kernel-hacker@bennee.com> writes:
> > Is the
> > only way to know I'm building 2.6.16-rc1 to branch from it as described
> > in git-branch, even if I'm not planning on doing any development?
> 
> I do not quite understand.  Immediately after the above example
> checkout, before or after doing the hackhack and commit, git
> branch would probably say:
> 
> 	$ git branch
>           origin
> 	  master
>         * myhack

Well if I understand it, at this point he would just periodically fetch and get the tags, and when a new release appears, he would merge it to myhack, and so on. Which is probably the only way if you don't have cg-seek (I thought git checkout could do it, but it doesn't seem to be the case), but I can see no advantage of doing it if you can just cg-seek (unless, after all, you do want to do some development). But just in case, with Cogito that would be:

	$ cg-switch -r v2.6.16-rc1 myhack
	# You need Cogito-0.17.GIT for this. It is equivalent to git
	# branch, I think.
	$ cg-fetch
	$ cg-fetch
	$ cg-fetch
	$ cg-merge v2.6.16-rc2
	$ cg-fetch
	$ cg-merge v2.6.16
	...
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Of the 3 great composers Mozart tells us what it's like to be human,
Beethoven tells us what it's like to be Beethoven and Bach tells us
what it's like to be the universe.  -- Douglas Adams
Andreas Ericsson· Jan 18, 2006, 10:35 UTC · re: Alex Bennee · lore

Re: [QUESTION] What is a tag for?

Alex Bennee wrote:
Show 11 quoted lines
> Hi,
> 
> So I want to track Linus's 2.6 git tree as well as do a little small
> time hacking. I'm not brave enough to sit on the very bleeding edge and
> build what ever happens to be at the "HEAD" of the tree. However when a
> kernel releases I'd like to build *that* kernel.
> 
> I keep thinking of tags like labels in the old convetional SCM case. Is
> this correct? I can see once I've done my update (fetch/cogito what
> ever) that these tags apear in my local tree:
> 

I'm not sure if you got the answer you wanted from Junio or Petr, so I thought I'd add my own explanation to this as well. If nothing else it might be useful for someone greping through the archives.

There are three types of tags: simple, annotated and signed+annotated. All tags work just as a branch head, except that you can't do 'git checkout' on it (i.e. it's a pointer to a particular commit, but lives in $GIT_DIR/refs/tags instead of $GIT_DIR/refs/heads).

Simple, or unannotated, tags are useful for creating anchor points so that you can jump to a particular state of development that's useful for you as a developer to know about (I for one think sha-hashes are a tad hard to remember). You could just as easily create a branch for doing this, but that's not always practical. F.e. when you're resetting or rebasing the current branch or doing some other of gits more voodoo-ish things. If you do

	$ git cat-file -t <tagname>

on a simple tag it'll tell you it's a "commit" object, because that's the type of the object it points to in the object database.

If you do the same on an annotated tag, whether it's signed or not, "git cat-file -t <tagname>" will tell you it's a 'tag' object.

A tag object has a reference to a commit-object and some additional data inside it. Try

	$ git cat-file tag v1.0.0

in the current git-repo and you'll see the following output ----8<---8<---8<---- object c2f3bf071ee90b01f2d629921bb04c4f798f02fa type commit tag v1.0.0 tagger Junio C Hamano <junkio@cox.net> 1135152060 -0800

GIT 1.0.0
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQBDqOh7wMbZpPMRm5oRAg+OAJ90pNi/fq5rguVou1PSxx95PYCVeACfbnZM nN/PlwOWKA3rW8EPmWO4BzE= =TCRg -----END PGP SIGNATURE----- ----8<----8<----8<----

'object' at the first line is the commit the tag points to. The rest should be fairly self-evident.

After the empty line there follows a message that the tagger can enter when typing the tag. This can be fairly useful if you wish to make it so. I use it to write a gisted changelog, listing new features and fixed bugs in a few words. All annotated tags that gets pushed to our shared repos are automatically, through the 'update' hook, sent by email to our sales and marketing people. I like that, since I only have to use one tool for hacking, reporting, logging history and everything else that's real developer work. It also means I never forget sending feature updates to the suits, so they pester me less and life is a bit sweeter.

A signed annotated tag requires that you have a valid gpg key. The tag shown above is signed using gpg (the only way of signing supported, I think).

So, in essence;
* A simple, or unannotated tag just points to a commit object and has no 
message attached to it.
* An annotated tag points to a tag object and has a message of arbitrary 
length attached to it. The tag object points to a commit object.
* Only annotated tags can be signed.

I'd recommend not allowing un-annotated tags in your shared repo. I sent a patch for the default update-hook sometime ago that disallows this. Junio seemed happy about it so I don't understand why it hasn't been pushed to the master branch yet.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Junio C Hamano· Jan 18, 2006, 18:19 UTC · re: Andreas Ericsson · lore

Re: [QUESTION] What is a tag for?

Andreas Ericsson <ae@op5.se> writes:
> I'd recommend not allowing un-annotated tags in your shared repo. I
> sent a patch for the default update-hook sometime ago that disallows
> this. Junio seemed happy about it so I don't understand why it hasn't
> been pushed to the master branch yet.

Most likely lost in the noise. I probably have it in my mailbox but not applied in any of my private branches in my repository.

Andreas Ericsson· Jan 18, 2006, 18:50 UTC · re: Junio C Hamano · lore

Re: [QUESTION] What is a tag for?

Junio C Hamano wrote:
Show 12 quoted lines
> Andreas Ericsson <ae@op5.se> writes:
> 
> 
>>I'd recommend not allowing un-annotated tags in your shared repo. I
>>sent a patch for the default update-hook sometime ago that disallows
>>this. Junio seemed happy about it so I don't understand why it hasn't
>>been pushed to the master branch yet.
> 
> 
> Most likely lost in the noise.  I probably have it in my mailbox
> but not applied in any of my private branches in my repository.
> 

I'll apply (and test) Linus suggestions of new refs and re-send it when I'm done watching King-Kong and stuffing my face with popcorn.

-
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Junio C Hamano· Jan 25, 2006, 02:08 UTC · re: Andreas Ericsson · lore

Re: [QUESTION] What is a tag for?

Andreas Ericsson <ae@op5.se> writes:
> I'll apply (and test) Linus suggestions of new refs and re-send it
> when I'm done watching King-Kong and stuffing my face with popcorn.

It appears you have not finished watching the movie yet, so I took the liberty of adding this on top of your patch myself ;-).

Andreas Ericsson· Jan 25, 2006, 09:02 UTC · re: Junio C Hamano · lore

Re: [QUESTION] What is a tag for?

Junio C Hamano wrote:
Show 11 quoted lines
> Andreas Ericsson <ae@op5.se> writes:
> 
> 
>>I'll apply (and test) Linus suggestions of new refs and re-send it
>>when I'm done watching King-Kong and stuffing my face with popcorn.
> 
> 
> It appears you have not finished watching the movie yet, so I
> took the liberty of adding this on top of your patch myself
> ;-).
> 

Sorry about that. I started adding stuff to it to disallow creating branches that have no unique commits, and then thought of some other fun stuff that's a bit specific to the place I work so I never got around to it.

Somehow the phb's never grow tired of coming up with new ways to waste my time just when I've found a way to save some, forcing me to find a way to find some more. Anyways, if anybody wants an update-hook to update a project-management tool with worked time, gimme a holler. It's quite neat but completely flawed in a good way. :)

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

← back to recent threads