{"action":"created","issue":{"url":"https://api.github.com/repos/systemd/systemd/issues/1161","labels_url":"https://api.github.com/repos/systemd/systemd/issues/1161/labels{/name}","comments_url":"https://api.github.com/repos/systemd/systemd/issues/1161/comments","events_url":"https://api.github.com/repos/systemd/systemd/issues/1161/events","html_url":"https://github.com/systemd/systemd/pull/1161","id":105035733,"number":1161,"title":"CODING_STYLE: mandate alphabetical include order (v2)","user":{"login":"dvdhrm","id":623857,"avatar_url":"https://avatars.githubusercontent.com/u/623857?v=3","gravatar_id":"","url":"https://api.github.com/users/dvdhrm","html_url":"https://github.com/dvdhrm","followers_url":"https://api.github.com/users/dvdhrm/followers","following_url":"https://api.github.com/users/dvdhrm/following{/other_user}","gists_url":"https://api.github.com/users/dvdhrm/gists{/gist_id}","starred_url":"https://api.github.com/users/dvdhrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvdhrm/subscriptions","organizations_url":"https://api.github.com/users/dvdhrm/orgs","repos_url":"https://api.github.com/users/dvdhrm/repos","events_url":"https://api.github.com/users/dvdhrm/events{/privacy}","received_events_url":"https://api.github.com/users/dvdhrm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/systemd/systemd/labels/coding-style","name":"coding-style","color":"fad8c7"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-05T16:26:05Z","updated_at":"2015-09-05T23:31:05Z","closed_at":"2015-09-05T23:30:08Z","pull_request":{"url":"https://api.github.com/repos/systemd/systemd/pulls/1161","html_url":"https://github.com/systemd/systemd/pull/1161","diff_url":"https://github.com/systemd/systemd/pull/1161.diff","patch_url":"https://github.com/systemd/systemd/pull/1161.patch"},"body":"systemd-internal headers must not rely on include order. That means, they\r\neither must contain forward-declarations of used types/functions, or they\r\nmust include all dependencies on their own. Therefore, there is no reason\r\nto mandate an include order on the call-side.\r\n\r\nHowever, global includes should always be ordered first. We don't want\r\nlocal definitions to leak into global includes, possible changing their\r\nbehavior. Apparently, namespacing is a complex problem that people are\r\nincapable of implementing properly..\r\n\r\nApart from \"global before local\", there is no reason to mandate a random\r\ninclude order (which we happen to do right now). Instead, mandate\r\nalphabetical ordering. The current rules do not have any benefit at all.\r\nThey neither reduce include-complexity, nor allow easy auditing of\r\ninclude files. But with alphabetical ordering, we get duplicate-detection\r\nfor free, it gets *much much* easier to figure out whether a header is\r\nalready included, and it is trivial to add new headers.\r\n\r\nReplaces #1158."},"comment":{"url":"https://api.github.com/repos/systemd/systemd/issues/comments/138009312","html_url":"https://github.com/systemd/systemd/pull/1161#issuecomment-138009312","issue_url":"https://api.github.com/repos/systemd/systemd/issues/1161","id":138009312,"user":{"login":"poettering","id":2130732,"avatar_url":"https://avatars.githubusercontent.com/u/2130732?v=3","gravatar_id":"","url":"https://api.github.com/users/poettering","html_url":"https://github.com/poettering","followers_url":"https://api.github.com/users/poettering/followers","following_url":"https://api.github.com/users/poettering/following{/other_user}","gists_url":"https://api.github.com/users/poettering/gists{/gist_id}","starred_url":"https://api.github.com/users/poettering/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/poettering/subscriptions","organizations_url":"https://api.github.com/users/poettering/orgs","repos_url":"https://api.github.com/users/poettering/repos","events_url":"https://api.github.com/users/poettering/events{/privacy}","received_events_url":"https://api.github.com/users/poettering/received_events","type":"User","site_admin":false},"created_at":"2015-09-05T23:31:05Z","updated_at":"2015-09-05T23:31:05Z","body":"Merged this now. We can add an example in a later commit.\r\n\r\nNow I'd love if somebody could run a script over things to reorder all includes accordingly. Also, I am curious how much problems reordering will actually trigger..."}}