Web lists-archives.com

Re: git replace --graft does error checking too late

On Wed, Mar 27, 2019 at 2:11 PM Christian Couder
<christian.couder@xxxxxxxxx> wrote:
> On Wed, Mar 27, 2019 at 11:24 AM Andreas Schwab <schwab@xxxxxxx> wrote:
> >
> > When running `git replace --graft A B' where B is a non-commit (eg. a
> > tag) it displays an error,
> Yeah, it seems that when A is a commit and B a tag I get:
> "error: object A is a tag, not a commit"
> which is wrong as A is a commit.

Actually I get the above only if A is a commit but there is a tag
pointing to it. If there is no tag pointing to it I get:

error: object C is a tag, not a commit

where C is the hash of the tag object B (C=$(git rev-parse B))

So yeah, this is weird.