{"action":"created","comment":{"url":"https://api.github.com/repos/borgbackup/borg/pulls/comments/51892294","id":51892294,"diff_hunk":"@@ -519,6 +519,30 @@ def dir_is_tagged(path, exclude_caches, exclude_if_present):\n     return tag_paths\n \n \n+def format_line(formatstr, data):\n+    \"\"\"Filter out unwanted properties of str.format(), because \"formatstr\"\n+    is user provided.\n+    \"\"\"\n+    try:\n+        return(formatstr.format(**data))\n+    except KeyError as e:\n+        print('Error in lineformat: \"{}\" - reason \"{}\"'.format(formatstr, str(e)))\n+    except ValueError as e:\n+        print('Error in lineformat: \"{}\" - reason \"{}\"'.format(formatstr, str(e)))\n+    except:\n+        print('Line format error')","path":"borg/helpers.py","position":15,"original_position":15,"commit_id":"9241f7d76f1fc724c2204b7284c0896c52c2f7c1","original_commit_id":"9241f7d76f1fc724c2204b7284c0896c52c2f7c1","user":{"login":"ThomasWaldmann","id":356103,"avatar_url":"https://avatars.githubusercontent.com/u/356103?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasWaldmann","html_url":"https://github.com/ThomasWaldmann","followers_url":"https://api.github.com/users/ThomasWaldmann/followers","following_url":"https://api.github.com/users/ThomasWaldmann/following{/other_user}","gists_url":"https://api.github.com/users/ThomasWaldmann/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasWaldmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasWaldmann/subscriptions","organizations_url":"https://api.github.com/users/ThomasWaldmann/orgs","repos_url":"https://api.github.com/users/ThomasWaldmann/repos","events_url":"https://api.github.com/users/ThomasWaldmann/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasWaldmann/received_events","type":"User","site_admin":false},"body":"in the above exception handlers, you include the formatstr in the error message. so you could do the same here.","created_at":"2016-02-04T15:56:38Z","updated_at":"2016-02-04T15:56:38Z","html_url":"https://github.com/borgbackup/borg/pull/625#discussion_r51892294","pull_request_url":"https://api.github.com/repos/borgbackup/borg/pulls/625","_links":{"self":{"href":"https://api.github.com/repos/borgbackup/borg/pulls/comments/51892294"},"html":{"href":"https://github.com/borgbackup/borg/pull/625#discussion_r51892294"},"pull_request":{"href":"https://api.github.com/repos/borgbackup/borg/pulls/625"}}},"pull_request":{"url":"https://api.github.com/repos/borgbackup/borg/pulls/625","id":58115887,"html_url":"https://github.com/borgbackup/borg/pull/625","diff_url":"https://github.com/borgbackup/borg/pull/625.diff","patch_url":"https://github.com/borgbackup/borg/pull/625.patch","issue_url":"https://api.github.com/repos/borgbackup/borg/issues/625","number":625,"state":"open","locked":false,"title":"Feature/list formatting","user":{"login":"manwegit","id":5763495,"avatar_url":"https://avatars.githubusercontent.com/u/5763495?v=3","gravatar_id":"","url":"https://api.github.com/users/manwegit","html_url":"https://github.com/manwegit","followers_url":"https://api.github.com/users/manwegit/followers","following_url":"https://api.github.com/users/manwegit/following{/other_user}","gists_url":"https://api.github.com/users/manwegit/gists{/gist_id}","starred_url":"https://api.github.com/users/manwegit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manwegit/subscriptions","organizations_url":"https://api.github.com/users/manwegit/orgs","repos_url":"https://api.github.com/users/manwegit/repos","events_url":"https://api.github.com/users/manwegit/events{/privacy}","received_events_url":"https://api.github.com/users/manwegit/received_events","type":"User","site_admin":false},"body":"Adding --list-format FORMAT option to list for user specified file listing support\r\nE.G. List files with unix timestamp mtime, size and path.\r\nborg-linux list /tmp/testrepo::archivea --list-format=\"{mtime:%s}{TAB}{size}{TAB}{path}{LF}\"\r\n\r\nTested with repository containing about 400 000 files.\r\nUsing list-format slows listing down a bit (about 30% on my tests), but when user does not issue --list-format option, then only default fields are calculated and there is only small slowdown (28 s -> 30 s)\r\n\r\nThis feature makes it easier to add new customization features to listing (like inner repo file hashing etc). \r\n\r\nUsecase: Find which files have change between two archives (based on mtime, filesize and path)\r\n\r\nborg-linux list /tmp/testrepo::archvivea --list-format=\"{mtime:%s}{TAB}{size}{TAB}{path}{LF}\" |sort -n > /tmp/archivea.list\r\nborg-linux list /tmp/testrepo::archviveb --list-format=\"{mtime:%s}{TAB}{size}{TAB}{path}{LF}\" |sort -n > /tmp/archiveb.list\r\ndiff /tmp/archivea.list /tmp/archiveb.list","created_at":"2016-02-03T10:13:21Z","updated_at":"2016-02-04T15:56:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3436561628e0cb1778ae01c791c607d5a0c974e6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/borgbackup/borg/pulls/625/commits","review_comments_url":"https://api.github.com/repos/borgbackup/borg/pulls/625/comments","review_comment_url":"https://api.github.com/repos/borgbackup/borg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/borgbackup/borg/issues/625/comments","statuses_url":"https://api.github.com/repos/borgbackup/borg/statuses/9241f7d76f1fc724c2204b7284c0896c52c2f7c1","head":{"label":"manwegit:feature/list-formatting","ref":"feature/list-formatting","sha":"9241f7d76f1fc724c2204b7284c0896c52c2f7c1","user":{"login":"manwegit","id":5763495,"avatar_url":"https://avatars.githubusercontent.com/u/5763495?v=3","gravatar_id":"","url":"https://api.github.com/users/manwegit","html_url":"https://github.com/manwegit","followers_url":"https://api.github.com/users/manwegit/followers","following_url":"https://api.github.com/users/manwegit/following{/other_user}","gists_url":"https://api.github.com/users/manwegit/gists{/gist_id}","starred_url":"https://api.github.com/users/manwegit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manwegit/subscriptions","organizations_url":"https://api.github.com/users/manwegit/orgs","repos_url":"https://api.github.com/users/manwegit/repos","events_url":"https://api.github.com/users/manwegit/events{/privacy}","received_events_url":"https://api.github.com/users/manwegit/received_events","type":"User","site_admin":false},"repo":{"id":50985506,"name":"borg","full_name":"manwegit/borg","owner":{"login":"manwegit","id":5763495,"avatar_url":"https://avatars.githubusercontent.com/u/5763495?v=3","gravatar_id":"","url":"https://api.github.com/users/manwegit","html_url":"https://github.com/manwegit","followers_url":"https://api.github.com/users/manwegit/followers","following_url":"https://api.github.com/users/manwegit/following{/other_user}","gists_url":"https://api.github.com/users/manwegit/gists{/gist_id}","starred_url":"https://api.github.com/users/manwegit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manwegit/subscriptions","organizations_url":"https://api.github.com/users/manwegit/orgs","repos_url":"https://api.github.com/users/manwegit/repos","events_url":"https://api.github.com/users/manwegit/events{/privacy}","received_events_url":"https://api.github.com/users/manwegit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/manwegit/borg","description":"Deduplicating backup program with compression and authenticated encryption.","fork":true,"url":"https://api.github.com/repos/manwegit/borg","forks_url":"https://api.github.com/repos/manwegit/borg/forks","keys_url":"https://api.github.com/repos/manwegit/borg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manwegit/borg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manwegit/borg/teams","hooks_url":"https://api.github.com/repos/manwegit/borg/hooks","issue_events_url":"https://api.github.com/repos/manwegit/borg/issues/events{/number}","events_url":"https://api.github.com/repos/manwegit/borg/events","assignees_url":"https://api.github.com/repos/manwegit/borg/assignees{/user}","branches_url":"https://api.github.com/repos/manwegit/borg/branches{/branch}","tags_url":"https://api.github.com/repos/manwegit/borg/tags","blobs_url":"https://api.github.com/repos/manwegit/borg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manwegit/borg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manwegit/borg/git/refs{/sha}","trees_url":"https://api.github.com/repos/manwegit/borg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manwegit/borg/statuses/{sha}","languages_url":"https://api.github.com/repos/manwegit/borg/languages","stargazers_url":"https://api.github.com/repos/manwegit/borg/stargazers","contributors_url":"https://api.github.com/repos/manwegit/borg/contributors","subscribers_url":"https://api.github.com/repos/manwegit/borg/subscribers","subscription_url":"https://api.github.com/repos/manwegit/borg/subscription","commits_url":"https://api.github.com/repos/manwegit/borg/commits{/sha}","git_commits_url":"https://api.github.com/repos/manwegit/borg/git/commits{/sha}","comments_url":"https://api.github.com/repos/manwegit/borg/comments{/number}","issue_comment_url":"https://api.github.com/repos/manwegit/borg/issues/comments{/number}","contents_url":"https://api.github.com/repos/manwegit/borg/contents/{+path}","compare_url":"https://api.github.com/repos/manwegit/borg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manwegit/borg/merges","archive_url":"https://api.github.com/repos/manwegit/borg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manwegit/borg/downloads","issues_url":"https://api.github.com/repos/manwegit/borg/issues{/number}","pulls_url":"https://api.github.com/repos/manwegit/borg/pulls{/number}","milestones_url":"https://api.github.com/repos/manwegit/borg/milestones{/number}","notifications_url":"https://api.github.com/repos/manwegit/borg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manwegit/borg/labels{/name}","releases_url":"https://api.github.com/repos/manwegit/borg/releases{/id}","deployments_url":"https://api.github.com/repos/manwegit/borg/deployments","created_at":"2016-02-03T08:30:17Z","updated_at":"2016-02-03T08:30:18Z","pushed_at":"2016-02-03T18:14:45Z","git_url":"git://github.com/manwegit/borg.git","ssh_url":"git@github.com:manwegit/borg.git","clone_url":"https://github.com/manwegit/borg.git","svn_url":"https://github.com/manwegit/borg","homepage":"https://borgbackup.github.io/","size":2905,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"borgbackup:master","ref":"master","sha":"435d30d61b0fdcbe3860ae2b94cc58d61637274b","user":{"login":"borgbackup","id":12418060,"avatar_url":"https://avatars.githubusercontent.com/u/12418060?v=3","gravatar_id":"","url":"https://api.github.com/users/borgbackup","html_url":"https://github.com/borgbackup","followers_url":"https://api.github.com/users/borgbackup/followers","following_url":"https://api.github.com/users/borgbackup/following{/other_user}","gists_url":"https://api.github.com/users/borgbackup/gists{/gist_id}","starred_url":"https://api.github.com/users/borgbackup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borgbackup/subscriptions","organizations_url":"https://api.github.com/users/borgbackup/orgs","repos_url":"https://api.github.com/users/borgbackup/repos","events_url":"https://api.github.com/users/borgbackup/events{/privacy}","received_events_url":"https://api.github.com/users/borgbackup/received_events","type":"Organization","site_admin":false},"repo":{"id":35517126,"name":"borg","full_name":"borgbackup/borg","owner":{"login":"borgbackup","id":12418060,"avatar_url":"https://avatars.githubusercontent.com/u/12418060?v=3","gravatar_id":"","url":"https://api.github.com/users/borgbackup","html_url":"https://github.com/borgbackup","followers_url":"https://api.github.com/users/borgbackup/followers","following_url":"https://api.github.com/users/borgbackup/following{/other_user}","gists_url":"https://api.github.com/users/borgbackup/gists{/gist_id}","starred_url":"https://api.github.com/users/borgbackup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borgbackup/subscriptions","organizations_url":"https://api.github.com/users/borgbackup/orgs","repos_url":"https://api.github.com/users/borgbackup/repos","events_url":"https://api.github.com/users/borgbackup/events{/privacy}","received_events_url":"https://api.github.com/users/borgbackup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/borgbackup/borg","description":"Deduplicating backup program with compression and authenticated encryption.","fork":false,"url":"https://api.github.com/repos/borgbackup/borg","forks_url":"https://api.github.com/repos/borgbackup/borg/forks","keys_url":"https://api.github.com/repos/borgbackup/borg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/borgbackup/borg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/borgbackup/borg/teams","hooks_url":"https://api.github.com/repos/borgbackup/borg/hooks","issue_events_url":"https://api.github.com/repos/borgbackup/borg/issues/events{/number}","events_url":"https://api.github.com/repos/borgbackup/borg/events","assignees_url":"https://api.github.com/repos/borgbackup/borg/assignees{/user}","branches_url":"https://api.github.com/repos/borgbackup/borg/branches{/branch}","tags_url":"https://api.github.com/repos/borgbackup/borg/tags","blobs_url":"https://api.github.com/repos/borgbackup/borg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/borgbackup/borg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/borgbackup/borg/git/refs{/sha}","trees_url":"https://api.github.com/repos/borgbackup/borg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/borgbackup/borg/statuses/{sha}","languages_url":"https://api.github.com/repos/borgbackup/borg/languages","stargazers_url":"https://api.github.com/repos/borgbackup/borg/stargazers","contributors_url":"https://api.github.com/repos/borgbackup/borg/contributors","subscribers_url":"https://api.github.com/repos/borgbackup/borg/subscribers","subscription_url":"https://api.github.com/repos/borgbackup/borg/subscription","commits_url":"https://api.github.com/repos/borgbackup/borg/commits{/sha}","git_commits_url":"https://api.github.com/repos/borgbackup/borg/git/commits{/sha}","comments_url":"https://api.github.com/repos/borgbackup/borg/comments{/number}","issue_comment_url":"https://api.github.com/repos/borgbackup/borg/issues/comments{/number}","contents_url":"https://api.github.com/repos/borgbackup/borg/contents/{+path}","compare_url":"https://api.github.com/repos/borgbackup/borg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/borgbackup/borg/merges","archive_url":"https://api.github.com/repos/borgbackup/borg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/borgbackup/borg/downloads","issues_url":"https://api.github.com/repos/borgbackup/borg/issues{/number}","pulls_url":"https://api.github.com/repos/borgbackup/borg/pulls{/number}","milestones_url":"https://api.github.com/repos/borgbackup/borg/milestones{/number}","notifications_url":"https://api.github.com/repos/borgbackup/borg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/borgbackup/borg/labels{/name}","releases_url":"https://api.github.com/repos/borgbackup/borg/releases{/id}","deployments_url":"https://api.github.com/repos/borgbackup/borg/deployments","created_at":"2015-05-12T23:10:47Z","updated_at":"2016-02-03T14:33:01Z","pushed_at":"2016-02-03T18:14:46Z","git_url":"git://github.com/borgbackup/borg.git","ssh_url":"git@github.com:borgbackup/borg.git","clone_url":"https://github.com/borgbackup/borg.git","svn_url":"https://github.com/borgbackup/borg","homepage":"https://borgbackup.github.io/","size":2950,"stargazers_count":783,"watchers_count":783,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":62,"mirror_url":null,"open_issues_count":92,"forks":62,"open_issues":92,"watchers":783,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/borgbackup/borg/pulls/625"},"html":{"href":"https://github.com/borgbackup/borg/pull/625"},"issue":{"href":"https://api.github.com/repos/borgbackup/borg/issues/625"},"comments":{"href":"https://api.github.com/repos/borgbackup/borg/issues/625/comments"},"review_comments":{"href":"https://api.github.com/repos/borgbackup/borg/pulls/625/comments"},"review_comment":{"href":"https://api.github.com/repos/borgbackup/borg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/borgbackup/borg/pulls/625/commits"},"statuses":{"href":"https://api.github.com/repos/borgbackup/borg/statuses/9241f7d76f1fc724c2204b7284c0896c52c2f7c1"}}}}