All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Francis Moreau <francis.moro@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: Lightweight tag ?
Date: Mon, 12 Jan 2009 13:55:04 +0100	[thread overview]
Message-ID: <496B3DA8.1040308@drmicha.warpmail.net> (raw)
In-Reply-To: <m2bpucnas2.fsf@gmail.com>

Francis Moreau venit, vidit, dixit 01/12/09 10:17:
> Hello,
> 
> Junio C Hamano <gitster@pobox.com> writes:
> 
>> Don't use explicit --tags blindly.  It says "no matter what kind of tag,
>> transfer everything under refs/tags".  Otherwise you won't see a
>> difference.
> 
> Well:
> 
> 	$ git --version
> 	git version 1.6.0.4
> 	$ mkdir test-tag
> 	$ cd test-tag/
> 	$ date > A
> 	$ git init
> 	Initialized empty Git repository in
> 	/home/fmoreau/tmp/git/test-tag/.git/
> 	$ git add .
> 	$ git commit -a -s -m "Init"
> 	Created initial commit be8750e: Init
> 	 1 files changed, 1 insertions(+), 0 deletions(-)
> 	 create mode 100644 A
> 	$ cd ..
> 	$ git clone --bare test-tag test-tag.git
> 	Initialized empty Git repository in /home/fmoreau/tmp/git/test-tag.git/
> 	$ cd test-tag
> 	$ git tag light
> 	
> 	$ git tag -a -m "Annoted tag" annoted
> 	$ git push ../test-tag.git
> 	Everything up-to-date
> 	$ git push --tags ../test-tag.git
> 	Counting objects: 1, done.
> 	Writing objects: 100% (1/1), 166 bytes, done.
> 	Total 1 (delta 0), reused 0 (delta 0)
> 	Unpacking objects: 100% (1/1), done.
> 	To ../test-tag.git
> 	 * [new tag]         annoted -> annoted
> 	 * [new tag]         light -> light
> 
> It looks like they're no difference for git-push...
> 
> That said the documentation about this is rather cryptic IMHO:
> 
> ,----[ man git-push ]
> | 	--tags
> | 	    All refs under $GIT_DIR/refs/tags are pushed, in
> | 	    addition to refspecs explicitly listed on the command
> | 	    line.
> `----
> 
> From a user point of view, the word lightweight is missing here. Why
> not simply saying:
> 
> ,----
> | All kind of tags are pushed with this option _otherwise_ only annoted
> | tags are pushed
> `----

Your test above confirms that the description is correct and nothing is
missing. "git push" pushes explicitly listed refspecs (or : as a
default). It pushes tags (light and heavy) when asked to.

"git pull" pulls tags if they can be reached from heads which are
pulled. It pulls all tags only when asked to.

In fact, the automatic following of tags (if they can be reached...)
depends on the transport, because typically you want to clone everything
if you clone locally but don't want all tags if you clone/pull from a
remote. There is also a config "tagopt" for overriding this. It's
mentioned but not really explained in "git tag"'s man page.

So, "non-local" tags are the ones which can be reached from heads which
you pull, and local ones are the others. I don't think lightweight tags
are more local than tag objects (please correct me if I'm wrong; I think
this needs more doc). It's just that the latter reside in the object db
store whereas the former are simple refs under refs/tags.

Michael

  reply	other threads:[~2009-01-12 12:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-11 18:44 Lightweight tag ? Francis Moreau
2009-01-11 21:04 ` Junio C Hamano
2009-01-12  9:17   ` Francis Moreau
2009-01-12 12:55     ` Michael J Gruber [this message]
2009-01-12 13:56       ` Francis Moreau
2009-01-12 14:54         ` Michael J Gruber
2009-01-12 19:52           ` Junio C Hamano
2009-01-12 20:50           ` Francis Moreau

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=496B3DA8.1040308@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=francis.moro@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.