[llvm-dev] Getting the commit message from Phabricator

Jordan Rupprecht via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 4 10:04:25 PST 2019


If you already have arc setup, then "arc amend" (or "arc amend --revision
D12345") updates the git commit message as well. I never got "arc land"
working, but I use "arc diff", "arc amend", then "git llvm push".

On Sat, Mar 2, 2019, 2:07 AM MyDeveloper Day via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> I'm not sure if this is well known, but it helped me so I thought I'd
> share it with you.
>
> When committing to gitmonorepo, (with git llvm push) you need to have
> committed to your local repo first and so you need to have crafted your
> commit message from your the Phabricator revision. (e.g. D12345)
>
> Phabricator has the ability to give you this commit message it would have
> used, even if you do not use arc to perform the commit/land
>
> This small script (attached) uses arc, jq and sed  (but it can be
> relatively easily changed to use curl instead of arc)
>
> You need to provide your own conduit api token in place of
> <replace_with_phabricator_api_token>
>
> You can get one of these from you Profile->Setting->Conduit API Tokens in
> the top right hand corner of Phabricator https://reviews.llvm.org
>
> ----------------------------
> get_commit_message.sh
> ----------------------------
> echo '{ "revision_id": '${1:1}' }' | arc call-conduit --conduit-uri
> https://reviews.llvm.org/ --conduit-token
> <replace_with_phabricator_api_token> differential.getcommitmessage | jq
> ".response" | sed 's/^.\(.*\).$/\1/' - | sed 's/\\n/\
> /g' -
> ----------------------------
>
> This simply pulls the commit message as json and then replaces \n with
> newlines (there are probably better ways of doing this, I'm not a jq
> expert!)
>
> Given an example review https://reviews.llvm.org/D58250
>
> simply run
>
> get_commit_message.sh D58250
>
> And you get all the relevant information (see below) about the
> message,revision,reviewers, subsribers etc.. returned  (as if arc was going
> to commit it)
>
> (names changed to protect the innocent)
>
> ---------------------------------------------------------------------------------
> [AIX][CMake] Changes for building on AIX with XL and GCC
>
> Summary: In support of IBM's efforts to produce a viable C and C++ LLVM
> compiler for AIX (ref: RFC at
> http://lists.llvm.org/pipermail/llvm-dev/2019-February/130175.html), this
> patch adds customizations to the CMake files in order to properly invoke
> the host toolchain for the build on AIX. Additional changes to enable a
> successful build will follow.
>
> Reviewers: john doe
>
> Reviewed By: jane doe,walter smith
>
> Subscribers: jane doe, llvm-commits
>
> Tags: #llvm
>
> Differential Revision: https://reviews.llvm.org/D58250
>
> ---------------------------------------------------------------------------------
>
> You can then copy and paste this into your commit message.
>
> I hope this helps..
>
> MyDeveloperDay
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190304/51e9d1f7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4849 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190304/51e9d1f7/attachment.bin>


More information about the llvm-dev mailing list