# Git subtree stumbles over annotated tags

3 messages from 2016-03-10 to 2016-05-21. Participants: Gregor Jasny, David A. Greene.
Thread: https://gitlist.dev/t/41664

## Gregor Jasny, 2016-03-10 15:51

Subject: Git subtree stumbles over annotated tags
Message-ID: <56E19809.5040305@googlemail.com>
URL: https://gitlist.dev/e/56E19809.5040305%40googlemail.com

```
Hello,

today I discovered that it's a bad idea to "git subtree pull" from an
annotated tag. This issue got discussed in those two threads:

http://comments.gmane.org/gmane.comp.version-control.git/247503
http://comments.gmane.org/gmane.comp.version-control.git/248395

I was under the impression that it is fixed in recent versions of git
but my homebrew 2.7.0 still behaves badly. If I run the attached script
to reproduce the issue I get the following error message:

> git push using:  sub somebranch
> fatal: 6d621d73ca18dc90424de0929357b5ae62988e00 is not a valid 'commit' object
> Can't copy commit ab38e3fe1ff27f7f87505db37d35adc5c3ceed27

> git ls-remote sub
> 99be40f8e3a4c926d45507be53ab6918789b3a52	HEAD
> 99be40f8e3a4c926d45507be53ab6918789b3a52	refs/heads/master
> 6d621d73ca18dc90424de0929357b5ae62988e00	refs/tags/sometag
> 99be40f8e3a4c926d45507be53ab6918789b3a52	refs/tags/sometag^{}

Besides handling this bug could you please give me a hint how to repair
my main repository? The problematic subtree pull happened some time ago
so I cannot alter the pull itself. I could go the brutal approach and
remove, then re-add the subtree but I guess there is a smarter approach.
Any help is appreciated!

Thanks,
Gregor

```

## Gregor Jasny, 2016-03-17 12:41

Subject: Re: Git subtree stumbles over annotated tags
Message-ID: <56EAA5DC.1040801@googlemail.com>
URL: https://gitlist.dev/e/56EAA5DC.1040801%40googlemail.com
In-Reply-To: <56E19809.5040305@googlemail.com>

```
Hello,

On 10/03/16 16:51, Gregor Jasny wrote:
> today I discovered that it's a bad idea to "git subtree pull" from an
> annotated tag. This issue got discussed in those two threads:
>
> http://comments.gmane.org/gmane.comp.version-control.git/247503
> http://comments.gmane.org/gmane.comp.version-control.git/248395
>
> I was under the impression that it is fixed in recent versions of git
> but my homebrew 2.7.0 still behaves badly. If I run the attached script
> to reproduce the issue I get the following error message:

For the record: this bug was already fixed in November:
https://github.com/git/git/commit/5d65fe312e22594b7fec7349945fb0072987716b#diff-59f70cbe935ec223e3df413b94cab740

Would it make sense to cherry-pick it into 2.7.x?

Thanks,
Gregor

```

## David A. Greene, 2016-05-21 23:02

Subject: Re: Git subtree stumbles over annotated tags
Message-ID: <87iny7ovzi.fsf@waller.obbligato.org>
URL: https://gitlist.dev/e/87iny7ovzi.fsf%40waller.obbligato.org
In-Reply-To: <56EAA5DC.1040801@googlemail.com>

```
Gregor Jasny <gjasny@googlemail.com> writes:

> Hello,
>
> On 10/03/16 16:51, Gregor Jasny wrote:
>> today I discovered that it's a bad idea to "git subtree pull" from an
>> annotated tag. This issue got discussed in those two threads:
>>
>> http://comments.gmane.org/gmane.comp.version-control.git/247503> http://comments.gmane.org/gmane.comp.version-control.git/248395>
>> I was under the impression that it is fixed in recent versions of git
>> but my homebrew 2.7.0 still behaves badly. If I run the attached script
>> to reproduce the issue I get the following error message:
>
> For the record: this bug was already fixed in November:
> https://github.com/git/git/commit/5d65fe312e22594b7fec7349945fb0072987716b#diff-59f70cbe935ec223e3df413b94cab740
>
> Would it make sense to cherry-pick it into 2.7.x?

I wouldn't object to it if you can prepare the patch but git-subtree is
under heavy development and I don't have the free cycles to maintain a
"release" version of it.

                      -David

```
