{"action":"created","comment":{"url":"https://api.github.com/repos/spack/spack/pulls/comments/189863011","pull_request_review_id":122118710,"id":189863011,"diff_hunk":"@@ -639,13 +664,28 @@ def they_are(t):\n \n     # Source dict is merged into dest.\n     elif they_are(dict):\n+        # track keys for marking\n+        key_marks = {}\n+\n         for sk, sv in iteritems(source):\n             if _override(sk) or sk not in dest:\n                 # if sk ended with ::, or if it's new, completely override\n                 dest[sk] = copy.copy(sv)\n             else:\n                 # otherwise, merge the YAML\n                 dest[sk] = _merge_yaml(dest[sk], source[sk])\n+\n+            # this seems unintuitive, but see below. We need this because\n+            # Python dicts do not overwrite keys on insert, and we want\n+            # to copy mark information on source keys to dest.\n+            key_marks[sk] = sk\n+\n+        # ensure that keys are marked in the destination.  the key_marks dict\n+        # ensures we can get the actual source key objects from dest keys\n+        for dk in dest.keys():\n+            if dk in key_marks:\n+                syaml.mark(dk, key_marks[dk])","path":"lib/spack/spack/config.py","position":122,"original_position":122,"commit_id":"93ac7164f76e10b684e01afaa6d3ae0b0df029e0","original_commit_id":"93ac7164f76e10b684e01afaa6d3ae0b0df029e0","user":{"login":"alalazo","id":4199709,"avatar_url":"https://avatars0.githubusercontent.com/u/4199709?v=4","gravatar_id":"","url":"https://api.github.com/users/alalazo","html_url":"https://github.com/alalazo","followers_url":"https://api.github.com/users/alalazo/followers","following_url":"https://api.github.com/users/alalazo/following{/other_user}","gists_url":"https://api.github.com/users/alalazo/gists{/gist_id}","starred_url":"https://api.github.com/users/alalazo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alalazo/subscriptions","organizations_url":"https://api.github.com/users/alalazo/orgs","repos_url":"https://api.github.com/users/alalazo/repos","events_url":"https://api.github.com/users/alalazo/events{/privacy}","received_events_url":"https://api.github.com/users/alalazo/received_events","type":"User","site_admin":false},"body":"Super minor point (because this is already a huge a leap forward what we have right now): a key of a dictionary that is effectively a merge of more files is attributed to one of them. Example:\r\n```console\r\n$ spack config blame packages\r\n---                                                                     packages:\r\n/home/mculpo/PycharmProjects/spack/etc/spack/packages.yaml:2              all:\r\n/home/mculpo/PycharmProjects/spack/etc/spack/defaults/packages.yaml:18      compiler:\r\n/home/mculpo/PycharmProjects/spack/etc/spack/defaults/packages.yaml:18      - gcc\r\n/home/mculpo/PycharmProjects/spack/etc/spack/defaults/packages.yaml:18      - intel\r\n/home/mculpo/PycharmProjects/spack/etc/spack/defaults/packages.yaml:18      - pgi\r\n/home/mculpo/PycharmProjects/spack/etc/spack/defaults/packages.yaml:18      - clang\r\n/home/mculpo/PycharmProjects/spack/etc/spack/defaults/packages.yaml:18      - xl\r\n/home/mculpo/PycharmProjects/spack/etc/spack/defaults/packages.yaml:18      - nag\r\n/home/mculpo/PycharmProjects/spack/etc/spack/packages.yaml:3                providers:\r\n<omitted>\r\n/home/mculpo/PycharmProjects/spack/etc/spack/defaults/packages.yaml:25        gl:\r\n/home/mculpo/PycharmProjects/spack/etc/spack/packages.yaml:5                  - mesa\r\n/home/mculpo/PycharmProjects/spack/etc/spack/defaults/packages.yaml:26        glu:\r\n/home/mculpo/PycharmProjects/spack/etc/spack/defaults/packages.yaml:26        - mesa-glu\r\n/home/mculpo/PycharmProjects/spack/etc/spack/defaults/packages.yaml:26        - openglu\r\n<omitted>\r\n```\r\nAbove I think that `all` and `providers` should either have no tag, or have a tag that says they are the result of a merge.","created_at":"2018-05-22T11:16:06Z","updated_at":"2018-05-22T12:04:18Z","html_url":"https://github.com/spack/spack/pull/8081#discussion_r189863011","pull_request_url":"https://api.github.com/repos/spack/spack/pulls/8081","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/spack/spack/pulls/comments/189863011"},"html":{"href":"https://github.com/spack/spack/pull/8081#discussion_r189863011"},"pull_request":{"href":"https://api.github.com/repos/spack/spack/pulls/8081"}}},"pull_request":{"url":"https://api.github.com/repos/spack/spack/pulls/8081","id":187104751,"html_url":"https://github.com/spack/spack/pull/8081","diff_url":"https://github.com/spack/spack/pull/8081.diff","patch_url":"https://github.com/spack/spack/pull/8081.patch","issue_url":"https://api.github.com/repos/spack/spack/issues/8081","number":8081,"state":"open","locked":false,"title":"command: spack config blame","user":{"login":"tgamblin","id":299842,"avatar_url":"https://avatars3.githubusercontent.com/u/299842?v=4","gravatar_id":"","url":"https://api.github.com/users/tgamblin","html_url":"https://github.com/tgamblin","followers_url":"https://api.github.com/users/tgamblin/followers","following_url":"https://api.github.com/users/tgamblin/following{/other_user}","gists_url":"https://api.github.com/users/tgamblin/gists{/gist_id}","starred_url":"https://api.github.com/users/tgamblin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgamblin/subscriptions","organizations_url":"https://api.github.com/users/tgamblin/orgs","repos_url":"https://api.github.com/users/tgamblin/repos","events_url":"https://api.github.com/users/tgamblin/events{/privacy}","received_events_url":"https://api.github.com/users/tgamblin/received_events","type":"User","site_admin":false},"body":"This depends on (and is based on top of) #7774.  It's really just one commit (the last one).\r\n\r\nHave you ever wondered why Spack is behaving a certain way or using a particular external package?  Do you wonder what [configuration scope](https://spack.readthedocs.io/en/latest/configuration.html) a particular setting came from?  Now you can find out! `spack config blame <config file>`  will print out the YAML for a Spack configuration section, annotated with the file and line where each setting came from.  So, now you can track down exactly why your configuration works a certain way.\r\n\r\nHere's an example:\r\n\r\n<img width=\"1275\" alt=\"screen shot 2018-05-09 at 10 25 26 pm\" src=\"https://user-images.githubusercontent.com/299842/39853662-61ca68d2-53d8-11e8-8058-c0287a00eac3.png\">\r\n\r\nIn this picture, you can the full, merged `config.yaml` on the right.  On the left, you can see that some settings come from hard-coded builtings (`_builtin`), some come from the default Spack `config.yaml`, some come from `~/.spack/config.yaml`, and some come from the command line.\r\n\r\nThis works for any config file, so you can do the same thing with `spack config blame packages` or `spack config blame compilers`, etc.","created_at":"2018-05-10T05:32:15Z","updated_at":"2018-05-22T12:04:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fd101564c28b815f48715591188d5c634418037","assignee":null,"assignees":[],"requested_reviewers":[{"login":"adamjstewart","id":12021217,"avatar_url":"https://avatars2.githubusercontent.com/u/12021217?v=4","gravatar_id":"","url":"https://api.github.com/users/adamjstewart","html_url":"https://github.com/adamjstewart","followers_url":"https://api.github.com/users/adamjstewart/followers","following_url":"https://api.github.com/users/adamjstewart/following{/other_user}","gists_url":"https://api.github.com/users/adamjstewart/gists{/gist_id}","starred_url":"https://api.github.com/users/adamjstewart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamjstewart/subscriptions","organizations_url":"https://api.github.com/users/adamjstewart/orgs","repos_url":"https://api.github.com/users/adamjstewart/repos","events_url":"https://api.github.com/users/adamjstewart/events{/privacy}","received_events_url":"https://api.github.com/users/adamjstewart/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":471995122,"url":"https://api.github.com/repos/spack/spack/labels/commands","name":"commands","color":"006b75","default":false},{"id":446615135,"url":"https://api.github.com/repos/spack/spack/labels/configuration","name":"configuration","color":"bfd4f2","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/spack/spack/pulls/8081/commits","review_comments_url":"https://api.github.com/repos/spack/spack/pulls/8081/comments","review_comment_url":"https://api.github.com/repos/spack/spack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spack/spack/issues/8081/comments","statuses_url":"https://api.github.com/repos/spack/spack/statuses/93ac7164f76e10b684e01afaa6d3ae0b0df029e0","head":{"label":"spack:features/config-blame","ref":"features/config-blame","sha":"93ac7164f76e10b684e01afaa6d3ae0b0df029e0","user":{"login":"spack","id":25539161,"avatar_url":"https://avatars2.githubusercontent.com/u/25539161?v=4","gravatar_id":"","url":"https://api.github.com/users/spack","html_url":"https://github.com/spack","followers_url":"https://api.github.com/users/spack/followers","following_url":"https://api.github.com/users/spack/following{/other_user}","gists_url":"https://api.github.com/users/spack/gists{/gist_id}","starred_url":"https://api.github.com/users/spack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spack/subscriptions","organizations_url":"https://api.github.com/users/spack/orgs","repos_url":"https://api.github.com/users/spack/repos","events_url":"https://api.github.com/users/spack/events{/privacy}","received_events_url":"https://api.github.com/users/spack/received_events","type":"Organization","site_admin":false},"repo":{"id":15730865,"name":"spack","full_name":"spack/spack","owner":{"login":"spack","id":25539161,"avatar_url":"https://avatars2.githubusercontent.com/u/25539161?v=4","gravatar_id":"","url":"https://api.github.com/users/spack","html_url":"https://github.com/spack","followers_url":"https://api.github.com/users/spack/followers","following_url":"https://api.github.com/users/spack/following{/other_user}","gists_url":"https://api.github.com/users/spack/gists{/gist_id}","starred_url":"https://api.github.com/users/spack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spack/subscriptions","organizations_url":"https://api.github.com/users/spack/orgs","repos_url":"https://api.github.com/users/spack/repos","events_url":"https://api.github.com/users/spack/events{/privacy}","received_events_url":"https://api.github.com/users/spack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spack/spack","description":"A flexible package manager that supports multiple versions, configurations, platforms, and compilers.","fork":false,"url":"https://api.github.com/repos/spack/spack","forks_url":"https://api.github.com/repos/spack/spack/forks","keys_url":"https://api.github.com/repos/spack/spack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spack/spack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spack/spack/teams","hooks_url":"https://api.github.com/repos/spack/spack/hooks","issue_events_url":"https://api.github.com/repos/spack/spack/issues/events{/number}","events_url":"https://api.github.com/repos/spack/spack/events","assignees_url":"https://api.github.com/repos/spack/spack/assignees{/user}","branches_url":"https://api.github.com/repos/spack/spack/branches{/branch}","tags_url":"https://api.github.com/repos/spack/spack/tags","blobs_url":"https://api.github.com/repos/spack/spack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spack/spack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spack/spack/git/refs{/sha}","trees_url":"https://api.github.com/repos/spack/spack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spack/spack/statuses/{sha}","languages_url":"https://api.github.com/repos/spack/spack/languages","stargazers_url":"https://api.github.com/repos/spack/spack/stargazers","contributors_url":"https://api.github.com/repos/spack/spack/contributors","subscribers_url":"https://api.github.com/repos/spack/spack/subscribers","subscription_url":"https://api.github.com/repos/spack/spack/subscription","commits_url":"https://api.github.com/repos/spack/spack/commits{/sha}","git_commits_url":"https://api.github.com/repos/spack/spack/git/commits{/sha}","comments_url":"https://api.github.com/repos/spack/spack/comments{/number}","issue_comment_url":"https://api.github.com/repos/spack/spack/issues/comments{/number}","contents_url":"https://api.github.com/repos/spack/spack/contents/{+path}","compare_url":"https://api.github.com/repos/spack/spack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spack/spack/merges","archive_url":"https://api.github.com/repos/spack/spack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spack/spack/downloads","issues_url":"https://api.github.com/repos/spack/spack/issues{/number}","pulls_url":"https://api.github.com/repos/spack/spack/pulls{/number}","milestones_url":"https://api.github.com/repos/spack/spack/milestones{/number}","notifications_url":"https://api.github.com/repos/spack/spack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spack/spack/labels{/name}","releases_url":"https://api.github.com/repos/spack/spack/releases{/id}","deployments_url":"https://api.github.com/repos/spack/spack/deployments","created_at":"2014-01-08T09:22:12Z","updated_at":"2018-05-22T10:46:51Z","pushed_at":"2018-05-22T10:45:48Z","git_url":"git://github.com/spack/spack.git","ssh_url":"git@github.com:spack/spack.git","clone_url":"https://github.com/spack/spack.git","svn_url":"https://github.com/spack/spack","homepage":"https://spack.io","size":39238,"stargazers_count":560,"watchers_count":560,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":435,"mirror_url":null,"archived":false,"open_issues_count":949,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1"},"forks":435,"open_issues":949,"watchers":560,"default_branch":"develop"}},"base":{"label":"spack:develop","ref":"develop","sha":"f2eb71ca2086a77a2ebd8d08afb564991ef00b43","user":{"login":"spack","id":25539161,"avatar_url":"https://avatars2.githubusercontent.com/u/25539161?v=4","gravatar_id":"","url":"https://api.github.com/users/spack","html_url":"https://github.com/spack","followers_url":"https://api.github.com/users/spack/followers","following_url":"https://api.github.com/users/spack/following{/other_user}","gists_url":"https://api.github.com/users/spack/gists{/gist_id}","starred_url":"https://api.github.com/users/spack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spack/subscriptions","organizations_url":"https://api.github.com/users/spack/orgs","repos_url":"https://api.github.com/users/spack/repos","events_url":"https://api.github.com/users/spack/events{/privacy}","received_events_url":"https://api.github.com/users/spack/received_events","type":"Organization","site_admin":false},"repo":{"id":15730865,"name":"spack","full_name":"spack/spack","owner":{"login":"spack","id":25539161,"avatar_url":"https://avatars2.githubusercontent.com/u/25539161?v=4","gravatar_id":"","url":"https://api.github.com/users/spack","html_url":"https://github.com/spack","followers_url":"https://api.github.com/users/spack/followers","following_url":"https://api.github.com/users/spack/following{/other_user}","gists_url":"https://api.github.com/users/spack/gists{/gist_id}","starred_url":"https://api.github.com/users/spack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spack/subscriptions","organizations_url":"https://api.github.com/users/spack/orgs","repos_url":"https://api.github.com/users/spack/repos","events_url":"https://api.github.com/users/spack/events{/privacy}","received_events_url":"https://api.github.com/users/spack/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spack/spack","description":"A flexible package manager that supports multiple versions, configurations, platforms, and compilers.","fork":false,"url":"https://api.github.com/repos/spack/spack","forks_url":"https://api.github.com/repos/spack/spack/forks","keys_url":"https://api.github.com/repos/spack/spack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spack/spack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spack/spack/teams","hooks_url":"https://api.github.com/repos/spack/spack/hooks","issue_events_url":"https://api.github.com/repos/spack/spack/issues/events{/number}","events_url":"https://api.github.com/repos/spack/spack/events","assignees_url":"https://api.github.com/repos/spack/spack/assignees{/user}","branches_url":"https://api.github.com/repos/spack/spack/branches{/branch}","tags_url":"https://api.github.com/repos/spack/spack/tags","blobs_url":"https://api.github.com/repos/spack/spack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spack/spack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spack/spack/git/refs{/sha}","trees_url":"https://api.github.com/repos/spack/spack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spack/spack/statuses/{sha}","languages_url":"https://api.github.com/repos/spack/spack/languages","stargazers_url":"https://api.github.com/repos/spack/spack/stargazers","contributors_url":"https://api.github.com/repos/spack/spack/contributors","subscribers_url":"https://api.github.com/repos/spack/spack/subscribers","subscription_url":"https://api.github.com/repos/spack/spack/subscription","commits_url":"https://api.github.com/repos/spack/spack/commits{/sha}","git_commits_url":"https://api.github.com/repos/spack/spack/git/commits{/sha}","comments_url":"https://api.github.com/repos/spack/spack/comments{/number}","issue_comment_url":"https://api.github.com/repos/spack/spack/issues/comments{/number}","contents_url":"https://api.github.com/repos/spack/spack/contents/{+path}","compare_url":"https://api.github.com/repos/spack/spack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spack/spack/merges","archive_url":"https://api.github.com/repos/spack/spack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spack/spack/downloads","issues_url":"https://api.github.com/repos/spack/spack/issues{/number}","pulls_url":"https://api.github.com/repos/spack/spack/pulls{/number}","milestones_url":"https://api.github.com/repos/spack/spack/milestones{/number}","notifications_url":"https://api.github.com/repos/spack/spack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spack/spack/labels{/name}","releases_url":"https://api.github.com/repos/spack/spack/releases{/id}","deployments_url":"https://api.github.com/repos/spack/spack/deployments","created_at":"2014-01-08T09:22:12Z","updated_at":"2018-05-22T10:46:51Z","pushed_at":"2018-05-22T10:45:48Z","git_url":"git://github.com/spack/spack.git","ssh_url":"git@github.com:spack/spack.git","clone_url":"https://github.com/spack/spack.git","svn_url":"https://github.com/spack/spack","homepage":"https://spack.io","size":39238,"stargazers_count":560,"watchers_count":560,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":435,"mirror_url":null,"archived":false,"open_issues_count":949,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1"},"forks":435,"open_issues":949,"watchers":560,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/spack/spack/pulls/8081"},"html":{"href":"https://github.com/spack/spack/pull/8081"},"issue":{"href":"https://api.github.com/repos/spack/spack/issues/8081"},"comments":{"href":"https://api.github.com/repos/spack/spack/issues/8081/comments"},"review_comments":{"href":"https://api.github.com/repos/spack/spack/pulls/8081/comments"},"review_comment":{"href":"https://api.github.com/repos/spack/spack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spack/spack/pulls/8081/commits"},"statuses":{"href":"https://api.github.com/repos/spack/spack/statuses/93ac7164f76e10b684e01afaa6d3ae0b0df029e0"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"alalazo"}}