<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 9, 2020 at 12:29 PM Michael Kruse via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I was always assuming that the suggested commit is assembled in the<br>
PHP code run by arcanist command run locally. If indeed the arc<br>
command requests the commit message from the server, we could do some<br>
additional things:<br>
<br>
 * Remove "Summary:" in front of message<br>
 * Line break after 72 columns<br>
 * Convert summary markdown formatting to plain texts (e.g. remove<br>
backticks; I don't know any git client that renders as markdown)<br></blockquote><div>-1 on removing backticks. The `lowercase` in the middle of a sentence can be confusing without the backticks.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 * Add/check existence of [component] tag<br>
<br>
Alternatively, we could make an upstream feature request<br>
<br>
Michael<br>
<br>
Am Do., 9. Apr. 2020 um 11:16 Uhr schrieb Jon Roelofs via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>:<br>
><br>
> Can we fix this in <a href="http://reviews.llvm.org" rel="noreferrer" target="_blank">reviews.llvm.org</a>'s fork of phab?<br>
><br>
> <a href="https://github.com/phacility/phabricator/blob/cac3dc4983c3671ba4ec841aac8efac10744a80c/src/applications/differential/conduit/DifferentialGetCommitMessageConduitAPIMethod.php" rel="noreferrer" target="_blank">https://github.com/phacility/phabricator/blob/cac3dc4983c3671ba4ec841aac8efac10744a80c/src/applications/differential/conduit/DifferentialGetCommitMessageConduitAPIMethod.php</a><br>
><br>
> Seems straightforward(-ish) to drop the relevant fields there, that way `arc land` automatically DTRT.<br>
><br>
> Jon<br>
><br>
> On Fri, Dec 27, 2019 at 11:30 PM Mehdi AMINI via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>><br>
>><br>
>> On Fri, Dec 27, 2019 at 12:48 PM Fangrui Song via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>>><br>
>>> Many git commits in the monorepo look like the following:<br>
>>><br>
>>>    [Tag0][Tag1] Title line<br>
>>><br>
>>>    Summary:<br>
>>>    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque mauris neque, porta nec tristique at, sagittis vel nisi. Fusce pharetra nunc et mauris consequat venenatis.<br>
>>><br>
>>>    Reviewers: username0, username1<br>
>>><br>
>>>    Reviewed By: username0<br>
>>><br>
>>>    Subscribers: username2, username3, llvm-commits<br>
>>><br>
>>>    Tags: #llvm<br>
>>><br>
>>>    Differential Revision: <a href="https://reviews.llvm.org/Dxxxxx" rel="noreferrer" target="_blank">https://reviews.llvm.org/Dxxxxx</a><br>
>>><br>
>>> These Phabricator metadata lines (`Reviewers:`, `Reviewed By:`, etc) are created automatically when the author uploads the patch via `arc diff 'HEAD^'`.<br>
>>> The summary and metadata can be copied from Phabricator to the local commit via `arc amend`.<br>
>>><br>
>>> Among the metadata tags, `Differential Revision:` is the most useful one. It associates a commit with a Phabricator differential (Dxxxxx) and allows the differential to be closed automatically when the commit is pushed to llvm-project master.<br>
>>><br>
>>> The other tags (Subscribers:, Reviewers:, Reviewed By:, Tags:, and the `Summary:` line) are not useful. They just clutter up the commit message. Shall we mention on <a href="https://llvm.org/docs/DeveloperPolicy.html" rel="noreferrer" target="_blank">https://llvm.org/docs/DeveloperPolicy.html</a> that developers are recommended to delete metadata tags before committing?<br>
>><br>
>><br>
>> That's be great!<br>
>> I suspect we can provide a bash function to add to one's .bashrc to make it trivial:<br>
>><br>
>> function arcfilter() {  git log -1 --pretty=%B | awk '/Reviewers: /{p=1; sub(/Reviewers: .*Differential Revision: /, "")}; /Differential Revision: /{p=0;}; !p'   | git commit --amend -F - ; }<br>
>><br>
>> Just running `arcfilter` before pushing will filter the commit it out automatically!<br>
>><br>
>>><br>
>>> It'd be nice if some pre-receive hooks can be set up to enforce deleting some really unnecessary metadata tags.<br>
>><br>
>><br>
>> Unfortunately you can't add pre-receive hook on GitHub as far as I know.<br>
>><br>
>> --<br>
>> Mehd<br>
>><br>
>> _______________________________________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
>> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
><br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>