Skip to content

Revisions cannot contains the character @ #802

Closed
@lthms

Description

@lthms

Duplicates

  • I have searched the existing issues

Current behavior 😯

The function gix_revision::spec::parse::function::parse (in gix-revision/src/spec/parse/function.rs does not support revision which contains the character @.

For instance, at work, we have the guidelines to prefix our branches names by our handle, so my branch looks like lthms@fix-something.

I’ve run into the issue because I am using Stacked Git, which has moved from its previous git library to gitoxide (see stacked-git/stgit#306). Since I’ve upgraded, I get errors related to branch names with @, and after some digging, I was able to isolate the parse function.

Expected behavior 🤔

git branch and git rev-parse handle branches with @ in their name gracefully.

I would have expected that gix would do so too. But maybe it is not a goal? I’ve seen that there are tests explicitely checking that gix fails in these cases (in gix-revision-tests, in refnames.rs).

I am trying to get my head around the code, but so far it’s a bit hard to follow. Any help is welcome.

Steps to reproduce 🕹

  1. git branch a@b
  2. cargo run rev resolve a@b

Result is

Error: The ref partially named "a" could not be found

Metadata

Metadata

Assignees

No one assigned

    Labels

    acknowledgedan issue is accepted as shortcoming to be fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions