Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

something like git name-rev to get branch of commit #1268

Open
m4rch3n1ng opened this issue Feb 1, 2024 · 1 comment
Open

something like git name-rev to get branch of commit #1268

m4rch3n1ng opened this issue Feb 1, 2024 · 1 comment
Labels
acknowledged an issue is accepted as shortcoming to be fixed enhancement New feature or request help wanted Extra attention is needed

Comments

@m4rch3n1ng
Copy link

m4rch3n1ng commented Feb 1, 2024

Summary 💡

$ git name-rev --no-undefined --always 4e2fd00 2> /dev/null
4e2fd00 main~2

i think gitoxide is missing something like that

Motivation 🔦

i am (re-)writing my shell integration in rust and i want to show the branch the commit is on

(technically i am currently using the command git name-rev --no-undefined --always --exclude="tags/*" --exclude="stash" --exclude="remotes/*" --exclude=" bisect/*" 4e2fd00 2> /dev/null to get that information)

i couldn't find a way to replicate that using gitoxide and i can't fully rewrite my shell integration without it

@m4rch3n1ng m4rch3n1ng added the enhancement New feature or request label Feb 1, 2024
@Byron
Copy link
Member

Byron commented Feb 2, 2024

Thanks for sharing your particular use-case.

It is true that right now, only the equivalent of git describe is supported, and name-rev would be another algorithm to implement one day for parity.

It looks like the algorithm is quite compact and more simple than the one of git describe, which should help with an implementation once it's tackled.

Please note that it's not on my short list of things to do right onw

@Byron Byron added help wanted Extra attention is needed acknowledged an issue is accepted as shortcoming to be fixed labels Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged an issue is accepted as shortcoming to be fixed enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants