git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-tag bug? confusing git fast-export with double tag objects
@ 2009-05-14  0:53 Matthias Andree
  2009-05-14  2:13 ` Matthias Andree
  0 siblings, 1 reply; 30+ messages in thread
From: Matthias Andree @ 2009-05-14  0:53 UTC (permalink / raw)
  To: git

Greetings,

I found a way to break git fast-export accidentally. I'm looking at the  
master branch, currently v1.6.3.1-9-g95405ba for me.

The short story is, I tried to regenerate signed tag objects after  
doctoring the history in a repo to fix b0rked addresses after conversion,  
doing something like:

	git tag -f -s foo foo

when I should have done

	git tag -f -s foo foo^{commit}

Now I have  tag "foo" twice in my repo, and this screws some operations  
royally.

Here's a script to generate such a b0rked repo:

#! /bin/sh
#
# On your marks
set -eu
IFS=$(printf '\n\t')
#
# Set
dir=$(mktemp -d)
cd $dir
git init
echo foo >bar
git add bar
git commit -m "add bar"
git tag -s baz -m "tag bar as baz"
#
# Go - this is correct, but we'll do wrong
#git tag -f -s baz baz^{commit} -m "regenerate tag"
#
# This is wrong and confuses git fast-export:
git tag -f -s baz baz -m "regenerate tag"
#
# Print the result
git show baz


This is quite prominent in git fast-export --all --signed-tags=strip  
output:

...
tag baz
 from :2
tagger Matthias Andree <matthias.andree@gmx.de> 1242259705 +0200
data 15
tag bar as baz

tag baz
 from :0
tagger Matthias Andree <matthias.andree@gmx.de> 1242259705 +0200
data 11
regenerate

And the "from :0" hunk kills git fast-import afterwards as the mark :0  
isn't defined. Not sure if it could cope with a duplicate tag otherwise.  
Probably not how git-tag should behave.

Questions:

1. how do I get a list of all such tags? git tag -l doesn't work. git  
rev-list --all is a bit unspecific for my taste, and not very helpful...

2. how do I trash the accidentally created 2nd "baz" tag object, i. e.  
remove it from the (packed) object database? Of course, I can hack some  
script (or use a text editor) to grind this git-fast-export into shape and  
re-importing it...

3. is this a shortcoming in git tag that doesn't properly resolve its 2nd  
non-option argument to a commit?

Thanks.

-- 
Matthias Andree

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2009-05-19 11:29 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-14  0:53 git-tag bug? confusing git fast-export with double tag objects Matthias Andree
2009-05-14  2:13 ` Matthias Andree
2009-05-14  3:18   ` Junio C Hamano
2009-05-14  9:37     ` Matthias Andree
2009-05-14 12:00       ` Michael J Gruber
2009-05-14 12:16       ` Alex Riesen
2009-05-14 12:51         ` Matthias Andree
2009-05-14 13:16           ` Alex Riesen
2009-05-14 13:39             ` Matthias Andree
2009-05-14 13:42               ` Sverre Rabbelier
2009-05-14 18:02                 ` Matthias Andree
2009-05-14 19:01                   ` Brandon Casey
2009-05-14 18:22       ` Jeff King
2009-05-14 22:35         ` Matthias Andree
2009-05-15  2:02           ` Jeff King
2009-05-15 12:23             ` Matthias Andree
2009-05-15 13:22               ` Jakub Narebski
2009-05-15 14:54                 ` Johannes Sixt
2009-05-15 15:51                   ` Alex Riesen
2009-05-15 16:14                     ` Matthias Andree
2009-05-15 16:21                     ` Andreas Ericsson
2009-05-15 17:40                       ` Junio C Hamano
2009-05-16  7:14                         ` Andreas Ericsson
2009-05-16  7:56                           ` Jakub Narebski
2009-05-16  8:02                             ` Andreas Ericsson
2009-05-16 17:16                           ` Junio C Hamano
2009-05-19 11:21                             ` Matthias Andree
2009-05-19 11:29                               ` Jeff King
2009-05-16  5:07               ` Jeff King
2009-05-15 16:00       ` Daniel Cheng

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 NNTP newsgroup(s).