How to get a bzr revno of a git sha1?

Asked by Eli Zaretskii

After cloning a git repository (well, actually the master branch) with "bzr branch", how can I get a bzr revno that corresponds to a given git sha1 value? This is sometimes necessary when people who access the same repository with git point to a specific revision by giving its sha1 value.

Also, it would be nice if "bzr status" would show the git sha1 together with the bzr revno, like "bzr pull" does.

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Git Plugin Edit question
Assignee:
No assignee Edit question
Solved by:
Eli Zaretskii
Solved:
Last query:
Last reply:
Revision history for this message
Jelmer Vernooij (jelmer) said :
#1

After cloning a git repository (well, actually the master branch) with "bzr branch", how can I get a bzr revno that corresponds to a given git sha1 value? This is sometimes necessary when people who access the same repository with git point to a specific revision by giving its sha1 value.

Also, it would be nice if "bzr status" would show the git sha1 together with the bzr revno, like "bzr pull" does.

Revision history for this message
Eli Zaretskii (eliz) said :
#2

The "answer" above is just a copy/paste of my question. Am I missing something?

Revision history for this message
Jelmer Vernooij (jelmer) said :
#3

Sorry, copy-n-paste error.

Bzr revno -rgit:SOMESHA should work.

"Bzr status" does not show the Bzr revno as far as I know, so it would be odd if it showed the git sha.

Revision history for this message
Eli Zaretskii (eliz) said :
#4

It doesn't seem to work:

D:\gnu\bzr\gawk\gawk.git>bzr revno -rgit:04a2bff46700c20ed75a0c624b98d6e55853de02
bzr: ERROR: no such option: -r

Should I file a bug report?

Revision history for this message
Eli Zaretskii (eliz) said :
#5

Maybe you meant

  bzr log -rgit:SOMESHA

because that works, and shows the bzr revno, among other info. And other commands that accept a revisionspec argument also seem to work with the git:SHA spec.

I see now that this revision spec is documented in the information presented by "bzr help git". So I guess we can close this question as answered.

Revision history for this message
Jelmer Vernooij (jelmer) said :
#6