All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Theodore Tso <tytso@mit.edu>, Alex Riesen <raa.lkml@gmail.com>,
	Alex Bennee <kernel-hacker@bennee.com>,
	git@vger.kernel.org
Subject: Re: git-pull and tag objects
Date: Sun, 11 Feb 2007 13:41:23 -0800	[thread overview]
Message-ID: <7v3b5ce5j0.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <Pine.LNX.4.64.0702111124410.8424@woody.linux-foundation.org> (Linus Torvalds's message of "Sun, 11 Feb 2007 11:25:15 -0800 (PST)")

Linus Torvalds <torvalds@linux-foundation.org> writes:

> On Sun, 11 Feb 2007, Junio C Hamano wrote:
>> 
>> Well, what you are saying is that it used to be Ok in Jul 5 2005
>> version but with tag following it is not Ok anymore, isn't it?
>
> Do we actually do it with automatic tag following? I tested, and it didn't 
> do anything bad for me.

You are right.

The only iffy case that is remaining is "git fetch --tags $URL".
The user is explicitly saying "I want all tags from there", but
the user may not be expecting tags that are already present in
the local repository to be overwritten.

The filtering on the auto-follow codepath Johannes added with
"git-show-ref --exclude-existing" would fix this case as well.

-- >8 --
[PATCH] "git-fetch --tags $URL" should not overwrite existing tags

Use the same --exclude-existing filter as we use for automatic
tag following to avoid overwriting existing tags with replacement
ones the other side created.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
diff --git a/git-fetch.sh b/git-fetch.sh
index 357cac2..ca984e7 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -253,23 +253,10 @@ if test "$tags"
 then
 	taglist=`IFS='	' &&
 		  echo "$ls_remote_result" |
+		  git-show-ref --exclude-existing=refs/tags/ |
 	          while read sha1 name
 		  do
-			case "$sha1" in
-			fail)
-				exit 1
-			esac
-			case "$name" in
-			*^*) continue ;;
-			refs/tags/*) ;;
-			*) continue ;;
-			esac
-		  	if git-check-ref-format "$name"
-			then
-			    echo ".${name}:${name}"
-			else
-			    echo >&2 "warning: tag ${name} ignored"
-			fi
+			echo ".${name}:${name}"
 		  done` || exit
 	if test "$#" -gt 1
 	then

  reply	other threads:[~2007-02-11 21:41 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-08 11:16 git-pull and tag objects Alex Bennee
2007-02-09  9:33 ` Alex Riesen
2007-02-09 23:19   ` Junio C Hamano
2007-02-10  0:14     ` [PATCH] git-fetch: document automatic tag following Junio C Hamano
2007-02-10 14:23     ` git-pull and tag objects Theodore Tso
2007-02-10 17:56       ` Linus Torvalds
2007-02-10 21:32         ` Jakub Narebski
2007-02-10 21:58           ` Linus Torvalds
2007-02-11 21:55             ` Junio C Hamano
2007-02-12  0:40               ` Jakub Narebski
2007-02-11  0:25         ` Theodore Tso
2007-02-11  3:21           ` Linus Torvalds
2007-02-11  5:52         ` Junio C Hamano
2007-02-11 17:49           ` Linus Torvalds
2007-02-11 19:17             ` Junio C Hamano
2007-02-11 19:21               ` Junio C Hamano
2007-02-11 19:25               ` Linus Torvalds
2007-02-11 21:41                 ` Junio C Hamano [this message]
2007-02-12 16:27           ` Theodore Tso
2007-02-13  6:17             ` Junio C Hamano
2007-02-14  6:38               ` Linus Torvalds
2007-02-14  7:22                 ` Junio C Hamano
2007-02-14 11:18                   ` Johannes Schindelin
2007-02-14 16:35                     ` Linus Torvalds
2007-02-15  1:21                 ` Jakub Narebski
2007-02-15  1:34                   ` Johannes Schindelin

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=7v3b5ce5j0.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=kernel-hacker@bennee.com \
    --cc=raa.lkml@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    /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.