git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Martin Nicolay <m.nicolay@osm-ag.de>
To: git@vger.kernel.org
Subject: missing tags from "git fetch"
Date: Wed, 2 Oct 2019 15:10:12 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LSU.2.20.1910021431130.32588@cpza.bfz-tzou.qr> (raw)

[-- Attachment #1: Type: text/plain, Size: 3059 bytes --]

Hi!

I don't know if this is a lack of understanding or a software or 
documentation bug.

man git-fetch says about tags:
        By default, any tag that points into the histories being fetched is
        also fetched; the effect is to fetch tags that point at branches that
        you are interested in.

If I fetch without --tags the tags that point to the commits of the 
fetched branch are not fetched. If I fetch with --tags than all tags are 
fetched but I only wish to fetch tags pointing to something in the 
branch fetched.

Here is a self contained example:
--------------------------
$ cd /tmp
$ git init r1 && cd r1
Initialized empty Git repository in /tmp/r1/.git/
$ date >f1
$ git add f1
$ git commit -minitial f1
[master (root-commit) 61753c60ac] initial
  1 file changed, 1 insertion(+)
  create mode 100644 f1
$ git tag -mt1 t1
$ git tag t2
$ git init ../r2 && cd ../r2
Initialized empty Git repository in /tmp/r2/.git/
$ git remote add origin $(cd ../r1; pwd)
$ git fetch origin master
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From /tmp/r1
  * branch                  master     -> FETCH_HEAD
  * [new branch]            master     -> origin/master
$ git tag | wc
       0       0       0
$ git fetch --tags origin master
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 1 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (1/1), done.
From /tmp/r1
  * branch                  master     -> FETCH_HEAD
  * [new tag]               t1         -> t1
  * [new tag]               t2         -> t2
$ git tag | wc
       2       2       6
$ git rev-parse FETCH_HEAD
61753c60ac550a5315b7c930a701b94f36e08e4f
$ git rev-parse t1^{commit}
61753c60ac550a5315b7c930a701b94f36e08e4f
$ git rev-parse t2^{commit}
61753c60ac550a5315b7c930a701b94f36e08e4f
--------------------------

Obviously the two tags point to the fetched commit but without --tags 
they are not fetched. The behavior is identical for lightweight and 
annotated tags.

Best regards
Martin Nicolay

-- 

No MS-Word attachments (http://www.gnu.org/philosophy/no-word-attachments.html)
_______________________________________________________________________________
OSM AG | Ruhrallee 191 | 45136 Essen | Fon: 0201-89 555 | Fax: 0201-89 55 400
web: www.osm-ag.de | e-mail: info@osm-ag.de
IBAN: DE67 4325 0030 0001 0059 82 | BIC: WELADED1HRN
USt-ldNr.: DE163337313 | HRB: 28171 Essen
Aufsichtsratsvorsitzende: Dipl.-Kff. Sabine Elsas
Vorstand: Johannes Kuhn (Vorsitzender), Christian Damsky, Axel Roland

--
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht
gestattet.
_______________________________________________________________________________

             reply	other threads:[~2019-10-02 13:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 13:10 Martin Nicolay [this message]
2019-10-02 13:55 ` missing tags from "git fetch" Jeff King
2019-10-02 15:24   ` Martin Nicolay
2019-10-25 10:17   ` Martin Nicolay
2019-11-22 13:00     ` Jeff King

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LSU.2.20.1910021431130.32588@cpza.bfz-tzou.qr \
    --to=m.nicolay@osm-ag.de \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).