This is an archive of the discontinued LLVM Phabricator instance.

Update developer policy.
ClosedPublic

Authored by vext01 on Jun 27 2022, 7:08 AM.

Details

Summary

I've recently gone though the process of getting commit rights and have raised a few diffs already.

The developer policy is a little out of date in some places. This change updates them based upon my own personal experience.

Namely:

  • diffs are not passed around on mailing lists any more.
  • diffs should be -U 999999
  • you don't have to respond to any automated email.

Looks good?

Diff Detail

Event Timeline

vext01 created this revision.Jun 27 2022, 7:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2022, 7:08 AM
vext01 requested review of this revision.Jun 27 2022, 7:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2022, 7:08 AM
aaron.ballman added inline comments.
llvm/docs/DeveloperPolicy.rst
87–91

Changing this would require an RFC to see if the community wants to get rid of our requirement that patches be formatted. Personally, I'd be opposed to such a change; I think this should be kept.

112–114

I don't think we want to lose this bit either, as I don't think this advice has changed.

419–421

Rather than get rid of this, I think we might actually want to broaden it. I read this blurb as letting folks know that sometimes commit messages take a while before they show up on the commit list. It used to be the primary way that happened was when making a commit for the first time. Now it happens most often for large commits (due to the size of the email content) or a long list of CCs (often added automatically by Herald, though the moderation of these has gotten better in recent history).

I think it's kind of helpful to let people know that sometimes the automated emails get caught out by moderation. But if others don't think that's of value to mention, then we can go ahead and remove this bit.

vext01 added inline comments.Jun 27 2022, 9:07 AM
llvm/docs/DeveloperPolicy.rst
112–114

Oops, you are right. My bad!

419–421

Actually, now I read it again, I realise that I don't understand what this sentence means:

Your first commit to a repository may require the autogenerated email to be approved by a moderator of the mailing list.

My first commit to a llvm repository was via github, and github doesn't discriminate. If you have write-access to the repo, then your push to main will surely go ahead. There are no automated emails involved as far as I know.

I suspect this prose is from pre-github, where the process was different?

vext01 added inline comments.Jun 27 2022, 9:16 AM
llvm/docs/DeveloperPolicy.rst
87–91

Is there confusion between git format-patch and git clang-format here?

To be clear, I'm not proposing that the source code you change isn't syntactically formatted. But git format-patch does not do syntactic formatting, it just writes a diff to disk.

I don't think it matters how you generate your diff, but your changes need to have gone through git clang-format as described elsewhere in the llvm docs.

aaron.ballman added inline comments.Jun 27 2022, 10:38 AM
llvm/docs/DeveloperPolicy.rst
87–91

Oh, yes, that is confusion on my end! I was thinking git clang-format, so this part is fine by me. Thanks!

419–421

Actually, now I read it again, I realise that I don't understand what this sentence means:

Ah, I think I see where the confusion may be coming in.

We have a post-commit hook that pushes all commits to a commits email list: https://lists.llvm.org/pipermail/cfe-commits/ (as an example, there's also commits list for LLVM and others), and it's existed for a *long time*. It used to be that your commits were written to the commits list as though they came from you directly (e.g., https://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130225/074838.html), and these days they come in as though from a list bot (e.g., https://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20220627/424937.html); check out the from line just below the title to spot the differences. So the old issue was that when you first pushed a commit, you may not have been subscribed to cfe-commits and your commit message wouldn't make it to the lists. Now the issue is that when you push any commit, it might be caught up by moderation filters (this also used to be an issue, but it wasn't the most likely issue for people to hit).

vext01 added inline comments.Jun 28 2022, 2:25 AM
llvm/docs/DeveloperPolicy.rst
419–421

OK, so what do you recommend we do? This prose is currently full of historic details that are confusing/intimidating for a newbie.

Does the sentence still apply, or can we kill it?

vext01 added inline comments.Jun 28 2022, 7:07 AM
llvm/docs/DeveloperPolicy.rst
96

Woah! I just realized that -U 999999 and -U999999 are interpreted differently by git. We need the latter.

aaron.ballman added inline comments.Jun 28 2022, 7:59 AM
llvm/docs/DeveloperPolicy.rst
96

TIL I've been doing it right almost entirely by chance. :-)

You should probably fix up the patch summary as well.

419–421

Do you think something along these lines is still intimidating for a newbie?

"For external tracking purposes, committed changes are automatically reflected on a commits mailing list (link to llvm-commits archive, link to cfe-commits archive) soon after the commit lands. Note, these mailing lists are moderated and it is not unusual for a large commit to require a moderator to approve the email, so do not be concerned if a commit does not immediately appear in the archives."

Or something along these lines? Basically, I think it's useful for people to know that the commit is automatically reflected somewhere (so your commit messages are more visible than just git log/blame) and that's it's not something you need to worry about as a committer if you don't see your commit immediately because all the emails get reflected eventually.

vext01 added inline comments.Jun 28 2022, 8:10 AM
llvm/docs/DeveloperPolicy.rst
419–421

That makes a lot more sense to me. I'll make that change and supply a revised diff. Thanks.

xbolva00 added inline comments.
llvm/docs/DeveloperPolicy.rst
96

typo "infinte"

97

main is weird example here imho.

vext01 added inline comments.Jun 28 2022, 8:38 AM
llvm/docs/DeveloperPolicy.rst
97

How comes? The docs told me to make my diffs off main, so that's what you'd be diffing against typically. No?

xbolva00 added inline comments.Jun 28 2022, 8:59 AM
llvm/docs/DeveloperPolicy.rst
97

Ah, okay. I usually use it without it.

vext01 updated this revision to Diff 440647.Jun 28 2022, 9:02 AM

I've addressed the comments.

I only linked llvm-commits (reusing the already defined rst link) as the other lists are referenced elsewhere.

Typo also fixed.

After fixing my -U 999999, grepping the tree for 9999 in rst files shows that all references to -U999999 are correct.

vext01 added inline comments.Jun 28 2022, 9:06 AM
llvm/docs/DeveloperPolicy.rst
97

That would mean you haven't committed your changes, and git clang-fomat wont work in that case, so committing is best IMHO.

xbolva00 added inline comments.Jun 28 2022, 9:18 AM
llvm/docs/DeveloperPolicy.rst
97

I use arc land :)

aaron.ballman accepted this revision.Jun 28 2022, 9:43 AM

The changes LGTM, but you should wait a bit before landing in case other reviewers/subscribers want to chime in if they still have opinions.

llvm/docs/DeveloperPolicy.rst
97

FWIW, I also never put main explicitly on my diff lines; and I don't use arc (I just use git diff). Not everyone's workflow involves carrying around git branches for everything. That said, I don't have an issue with being explicit here, either.

This revision is now accepted and ready to land.Jun 28 2022, 9:43 AM
hubert.reinterpretcast added inline comments.
llvm/docs/DeveloperPolicy.rst
88

Using git diff like this, there are risks that main is now ahead of your branch's base. Probably safer to use HEAD~n where n is the number of commits you have on your branch.

llvm/docs/DeveloperPolicy.rst
403–405

"Note," => "Note that"
Add comma before "and".

vext01 added inline comments.Jun 29 2022, 1:00 AM
llvm/docs/DeveloperPolicy.rst
88

The exact command you want to issue is going to vary according to circumstance and personal workflow preference. Sometimes main is fine, if it isn't HEAD~n is fine, but if you have a lot of commits then determining (i.e. manually counting) n will be impractical and you probably want to just use an absolute git hash.

I don't think we need to delve into a great level of detail. I think the prose "using something like" is adequate.

vext01 updated this revision to Diff 440887.Jun 29 2022, 1:02 AM

Fixed grammar bits.

LGTM!

llvm/docs/DeveloperPolicy.rst
88

okay

vext01 closed this revision.Jul 4 2022, 2:17 AM

Just pushed this to main (04f6bf482b8641533274d28af5fdac7107da3344)

Thanks everyone!