{"action":"closed","number":2500,"pull_request":{"url":"https://api.github.com/repos/syncthing/syncthing/pulls/2500","id":51443444,"html_url":"https://github.com/syncthing/syncthing/pull/2500","diff_url":"https://github.com/syncthing/syncthing/pull/2500.diff","patch_url":"https://github.com/syncthing/syncthing/pull/2500.patch","issue_url":"https://api.github.com/repos/syncthing/syncthing/issues/2500","number":2500,"state":"closed","locked":false,"title":"Handle sparse files (fixes #245)","user":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"body":"This implements sparse file support. It does this by\r\n\r\n - Using `Truncate()` on the temp file to set it to the final size immediately. On NTFS and Unixes this creates a sparse file; on Mac it's just a large file full of zeroes.\r\n\r\n - Not transferring / copying full blocks of zeroes, as these are already present in the file. The exception is if we're reusing a temp file, which might not have zeroes in the right place.\r\n\r\nEnd result is that we don't transfer full blocks of zeroes and may or may not create a sparse file on the destination depending on the filesystem in use. It also means we automatically sparsify existing files when transferring them (again, when supported by the fs).\r\n\r\nBlocks of all zeroes that are not exactly BlockSize-sized are not handled specially, so the last block of zeroes in a file may actually get written and also blocks that start with nonzero data. Don't care.","created_at":"2015-11-21T15:35:31Z","updated_at":"2015-11-21T17:21:11Z","closed_at":"2015-11-21T17:21:11Z","merged_at":"2015-11-21T17:21:11Z","merge_commit_sha":"2f720f15a07e2ad398939c1aacb8b9f53812e832","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/syncthing/syncthing/pulls/2500/commits","review_comments_url":"https://api.github.com/repos/syncthing/syncthing/pulls/2500/comments","review_comment_url":"https://api.github.com/repos/syncthing/syncthing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/2500/comments","statuses_url":"https://api.github.com/repos/syncthing/syncthing/statuses/d46f2676634f0d64f5866e5599d20112ec225413","head":{"label":"calmh:sparse","ref":"sparse","sha":"d46f2676634f0d64f5866e5599d20112ec225413","user":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"repo":{"id":29292392,"name":"syncthing","full_name":"calmh/syncthing","owner":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/calmh/syncthing","description":"This is my personal fork of the repo, not the official one! It may be outdated, broken, rebased upon and generally screwed around with. Don't watch it, star it, or fork from it! :)","fork":true,"url":"https://api.github.com/repos/calmh/syncthing","forks_url":"https://api.github.com/repos/calmh/syncthing/forks","keys_url":"https://api.github.com/repos/calmh/syncthing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calmh/syncthing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calmh/syncthing/teams","hooks_url":"https://api.github.com/repos/calmh/syncthing/hooks","issue_events_url":"https://api.github.com/repos/calmh/syncthing/issues/events{/number}","events_url":"https://api.github.com/repos/calmh/syncthing/events","assignees_url":"https://api.github.com/repos/calmh/syncthing/assignees{/user}","branches_url":"https://api.github.com/repos/calmh/syncthing/branches{/branch}","tags_url":"https://api.github.com/repos/calmh/syncthing/tags","blobs_url":"https://api.github.com/repos/calmh/syncthing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calmh/syncthing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calmh/syncthing/git/refs{/sha}","trees_url":"https://api.github.com/repos/calmh/syncthing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calmh/syncthing/statuses/{sha}","languages_url":"https://api.github.com/repos/calmh/syncthing/languages","stargazers_url":"https://api.github.com/repos/calmh/syncthing/stargazers","contributors_url":"https://api.github.com/repos/calmh/syncthing/contributors","subscribers_url":"https://api.github.com/repos/calmh/syncthing/subscribers","subscription_url":"https://api.github.com/repos/calmh/syncthing/subscription","commits_url":"https://api.github.com/repos/calmh/syncthing/commits{/sha}","git_commits_url":"https://api.github.com/repos/calmh/syncthing/git/commits{/sha}","comments_url":"https://api.github.com/repos/calmh/syncthing/comments{/number}","issue_comment_url":"https://api.github.com/repos/calmh/syncthing/issues/comments{/number}","contents_url":"https://api.github.com/repos/calmh/syncthing/contents/{+path}","compare_url":"https://api.github.com/repos/calmh/syncthing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calmh/syncthing/merges","archive_url":"https://api.github.com/repos/calmh/syncthing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calmh/syncthing/downloads","issues_url":"https://api.github.com/repos/calmh/syncthing/issues{/number}","pulls_url":"https://api.github.com/repos/calmh/syncthing/pulls{/number}","milestones_url":"https://api.github.com/repos/calmh/syncthing/milestones{/number}","notifications_url":"https://api.github.com/repos/calmh/syncthing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calmh/syncthing/labels{/name}","releases_url":"https://api.github.com/repos/calmh/syncthing/releases{/id}","created_at":"2015-01-15T10:31:42Z","updated_at":"2015-10-11T11:56:51Z","pushed_at":"2015-11-21T16:58:14Z","git_url":"git://github.com/calmh/syncthing.git","ssh_url":"git@github.com:calmh/syncthing.git","clone_url":"https://github.com/calmh/syncthing.git","svn_url":"https://github.com/calmh/syncthing","homepage":"https://github.com/syncthing/syncthing","size":58263,"stargazers_count":18,"watchers_count":18,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":0,"forks":5,"open_issues":0,"watchers":18,"default_branch":"master"}},"base":{"label":"syncthing:master","ref":"master","sha":"6a98534d5d0e53fb1bf58651bd88f9898341a153","user":{"login":"syncthing","id":7628018,"avatar_url":"https://avatars.githubusercontent.com/u/7628018?v=3","gravatar_id":"","url":"https://api.github.com/users/syncthing","html_url":"https://github.com/syncthing","followers_url":"https://api.github.com/users/syncthing/followers","following_url":"https://api.github.com/users/syncthing/following{/other_user}","gists_url":"https://api.github.com/users/syncthing/gists{/gist_id}","starred_url":"https://api.github.com/users/syncthing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syncthing/subscriptions","organizations_url":"https://api.github.com/users/syncthing/orgs","repos_url":"https://api.github.com/users/syncthing/repos","events_url":"https://api.github.com/users/syncthing/events{/privacy}","received_events_url":"https://api.github.com/users/syncthing/received_events","type":"Organization","site_admin":false},"repo":{"id":14712850,"name":"syncthing","full_name":"syncthing/syncthing","owner":{"login":"syncthing","id":7628018,"avatar_url":"https://avatars.githubusercontent.com/u/7628018?v=3","gravatar_id":"","url":"https://api.github.com/users/syncthing","html_url":"https://github.com/syncthing","followers_url":"https://api.github.com/users/syncthing/followers","following_url":"https://api.github.com/users/syncthing/following{/other_user}","gists_url":"https://api.github.com/users/syncthing/gists{/gist_id}","starred_url":"https://api.github.com/users/syncthing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syncthing/subscriptions","organizations_url":"https://api.github.com/users/syncthing/orgs","repos_url":"https://api.github.com/users/syncthing/repos","events_url":"https://api.github.com/users/syncthing/events{/privacy}","received_events_url":"https://api.github.com/users/syncthing/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/syncthing/syncthing","description":"Open Source Continuous File Synchronization","fork":false,"url":"https://api.github.com/repos/syncthing/syncthing","forks_url":"https://api.github.com/repos/syncthing/syncthing/forks","keys_url":"https://api.github.com/repos/syncthing/syncthing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/syncthing/syncthing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/syncthing/syncthing/teams","hooks_url":"https://api.github.com/repos/syncthing/syncthing/hooks","issue_events_url":"https://api.github.com/repos/syncthing/syncthing/issues/events{/number}","events_url":"https://api.github.com/repos/syncthing/syncthing/events","assignees_url":"https://api.github.com/repos/syncthing/syncthing/assignees{/user}","branches_url":"https://api.github.com/repos/syncthing/syncthing/branches{/branch}","tags_url":"https://api.github.com/repos/syncthing/syncthing/tags","blobs_url":"https://api.github.com/repos/syncthing/syncthing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/syncthing/syncthing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/syncthing/syncthing/git/refs{/sha}","trees_url":"https://api.github.com/repos/syncthing/syncthing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/syncthing/syncthing/statuses/{sha}","languages_url":"https://api.github.com/repos/syncthing/syncthing/languages","stargazers_url":"https://api.github.com/repos/syncthing/syncthing/stargazers","contributors_url":"https://api.github.com/repos/syncthing/syncthing/contributors","subscribers_url":"https://api.github.com/repos/syncthing/syncthing/subscribers","subscription_url":"https://api.github.com/repos/syncthing/syncthing/subscription","commits_url":"https://api.github.com/repos/syncthing/syncthing/commits{/sha}","git_commits_url":"https://api.github.com/repos/syncthing/syncthing/git/commits{/sha}","comments_url":"https://api.github.com/repos/syncthing/syncthing/comments{/number}","issue_comment_url":"https://api.github.com/repos/syncthing/syncthing/issues/comments{/number}","contents_url":"https://api.github.com/repos/syncthing/syncthing/contents/{+path}","compare_url":"https://api.github.com/repos/syncthing/syncthing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/syncthing/syncthing/merges","archive_url":"https://api.github.com/repos/syncthing/syncthing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/syncthing/syncthing/downloads","issues_url":"https://api.github.com/repos/syncthing/syncthing/issues{/number}","pulls_url":"https://api.github.com/repos/syncthing/syncthing/pulls{/number}","milestones_url":"https://api.github.com/repos/syncthing/syncthing/milestones{/number}","notifications_url":"https://api.github.com/repos/syncthing/syncthing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/syncthing/syncthing/labels{/name}","releases_url":"https://api.github.com/repos/syncthing/syncthing/releases{/id}","created_at":"2013-11-26T09:48:21Z","updated_at":"2015-11-20T21:06:57Z","pushed_at":"2015-11-21T17:21:11Z","git_url":"git://github.com/syncthing/syncthing.git","ssh_url":"git@github.com:syncthing/syncthing.git","clone_url":"https://github.com/syncthing/syncthing.git","svn_url":"https://github.com/syncthing/syncthing","homepage":"http://forum.syncthing.net/","size":63304,"stargazers_count":10392,"watchers_count":10392,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":765,"mirror_url":null,"open_issues_count":171,"forks":765,"open_issues":171,"watchers":10392,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/2500"},"html":{"href":"https://github.com/syncthing/syncthing/pull/2500"},"issue":{"href":"https://api.github.com/repos/syncthing/syncthing/issues/2500"},"comments":{"href":"https://api.github.com/repos/syncthing/syncthing/issues/2500/comments"},"review_comments":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/2500/comments"},"review_comment":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/syncthing/syncthing/pulls/2500/commits"},"statuses":{"href":"https://api.github.com/repos/syncthing/syncthing/statuses/d46f2676634f0d64f5866e5599d20112ec225413"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"AudriusButkevicius","id":1144861,"avatar_url":"https://avatars.githubusercontent.com/u/1144861?v=3","gravatar_id":"","url":"https://api.github.com/users/AudriusButkevicius","html_url":"https://github.com/AudriusButkevicius","followers_url":"https://api.github.com/users/AudriusButkevicius/followers","following_url":"https://api.github.com/users/AudriusButkevicius/following{/other_user}","gists_url":"https://api.github.com/users/AudriusButkevicius/gists{/gist_id}","starred_url":"https://api.github.com/users/AudriusButkevicius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AudriusButkevicius/subscriptions","organizations_url":"https://api.github.com/users/AudriusButkevicius/orgs","repos_url":"https://api.github.com/users/AudriusButkevicius/repos","events_url":"https://api.github.com/users/AudriusButkevicius/events{/privacy}","received_events_url":"https://api.github.com/users/AudriusButkevicius/received_events","type":"User","site_admin":false},"comments":2,"review_comments":2,"commits":1,"additions":136,"deletions":1,"changed_files":6}}