Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: cheng renquan <crquan@gmail.com>
Subject: Re: [PATCH] git fetch one tag only
Date: Thu, 07 Jun 2012 10:08:41 -0700	[thread overview]
Message-ID: <7v8vfzjbhi.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vpq9bk7o5.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Wed, 06 Jun 2012 22:33:30 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> It is a separate matter if we should add some special case to further
> reduce the cases where auto-following happens. I personally do not
> think any change is needed.

I do not care too deeply either way, but after doing

	$ git init blank && cd blank

and in an empty repository:

        $ git fetch $over_there v1.0.0

will grab the named tag and drop it in FETCH_HEAD, without adding
anything to your local refs, while

	$ git fetch $over_there tag v1.0.0

will grab the named tag and copy it to your refs/tags/v1.0.0, and
auto-follow all the tags that point at commits that are reachable.

To grab and store _only_ v1.0.0 in the local refs, you need to say
"do not auto-follow" with

	$ git fetch $over_there --no-tags tag v1.0.0

While it may be workable, the user experience could be better in a
couple of different ways.

 * It is not fair to expect anybody to guess that "--no-tags" means
   "--no-auto-follow-tags" without reading documentation.

	$ git fetch $over_there --no-auto-follow-tags tag v1.0.0

   might be an improvement, but of course, it is a bit longer to
   spell ;-).

 * The auto-follow kicks in whenever you tell "fetch" to update some
   refs locally.  Maybe if we tweak the rule and auto-follow kick in
   only when you tell "fetch" to update some refs outside refs/tags
   locally,

	$ git fetch $over_there tag v1.0.0

   will fetch and store _only_ the v1.0.0 tag.

   Of course, any behaviour change is a regression, and if done
   without an escape hatch, such a change robs people one useful
   feature: grab tag v1.0.0 and others older than that tag in one
   go.

I won't be coding any of the above; just thinking aloud. 

  parent reply	other threads:[~2012-06-07 17:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07  1:40 [PATCH] git fetch one tag only cheng renquan
2012-06-07  4:37 ` Junio C Hamano
2012-06-07  5:17   ` cheng renquan
2012-06-07  5:33     ` Junio C Hamano
2012-06-07  5:47       ` cheng renquan
2012-06-07 16:11         ` cheng renquan
2012-06-07 17:08       ` Junio C Hamano [this message]
2012-06-08 21:46         ` cheng renquan
2012-06-08 22:22           ` Junio C Hamano

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=7v8vfzjbhi.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=crquan@gmail.com \
    --cc=git@vger.kernel.org \
    /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