Closed Bug 982788 Opened 10 years ago Closed 10 years ago

Linkify the output of "git push" in bug comments

Categories

(bugzilla.mozilla.org :: Extensions, defect)

Production
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: LpSolit, Assigned: glob)

Details

Looks like I'm the first one to commit a (real) patch to git for the Bugzilla project. And the output of "git push" is completely different from the one of "bzr commit":

To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
   d51abfd..ca7b39a  master -> master

is what I got, see bug 728892 comment 8.

As I refuse to go to git.mozilla.org every time I commit a patch to get the URL pointing to my commit, I would like bmo to linkify "d51abfd..ca7b39a" for me as we did for bzr commit messages.

AFAIK, the output above has all the info bmo needs to generate the correct URL:

1) To ssh://gitolite3@git.mozilla.org means that it's a commit message to git
2) The same line ends with bugzilla/bugzilla.git so bmo knows the repo on git.m.o
3) The next line starts with a cryptic d51abfd..ca7b39a (easy to remember rev number; thanks git, I love you!)
4) master -> master lets bmo know to which branch I committed my patch exactly.
In this specific case, it should point to http://git.mozilla.org/?p=bugzilla/bugzilla.git;a=commit;h=ca7b39aa66be9b4deea1ead8e6a788025759b80d [github]

So the output of "git push" has a truncated rev string. Good luck!

It looks like http://git.mozilla.org/?p=bugzilla/bugzilla.git;a=commit;h=ca7b39 [github] also works, where ca7b39 is extracted from the output of "git push". Not sure if I'm lucky or if this shortcut always points to the correct commit.
Assignee: nobody → glob
Counting objects: 9, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 684 bytes | 0 bytes/s, done.
Total 5 (delta 4), reused 0 (delta 0)
To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   aa34323..99ec913  4.2 -> 4.2
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Component: Extensions: BMO → Extensions
You need to log in before you can comment on or make changes to this bug.