Skip to content

tag: libra tag <name> <commit> rejects an explicit target commit #498

Description

@genedna

Summary

libra tag <name> <commit> is rejected, so a tag can only be created at HEAD. Git accepts an explicit target (git tag <name> <commit>, git tag -m <msg> <name> <commit>).

Reproduction (libra 0.22.33)

libra init --vault false
printf 'base\n' > a.txt && libra add a.txt && libra commit -m init
libra branch side
printf 'main\n' > a.txt && libra add a.txt && libra commit -m m

libra tag vside side
# error: unexpected argument 'side' found
# Usage: libra tag [OPTIONS] [NAME]           (exit 129, LBR-CLI-002)

libra tag -m msg vann side                   # same error
libra rev-parse vside                        # not a valid object name: 'vside'

Scripts that pass a target silently end up without the tag, and a later libra merge vside or libra merge refs/tags/vside then fails with not something we can merge (exit 129), which looks like a merge problem even though tag merges work once the tag exists.

Git 2.54.0

git tag vside side creates refs/tags/vside pointing at side; git tag -m msg vann side creates an annotated tag whose object points at side.

Expected

Accept an optional <commit> (any commit-ish, including branch names and other tags) after <name> for lightweight and annotated tags (-m, -F, -s, -f), resolve it like other revision arguments, and keep creating at HEAD when it is omitted. The clap definition is TagArgs in src/command/tag.rs:41-44 (a single optional name).

Found while measuring behavior for #477; it is outside that plan's scope.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtestvcs

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions