{"action":"created","issue":{"url":"https://api.github.com/repos/squid-cache/squid/issues/20","repository_url":"https://api.github.com/repos/squid-cache/squid","labels_url":"https://api.github.com/repos/squid-cache/squid/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/squid-cache/squid/issues/20/comments","events_url":"https://api.github.com/repos/squid-cache/squid/issues/20/events","html_url":"https://github.com/squid-cache/squid/issues/20","id":214539089,"number":20,"title":"Convert Squid bzr repository to git","user":{"login":"rousskov","id":1084944,"avatar_url":"https://avatars3.githubusercontent.com/u/1084944?v=3","gravatar_id":"","url":"https://api.github.com/users/rousskov","html_url":"https://github.com/rousskov","followers_url":"https://api.github.com/users/rousskov/followers","following_url":"https://api.github.com/users/rousskov/following{/other_user}","gists_url":"https://api.github.com/users/rousskov/gists{/gist_id}","starred_url":"https://api.github.com/users/rousskov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rousskov/subscriptions","organizations_url":"https://api.github.com/users/rousskov/orgs","repos_url":"https://api.github.com/users/rousskov/repos","events_url":"https://api.github.com/users/rousskov/events{/privacy}","received_events_url":"https://api.github.com/users/rousskov/received_events","type":"User","site_admin":false},"labels":[{"id":559980926,"url":"https://api.github.com/repos/squid-cache/squid/labels/DevOps","name":"DevOps","color":"006b75","default":false}],"state":"open","locked":false,"assignee":{"login":"eduard-bagdasaryan","id":13069213,"avatar_url":"https://avatars0.githubusercontent.com/u/13069213?v=3","gravatar_id":"","url":"https://api.github.com/users/eduard-bagdasaryan","html_url":"https://github.com/eduard-bagdasaryan","followers_url":"https://api.github.com/users/eduard-bagdasaryan/followers","following_url":"https://api.github.com/users/eduard-bagdasaryan/following{/other_user}","gists_url":"https://api.github.com/users/eduard-bagdasaryan/gists{/gist_id}","starred_url":"https://api.github.com/users/eduard-bagdasaryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduard-bagdasaryan/subscriptions","organizations_url":"https://api.github.com/users/eduard-bagdasaryan/orgs","repos_url":"https://api.github.com/users/eduard-bagdasaryan/repos","events_url":"https://api.github.com/users/eduard-bagdasaryan/events{/privacy}","received_events_url":"https://api.github.com/users/eduard-bagdasaryan/received_events","type":"User","site_admin":false},"assignees":[{"login":"eduard-bagdasaryan","id":13069213,"avatar_url":"https://avatars0.githubusercontent.com/u/13069213?v=3","gravatar_id":"","url":"https://api.github.com/users/eduard-bagdasaryan","html_url":"https://github.com/eduard-bagdasaryan","followers_url":"https://api.github.com/users/eduard-bagdasaryan/followers","following_url":"https://api.github.com/users/eduard-bagdasaryan/following{/other_user}","gists_url":"https://api.github.com/users/eduard-bagdasaryan/gists{/gist_id}","starred_url":"https://api.github.com/users/eduard-bagdasaryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eduard-bagdasaryan/subscriptions","organizations_url":"https://api.github.com/users/eduard-bagdasaryan/orgs","repos_url":"https://api.github.com/users/eduard-bagdasaryan/repos","events_url":"https://api.github.com/users/eduard-bagdasaryan/events{/privacy}","received_events_url":"https://api.github.com/users/eduard-bagdasaryan/received_events","type":"User","site_admin":false}],"milestone":null,"comments":28,"created_at":"2017-03-15T21:59:01Z","updated_at":"2017-06-16T16:19:24Z","closed_at":null,"body":"Basic bzr to git repository conversion is a fairly straightforward [process](http://stackoverflow.com/questions/19930832/converting-big-bzr-repository-to-git-what-to-expect). Please write a simple script that adds a named bzr branch to the current git repository (possibly under different branch name). Here is a usage example (the shown .sh extension does not imply that you have to use portable shell; you may use any common and easily-installed scripting language such as Perl, Python, or Javascript):\r\n\r\n```\r\n# importing official v5 branch (checked out in ../squid/5)\r\n# as the master git branch (of the git project in ./)\r\nimport-bzr-branch.sh ../squid/5 master\r\n\r\n# importing one more official branch\r\nimport-bzr-branch.sh ../squid/3.5 v3.5\r\n```\r\n\r\nYou will need to figure out what will happen to the official branches that are not explicitly imported but are used by the imported branches (e.g., the bzr branch called \"trunk\"). This may get tricky, but I hope that fast-import/export tools will take care of that automatically. After the conversion, the git repository should have all of the official Squid3+ branches (3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 4.0) plus master (containing Squid v5.0 code right now).\r\n\r\nYou will need to check that all bzr tags have been preserved as git tags and add code to preserve them if needed. I do not expect significant difficulties here.\r\n\r\nThe biggest known problem you will face is that known existing conversion helpers lose Squid Project metadata, including:\r\n\r\n- **co-authors**: Unlike bzr, git does not support multiple authors per commit. During automated conversion, only the listed-first author is added to the git commit metadata.\r\n- **fixes**: The Squid Bugzilla URLs, added via \"bzr --fixes ...\"\r\n- **revno**: Many bzr commit messages and squid-dev emails refer to bzr revision numbers. Bzr generates revision numbers based on the branch commit order and shows them in \"bzr log\", \"bzr annotate\", and other human-friendly contexts. Git does not generate these numbers in similar contexts and folks use abbreviated commit hashes instead. We will do the same going forward, but that past information is very valuable and has to be preserved in a human-friendly, easily accessible format.\r\n- **branch nick**: A.k.a. branch name. This will be more-or-less preserved for primary official branches (e.g., v3.5 or v4) but I am not sure what will happen to fully merged or 3rd-party branches (e.g., v5 [r14983](http://bazaar.launchpad.net/~squid/squid/5/revision/14983) showing a un-squashed merge from the _auth-refactor_ branch). It would be nice to preserve those branch nicks in merged commits (e.g., v5 [r14976.1.17](http://bazaar.launchpad.net/~squid/squid/5/revision/14976.1.17) commit metadata should preserve the fact that it came from the _auth-refactor_ branch). Also, the revno mentioned above is branch-specific so the two should probably be preserved/stored together.\r\n\r\nA proper conversion must add all of the above metadata as git [notes](http://alblue.bandlem.com/2011/11/git-tip-of-week-git-notes.html). I suggest the following note format (with utf8 encoding):\r\n\r\n```\r\nCo-Authored-By: <second author name and email>\r\nCo-Authored-By: <third author name and email>\r\n...\r\nFixes: <Squid Bugzilla report URL, not just the bug number>\r\nBzr-Reference: <branch_nick> r<revno>\r\n```\r\n\r\nAfter the git conversion, new commits will not be annotated with Bzr-Reference fields, of course, but other fields will continue to be used as needed (and we may add [more](https://git.wiki.kernel.org/index.php/CommitMessageConventions)).\r\n\r\nDuring the conversion, please add notes to the fast-export file. The format is documented [elsewhere](https://git-scm.com/docs/git-fast-import), but I recommend adding a few notes to a test git repository and fast-exporting them to see how they should look _and_ reviewing a few _N_ command examples in [import tests](https://github.com/dfabulich/easygit/blob/master/t/t9301-fast-import-notes.sh#L122-L140).\r\n\r\nPlease note that the conversion process must be fully automated as shown in the example at the beginning of this issue description. While the final version will be used only once for the official bzr repository (so the script code does not have to be of great quality), it will be used many times during acceptance testing and it will be handy for Squid developers converting their own bzr repositories to their own git repositories."},"comment":{"url":"https://api.github.com/repos/squid-cache/squid/issues/comments/309069855","html_url":"https://github.com/squid-cache/squid/issues/20#issuecomment-309069855","issue_url":"https://api.github.com/repos/squid-cache/squid/issues/20","id":309069855,"user":{"login":"rousskov","id":1084944,"avatar_url":"https://avatars3.githubusercontent.com/u/1084944?v=3","gravatar_id":"","url":"https://api.github.com/users/rousskov","html_url":"https://github.com/rousskov","followers_url":"https://api.github.com/users/rousskov/followers","following_url":"https://api.github.com/users/rousskov/following{/other_user}","gists_url":"https://api.github.com/users/rousskov/gists{/gist_id}","starred_url":"https://api.github.com/users/rousskov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rousskov/subscriptions","organizations_url":"https://api.github.com/users/rousskov/orgs","repos_url":"https://api.github.com/users/rousskov/repos","events_url":"https://api.github.com/users/rousskov/events{/privacy}","received_events_url":"https://api.github.com/users/rousskov/received_events","type":"User","site_admin":false},"created_at":"2017-06-16T16:19:24Z","updated_at":"2017-06-16T16:19:24Z","body":"> I was thinking that some of tags information could be lost.\r\n\r\nYour thinking was correct, but we actually want to lose wrong or misplaced information. Since those v1 and v2 branches are not official (and, according to Henrik differ from the official ones!), those branches (and any information they provide) should not be imported."}}
{"actor":{"display_login":"rousskov"}}