{"action":"created","comment":{"url":"https://api.github.com/repos/frej/fast-export/pulls/comments/195935898","pull_request_review_id":129395782,"id":195935898,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTkzNTg5OA==","diff_hunk":"@@ -99,6 +99,27 @@ name the -B and -T options allow a mapping file to be specified to\n rename branches and tags (respectively). The syntax of the mapping\n file is the same as for the author mapping.\n \n+Content filtering\n+-----------------\n+\n+hg-fast-export supports filtering the content of exported files.\n+The filter is supplied to the --filter-contents option. hg-fast-export\n+runs the filter for each exported file, pipes its content to the filter's\n+standard input, and uses the filter's standard output in place\n+of the file's original content. The prototypical use of this feature\n+is to convert line endings in text files from CRLF to git's preferred LF:\n+\n+```\n+-- Start of crlf-filter.sh --\n+#!/bin/sh\n+# $1 = pathname of exported file relative to the root of the repo\n+# $2 = Mercurial's hash of the file\n+# $3 = \"1\" if Mercurial reports the file as binary, otherwise \"0\"\n+\n+if \"$3\"; then dos2unix; else cat; fi","path":"README.md","position":21,"original_position":21,"commit_id":"ade39c531eb483b79809ddd518b9c5c708816ccb","original_commit_id":"ade39c531eb483b79809ddd518b9c5c708816ccb","user":{"login":"frej","id":544679,"node_id":"MDQ6VXNlcjU0NDY3OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/544679?v=4","gravatar_id":"","url":"https://api.github.com/users/frej","html_url":"https://github.com/frej","followers_url":"https://api.github.com/users/frej/followers","following_url":"https://api.github.com/users/frej/following{/other_user}","gists_url":"https://api.github.com/users/frej/gists{/gist_id}","starred_url":"https://api.github.com/users/frej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frej/subscriptions","organizations_url":"https://api.github.com/users/frej/orgs","repos_url":"https://api.github.com/users/frej/repos","events_url":"https://api.github.com/users/frej/events{/privacy}","received_events_url":"https://api.github.com/users/frej/received_events","type":"User","site_admin":false},"body":"Try\r\n```\r\nX=1\r\nif \"$X\" ; then echo true ; else echo false ; fi\r\n```\r\nand you'll see that this is not valid sh, you need to do `if [ \"$3\" == \"1\" ]; ...`","created_at":"2018-06-17T17:24:35Z","updated_at":"2018-06-17T17:36:07Z","html_url":"https://github.com/frej/fast-export/pull/95#discussion_r195935898","pull_request_url":"https://api.github.com/repos/frej/fast-export/pulls/95","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/frej/fast-export/pulls/comments/195935898"},"html":{"href":"https://github.com/frej/fast-export/pull/95#discussion_r195935898"},"pull_request":{"href":"https://api.github.com/repos/frej/fast-export/pulls/95"}}},"pull_request":{"url":"https://api.github.com/repos/frej/fast-export/pulls/95","id":122807031,"node_id":"MDExOlB1bGxSZXF1ZXN0MTIyODA3MDMx","html_url":"https://github.com/frej/fast-export/pull/95","diff_url":"https://github.com/frej/fast-export/pull/95.diff","patch_url":"https://github.com/frej/fast-export/pull/95.patch","issue_url":"https://api.github.com/repos/frej/fast-export/issues/95","number":95,"state":"open","locked":false,"title":"Filter file contents, Was: Suggestion: add --as-binary option to convert line endings","user":{"login":"atykhyy","id":797515,"node_id":"MDQ6VXNlcjc5NzUxNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/797515?v=4","gravatar_id":"","url":"https://api.github.com/users/atykhyy","html_url":"https://github.com/atykhyy","followers_url":"https://api.github.com/users/atykhyy/followers","following_url":"https://api.github.com/users/atykhyy/following{/other_user}","gists_url":"https://api.github.com/users/atykhyy/gists{/gist_id}","starred_url":"https://api.github.com/users/atykhyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atykhyy/subscriptions","organizations_url":"https://api.github.com/users/atykhyy/orgs","repos_url":"https://api.github.com/users/atykhyy/repos","events_url":"https://api.github.com/users/atykhyy/events{/privacy}","received_events_url":"https://api.github.com/users/atykhyy/received_events","type":"User","site_admin":false},"body":"Converting line endings in text files to LF is often needed when migrating from Mercurial to Git. Right now it is usually done by git filter-branch and other heavy-weight approaches, but it is very easy to do in fast-export provided that binary files have distinct filenames (e.g. distinct extensions). This change adds an option `--as-binary` that turns on auto-conversion of line endings to LF and takes a list of binary file extensions, e.g. `hg-fast-export ..\\repo --as-binary=.so,.dll`. As an implementation side-effect, dot-files (e.g. `.hgignore`) are treated as text.","created_at":"2017-05-28T19:59:14Z","updated_at":"2018-06-17T17:36:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"491717bb4ef4c8ceb9f7eee5c85f29c3dd2b2475","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":475112036,"node_id":"MDU6TGFiZWw0NzUxMTIwMzY=","url":"https://api.github.com/repos/frej/fast-export/labels/feature-request","name":"feature-request","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/frej/fast-export/pulls/95/commits","review_comments_url":"https://api.github.com/repos/frej/fast-export/pulls/95/comments","review_comment_url":"https://api.github.com/repos/frej/fast-export/pulls/comments{/number}","comments_url":"https://api.github.com/repos/frej/fast-export/issues/95/comments","statuses_url":"https://api.github.com/repos/frej/fast-export/statuses/ade39c531eb483b79809ddd518b9c5c708816ccb","head":{"label":"atykhyy:as-binary","ref":"as-binary","sha":"ade39c531eb483b79809ddd518b9c5c708816ccb","user":{"login":"atykhyy","id":797515,"node_id":"MDQ6VXNlcjc5NzUxNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/797515?v=4","gravatar_id":"","url":"https://api.github.com/users/atykhyy","html_url":"https://github.com/atykhyy","followers_url":"https://api.github.com/users/atykhyy/followers","following_url":"https://api.github.com/users/atykhyy/following{/other_user}","gists_url":"https://api.github.com/users/atykhyy/gists{/gist_id}","starred_url":"https://api.github.com/users/atykhyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atykhyy/subscriptions","organizations_url":"https://api.github.com/users/atykhyy/orgs","repos_url":"https://api.github.com/users/atykhyy/repos","events_url":"https://api.github.com/users/atykhyy/events{/privacy}","received_events_url":"https://api.github.com/users/atykhyy/received_events","type":"User","site_admin":false},"repo":{"id":92683480,"node_id":"MDEwOlJlcG9zaXRvcnk5MjY4MzQ4MA==","name":"fast-export","full_name":"atykhyy/fast-export","owner":{"login":"atykhyy","id":797515,"node_id":"MDQ6VXNlcjc5NzUxNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/797515?v=4","gravatar_id":"","url":"https://api.github.com/users/atykhyy","html_url":"https://github.com/atykhyy","followers_url":"https://api.github.com/users/atykhyy/followers","following_url":"https://api.github.com/users/atykhyy/following{/other_user}","gists_url":"https://api.github.com/users/atykhyy/gists{/gist_id}","starred_url":"https://api.github.com/users/atykhyy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atykhyy/subscriptions","organizations_url":"https://api.github.com/users/atykhyy/orgs","repos_url":"https://api.github.com/users/atykhyy/repos","events_url":"https://api.github.com/users/atykhyy/events{/privacy}","received_events_url":"https://api.github.com/users/atykhyy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/atykhyy/fast-export","description":"A mercurial to git converter using git-fast-import","fork":true,"url":"https://api.github.com/repos/atykhyy/fast-export","forks_url":"https://api.github.com/repos/atykhyy/fast-export/forks","keys_url":"https://api.github.com/repos/atykhyy/fast-export/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atykhyy/fast-export/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atykhyy/fast-export/teams","hooks_url":"https://api.github.com/repos/atykhyy/fast-export/hooks","issue_events_url":"https://api.github.com/repos/atykhyy/fast-export/issues/events{/number}","events_url":"https://api.github.com/repos/atykhyy/fast-export/events","assignees_url":"https://api.github.com/repos/atykhyy/fast-export/assignees{/user}","branches_url":"https://api.github.com/repos/atykhyy/fast-export/branches{/branch}","tags_url":"https://api.github.com/repos/atykhyy/fast-export/tags","blobs_url":"https://api.github.com/repos/atykhyy/fast-export/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atykhyy/fast-export/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atykhyy/fast-export/git/refs{/sha}","trees_url":"https://api.github.com/repos/atykhyy/fast-export/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atykhyy/fast-export/statuses/{sha}","languages_url":"https://api.github.com/repos/atykhyy/fast-export/languages","stargazers_url":"https://api.github.com/repos/atykhyy/fast-export/stargazers","contributors_url":"https://api.github.com/repos/atykhyy/fast-export/contributors","subscribers_url":"https://api.github.com/repos/atykhyy/fast-export/subscribers","subscription_url":"https://api.github.com/repos/atykhyy/fast-export/subscription","commits_url":"https://api.github.com/repos/atykhyy/fast-export/commits{/sha}","git_commits_url":"https://api.github.com/repos/atykhyy/fast-export/git/commits{/sha}","comments_url":"https://api.github.com/repos/atykhyy/fast-export/comments{/number}","issue_comment_url":"https://api.github.com/repos/atykhyy/fast-export/issues/comments{/number}","contents_url":"https://api.github.com/repos/atykhyy/fast-export/contents/{+path}","compare_url":"https://api.github.com/repos/atykhyy/fast-export/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atykhyy/fast-export/merges","archive_url":"https://api.github.com/repos/atykhyy/fast-export/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atykhyy/fast-export/downloads","issues_url":"https://api.github.com/repos/atykhyy/fast-export/issues{/number}","pulls_url":"https://api.github.com/repos/atykhyy/fast-export/pulls{/number}","milestones_url":"https://api.github.com/repos/atykhyy/fast-export/milestones{/number}","notifications_url":"https://api.github.com/repos/atykhyy/fast-export/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atykhyy/fast-export/labels{/name}","releases_url":"https://api.github.com/repos/atykhyy/fast-export/releases{/id}","deployments_url":"https://api.github.com/repos/atykhyy/fast-export/deployments","created_at":"2017-05-28T19:50:23Z","updated_at":"2017-05-28T19:50:25Z","pushed_at":"2018-06-15T19:21:41Z","git_url":"git://github.com/atykhyy/fast-export.git","ssh_url":"git@github.com:atykhyy/fast-export.git","clone_url":"https://github.com/atykhyy/fast-export.git","svn_url":"https://github.com/atykhyy/fast-export","homepage":"http://repo.or.cz/w/fast-export.git","size":346,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"frej:master","ref":"master","sha":"e200cec39fac8a8ebb1c7d7690c00d5cb15f0c30","user":{"login":"frej","id":544679,"node_id":"MDQ6VXNlcjU0NDY3OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/544679?v=4","gravatar_id":"","url":"https://api.github.com/users/frej","html_url":"https://github.com/frej","followers_url":"https://api.github.com/users/frej/followers","following_url":"https://api.github.com/users/frej/following{/other_user}","gists_url":"https://api.github.com/users/frej/gists{/gist_id}","starred_url":"https://api.github.com/users/frej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frej/subscriptions","organizations_url":"https://api.github.com/users/frej/orgs","repos_url":"https://api.github.com/users/frej/repos","events_url":"https://api.github.com/users/frej/events{/privacy}","received_events_url":"https://api.github.com/users/frej/received_events","type":"User","site_admin":false},"repo":{"id":2711478,"node_id":"MDEwOlJlcG9zaXRvcnkyNzExNDc4","name":"fast-export","full_name":"frej/fast-export","owner":{"login":"frej","id":544679,"node_id":"MDQ6VXNlcjU0NDY3OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/544679?v=4","gravatar_id":"","url":"https://api.github.com/users/frej","html_url":"https://github.com/frej","followers_url":"https://api.github.com/users/frej/followers","following_url":"https://api.github.com/users/frej/following{/other_user}","gists_url":"https://api.github.com/users/frej/gists{/gist_id}","starred_url":"https://api.github.com/users/frej/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/frej/subscriptions","organizations_url":"https://api.github.com/users/frej/orgs","repos_url":"https://api.github.com/users/frej/repos","events_url":"https://api.github.com/users/frej/events{/privacy}","received_events_url":"https://api.github.com/users/frej/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/frej/fast-export","description":"A mercurial to git converter using git-fast-import","fork":false,"url":"https://api.github.com/repos/frej/fast-export","forks_url":"https://api.github.com/repos/frej/fast-export/forks","keys_url":"https://api.github.com/repos/frej/fast-export/keys{/key_id}","collaborators_url":"https://api.github.com/repos/frej/fast-export/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/frej/fast-export/teams","hooks_url":"https://api.github.com/repos/frej/fast-export/hooks","issue_events_url":"https://api.github.com/repos/frej/fast-export/issues/events{/number}","events_url":"https://api.github.com/repos/frej/fast-export/events","assignees_url":"https://api.github.com/repos/frej/fast-export/assignees{/user}","branches_url":"https://api.github.com/repos/frej/fast-export/branches{/branch}","tags_url":"https://api.github.com/repos/frej/fast-export/tags","blobs_url":"https://api.github.com/repos/frej/fast-export/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/frej/fast-export/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/frej/fast-export/git/refs{/sha}","trees_url":"https://api.github.com/repos/frej/fast-export/git/trees{/sha}","statuses_url":"https://api.github.com/repos/frej/fast-export/statuses/{sha}","languages_url":"https://api.github.com/repos/frej/fast-export/languages","stargazers_url":"https://api.github.com/repos/frej/fast-export/stargazers","contributors_url":"https://api.github.com/repos/frej/fast-export/contributors","subscribers_url":"https://api.github.com/repos/frej/fast-export/subscribers","subscription_url":"https://api.github.com/repos/frej/fast-export/subscription","commits_url":"https://api.github.com/repos/frej/fast-export/commits{/sha}","git_commits_url":"https://api.github.com/repos/frej/fast-export/git/commits{/sha}","comments_url":"https://api.github.com/repos/frej/fast-export/comments{/number}","issue_comment_url":"https://api.github.com/repos/frej/fast-export/issues/comments{/number}","contents_url":"https://api.github.com/repos/frej/fast-export/contents/{+path}","compare_url":"https://api.github.com/repos/frej/fast-export/compare/{base}...{head}","merges_url":"https://api.github.com/repos/frej/fast-export/merges","archive_url":"https://api.github.com/repos/frej/fast-export/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/frej/fast-export/downloads","issues_url":"https://api.github.com/repos/frej/fast-export/issues{/number}","pulls_url":"https://api.github.com/repos/frej/fast-export/pulls{/number}","milestones_url":"https://api.github.com/repos/frej/fast-export/milestones{/number}","notifications_url":"https://api.github.com/repos/frej/fast-export/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/frej/fast-export/labels{/name}","releases_url":"https://api.github.com/repos/frej/fast-export/releases{/id}","deployments_url":"https://api.github.com/repos/frej/fast-export/deployments","created_at":"2011-11-04T18:55:11Z","updated_at":"2018-06-17T13:58:27Z","pushed_at":"2018-06-15T19:21:43Z","git_url":"git://github.com/frej/fast-export.git","ssh_url":"git@github.com:frej/fast-export.git","clone_url":"https://github.com/frej/fast-export.git","svn_url":"https://github.com/frej/fast-export","homepage":"http://repo.or.cz/w/fast-export.git","size":349,"stargazers_count":473,"watchers_count":473,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":118,"mirror_url":null,"archived":false,"open_issues_count":14,"license":null,"forks":118,"open_issues":14,"watchers":473,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/frej/fast-export/pulls/95"},"html":{"href":"https://github.com/frej/fast-export/pull/95"},"issue":{"href":"https://api.github.com/repos/frej/fast-export/issues/95"},"comments":{"href":"https://api.github.com/repos/frej/fast-export/issues/95/comments"},"review_comments":{"href":"https://api.github.com/repos/frej/fast-export/pulls/95/comments"},"review_comment":{"href":"https://api.github.com/repos/frej/fast-export/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/frej/fast-export/pulls/95/commits"},"statuses":{"href":"https://api.github.com/repos/frej/fast-export/statuses/ade39c531eb483b79809ddd518b9c5c708816ccb"}},"author_association":"NONE"}}
{"actor":{"display_login":"frej"}}