From: Junio C Hamano <junkio@cox.net>
To: Alex Bennee <kernel-hacker@bennee.com>
Cc: git@vger.kernel.org
Subject: Re: [QUESTION] What is a tag for?
Date: Tue, 17 Jan 2006 17:41:27 -0800 [thread overview]
Message-ID: <7v1wz648jc.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 1137538344.9104.34.camel@malory
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.
next prev parent reply other threads:[~2006-01-18 1:41 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-17 22:52 [QUESTION] What is a tag for? Alex Bennee
2006-01-17 23:05 ` Petr Baudis
2006-01-18 1:41 ` Junio C Hamano [this message]
2006-01-18 4:00 ` Linus Torvalds
2006-01-18 4:40 ` Junio C Hamano
2006-01-18 9:58 ` Petr Baudis
2006-01-18 10:07 ` Petr Baudis
2006-01-18 10:35 ` Andreas Ericsson
2006-01-18 18:19 ` Junio C Hamano
2006-01-18 18:50 ` Andreas Ericsson
2006-01-25 2:08 ` Junio C Hamano
2006-01-25 9:02 ` Andreas Ericsson
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v1wz648jc.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=kernel-hacker@bennee.com \
/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.
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 NNTP newsgroup(s).