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

ci-status won't work with 7-digits commit SHA #2266

Closed
joshuabezaleel opened this issue Sep 13, 2019 · 4 comments
Closed

ci-status won't work with 7-digits commit SHA #2266

joshuabezaleel opened this issue Sep 13, 2019 · 4 comments
Labels

Comments

@joshuabezaleel
Copy link

I tried to run hub ci-status with the short version of the commit SHA but it won't work. The commit that I am going to refer to can be found here.

command: hub ci-status e039ab0
output: Aborted: no revision could be determined from 'e039ab0'

command: hub ci-status e039ab02669ab9f2559458ad52296ee762563dee
output: failure

@mislav
Copy link
Owner

mislav commented Sep 13, 2019

Hub resolves the short SHA using git rev-parse -q SHA. It looks like the SHA you pasted could not be resolved in my local git repo, and neither in yours it seems. It might be because it's coming from a fork and not the main repo?

How would you expect e039ab0 to be resolved in this case?

@mislav mislav added the bug label Sep 13, 2019
@joshuabezaleel
Copy link
Author

I am sorry beforehand, I forgot which PR is that commit SHA from.
Let's just say we take the example of this PR.
The latest commit has the long SHA of d7de991be83337de2d5b8dce29c6cd7b6f0a8bd5 and the short 7-digit SHA of d7de991.

I attached the screenshot below that the hub ci-status command works with the long version of the SHA but not with the short version of the SHA. Is this the expected behavior?

Thank you very much! 🙂

image

@mislav
Copy link
Owner

mislav commented Oct 9, 2019

I attached the screenshot below that the hub ci-status command works with the long version of the SHA but not with the short version of the SHA. Is this the expected behavior?

It may be surprising, but I think this is expected behavior. Our local git repos cannot resolve the short SHA into the full commit ID because they don't contain that commit; it comes from a fork. (The commit would be resolved if we pulled from that specific fork.)

When using the full commit ID, it is passed unchanged to the API and it is found there.

The general rule is that it's usually better to use full commit SHAs rather than short ones. If you use short ones, you should ensure that your local git repo can resolve them to something.

Does this make sense?

@joshuabezaleel
Copy link
Author

Ah now that make sense. Sorry for the question.
Thank you for the explanation! 🙂 I am goign to close this Issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants