)]}'
{
  "commit": "5af9f1e311ed30322a98a371a48c4330fe12e3d7",
  "tree": "e063689b3c34d2c55c81e1117649a42f718b8f6c",
  "parents": [
    "ba40e4c9a026ea37d9ec9feb82c6aaf16e3333ed"
  ],
  "author": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Mon Aug 07 15:02:40 2017 +0200"
  },
  "committer": {
    "name": "Edwin Kempin",
    "email": "ekempin@google.com",
    "time": "Tue Aug 08 14:06:53 2017 +0200"
  },
  "message": "Also find accounts by preferred email\n\nHistorically (before change I2b3c5c9df) Gerrit was able to find accounts\nby preferred email, even when the account had no external ID with that\nemail.\n\nIt turns out that the Gerrit integration with Google Accounts that is\nused for Gerrit installations at Google depends on this feature. Each\nGoogle Account can be associated with multiple email addresses, and one\nis designated as \"primary\" email address. Users are intentionally\nallowed to choose any of the email addresses that are associated with\ntheir account as preferred email, not just the \"primary\" email address.\nBecause an ExternalId can store only a single email only the \"primary\"\nemail is part of the external ID and the secondary email addresses are\nnot stored in Gerrit\u0027s database. If a user chooses such a secondary\nemail address a preferred email we must ensure that its account is found\nwhen a lookup by this secondary email is made. Hence we reenable the old\nGerrit behavior to also look for accounts with matching preferred email\nwhen looking up accounts by email.\n\nChange I757a4d065b added a new API to lookup accounts by email. Change\nthe implementation of these method to also find accounts by preferred\nemail.\n\nTo find accounts by preferred email use the the account index. To\nprevent a circular dependency between the Accounts class and the\nAccountCacheImpl.ByIdLoader class when using InternalAccountQuery the\nmethods to lookup accounts by email are moved to an own class.\n\nAs follow-up change I991d21b1ac adapts all Gerrit code to use the new\nAPI for looking up accounts by email, so that the AccountByEmailCache\ncan be removed by change I3a4279f5ab.\n\nNot being able to find (inconsistent) accounts by preferred email\ncurrently blocks the migration of accounts to NoteDb.\n\nChange-Id: I1c24da13786f81d6e59b0784586f0b53a16b0a28\nSigned-off-by: Edwin Kempin \u003cekempin@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "06fe021b699b89641a160ae629a4dafddc5a4da3",
      "old_mode": 33188,
      "old_path": "gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/accounts/AccountIT.java",
      "new_id": "8528853e107eef279af86988459fc3cf7600e5e6",
      "new_mode": 33188,
      "new_path": "gerrit-acceptance-tests/src/test/java/com/google/gerrit/acceptance/api/accounts/AccountIT.java"
    },
    {
      "type": "modify",
      "old_id": "c3d0b81b7171e75d17a789444b7978c7c99138e1",
      "old_mode": 33188,
      "old_path": "gerrit-server/src/main/java/com/google/gerrit/server/account/Accounts.java",
      "new_id": "28ed422022000791602866965a90b6d67fbdbd97",
      "new_mode": 33188,
      "new_path": "gerrit-server/src/main/java/com/google/gerrit/server/account/Accounts.java"
    },
    {
      "type": "modify",
      "old_id": "e31f481f211218cd85a748db289cc07450fdf1b9",
      "old_mode": 33188,
      "old_path": "gerrit-server/src/main/java/com/google/gerrit/server/account/Emails.java",
      "new_id": "15f45092ff1736e88a556e60ecc0d70fa67b63a8",
      "new_mode": 33188,
      "new_path": "gerrit-server/src/main/java/com/google/gerrit/server/account/Emails.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1c329bb4352268184d5d7532a50d5293b0a0b180",
      "new_mode": 33188,
      "new_path": "gerrit-server/src/main/java/com/google/gerrit/server/account/EmailsCollection.java"
    },
    {
      "type": "modify",
      "old_id": "775ce6dcfb84165c398eb68a592094f4ddf7aa2b",
      "old_mode": 33188,
      "old_path": "gerrit-server/src/main/java/com/google/gerrit/server/account/Module.java",
      "new_id": "44060be37c1fe074deb6f469dc024b953a72c08e",
      "new_mode": 33188,
      "new_path": "gerrit-server/src/main/java/com/google/gerrit/server/account/Module.java"
    },
    {
      "type": "modify",
      "old_id": "70d84846bec7064fddb92bfe8cda295bfa49087d",
      "old_mode": 33188,
      "old_path": "gerrit-server/src/main/java/com/google/gerrit/server/query/account/InternalAccountQuery.java",
      "new_id": "8fa2975310f6cdb4090730064484e47ca42c0eee",
      "new_mode": 33188,
      "new_path": "gerrit-server/src/main/java/com/google/gerrit/server/query/account/InternalAccountQuery.java"
    }
  ]
}
