Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Petr Baudis <pasky@suse.cz>
Cc: git@vger.kernel.org
Subject: cg-fetch auto-following tags
Date: Sat, 15 Oct 2005 17:58:44 -0700	[thread overview]
Message-ID: <7vfyr2i8fv.fsf@assigned-by-dhcp.cox.net> (raw)

In cg-fetch, you have some code at the bottom starting with:

	$get -i -s -u -d "$uri/refs/tags" "$_git/refs/tags" || rsyncerr=1

Under http, I presume get is get_http which is recursive wget to
slurp all tags to .git/refs/tags?

Earlier you were talking about fetching tags automatically as
the user follows a branch (or multiple branches) development,
but the current git-http-fetch's semantics of making sure the
repository has all the reachable objects when slurping from a
ref makes it impossible, and you are playing things safer by
essentially cloning the remote repository.

The latest "master" branch of git-core sends unwrapped tag
information to make this easier to implement.  I think you
should be able to do something like this (between "FIXME: Warn
about conflicting tag names?" and "rm fetch-$name-dirty").

        git-ls-remote --tags $uri/ |
	# SHA1 refs/tags/v0.99.8^{} --> SHA1 tags/v0.99.8
	# where SHA1 is the object v0.99.8 tag points at.
        sed -ne 's:\([^	]\)	refs/\(tags/.*\)^{}$:\1	\2:p' |
        while read sha1 tagname
        do
		# do we have the object pointed at by the tag?
                git-cat-file -t "$sha1" >/dev/null 2>&1 ||
                continue

                # if so, fetch the tag -- which should be a
                # cheap operation -- to complete the chain.
                $fetch "$tagname" "$uri" "$tagname"
        done

This sample code assumes your $fetch implements the same
semantics for various transports ($1 is the ref to fetch, $2 is
the repo url, $3 is the local ref to write into); I only checked
http transport in your code.

                 reply	other threads:[~2005-10-16  0:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=7vfyr2i8fv.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=pasky@suse.cz \
    /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