{"action":"created","issue":{"url":"https://api.github.com/repos/hyperledger/fabric/issues/1461","repository_url":"https://api.github.com/repos/hyperledger/fabric","labels_url":"https://api.github.com/repos/hyperledger/fabric/issues/1461/labels{/name}","comments_url":"https://api.github.com/repos/hyperledger/fabric/issues/1461/comments","events_url":"https://api.github.com/repos/hyperledger/fabric/issues/1461/events","html_url":"https://github.com/hyperledger/fabric/pull/1461","id":154494042,"number":1461,"title":"Rename ChaincodeSpec.ctor to ChaincodeSpec.input","user":{"login":"srderson","id":4872087,"avatar_url":"https://avatars.githubusercontent.com/u/4872087?v=3","gravatar_id":"","url":"https://api.github.com/users/srderson","html_url":"https://github.com/srderson","followers_url":"https://api.github.com/users/srderson/followers","following_url":"https://api.github.com/users/srderson/following{/other_user}","gists_url":"https://api.github.com/users/srderson/gists{/gist_id}","starred_url":"https://api.github.com/users/srderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srderson/subscriptions","organizations_url":"https://api.github.com/users/srderson/orgs","repos_url":"https://api.github.com/users/srderson/repos","events_url":"https://api.github.com/users/srderson/events{/privacy}","received_events_url":"https://api.github.com/users/srderson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-05-12T14:17:36Z","updated_at":"2016-05-12T15:16:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hyperledger/fabric/pulls/1461","html_url":"https://github.com/hyperledger/fabric/pull/1461","diff_url":"https://github.com/hyperledger/fabric/pull/1461.diff","patch_url":"https://github.com/hyperledger/fabric/pull/1461.patch"},"body":"<!--- Provide a general summary of your changes in the Title above -->\r\n\r\n## Description\r\n<!--- Describe your changes in detail. -->\r\nThis change renames `ChaincodeSpec.ctor` to `ChaincodeSpec.Input` in `chaincode.proto`. This causes API changes when deploying, invoking, or querying a transaction. The changes are to the REST API, the gRPC API, and the CLI where `ctor` `c` has been renamed to `input` `i`. All documentation has been updated to reflect these changes.\r\n\r\n## Motivation and Context\r\n<!--- Why is this change required? What problem does it solve? -->\r\n<!--- If it fixes an open issue, please link to the issue here. -->\r\nThis is part of issue #1183. The goal is to have a cleaner and more understandable API. `ctorMsg` is a leftover from the days when `ChaincodeSpec` was intended to define a chaincode. At some point this was overloaded and also used for invocation. At this point, we have decided to use `ChaincodeSpec` for all elements that are common between `ChaincodeDeploymentSpec` and `ChaincodeInvocationSpec`. Specific elements will be moved to either `ChaincodeDeploymentSpec` or `ChaincodeInvocationSpec`.\r\n\r\nWhile breaking API changes are unfortunate, this change should result in a better user experience over the long run.\r\n\r\n## How Has This Been Tested?\r\n<!--- Please describe in detail how you tested your changes. -->\r\n<!--- If this PR does not contain a new test case, explain why. -->\r\nThe tests have all been run and passed. There are no new tests because there are no feature changes. Some tests were modified to support the new API.\r\n\r\n## Checklist:\r\n<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->\r\n<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->\r\n- [x] I have added a [Signed-off-by](https://github.com/hyperledger/fabric/blob/master/CONTRIBUTING.md#legal-stuff)\r\n- [x] Either no new documentation is required by this change, OR I added new documentation\r\n- [x] Either no new tests are required by this change, OR I added new tests\r\n- [x] I have run [goimports](https://godoc.org/golang.org/x/tools/cmd/goimports), [go vet](https://golang.org/cmd/vet/), and [golint](https://github.com/golang/lint). I have cleaned up all valid errors and warnings in code I have added or modified. These tools may generate false positives. Don't be worried about ignoring some errors or warnings. The goal is clean, consistent, and readable code.\r\n\r\nSigned-off-by: <sheehan@us.ibm.com>\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hyperledger/fabric/issues/comments/218789472","html_url":"https://github.com/hyperledger/fabric/pull/1461#issuecomment-218789472","issue_url":"https://api.github.com/repos/hyperledger/fabric/issues/1461","id":218789472,"user":{"login":"jyellick","id":7431583,"avatar_url":"https://avatars.githubusercontent.com/u/7431583?v=3","gravatar_id":"","url":"https://api.github.com/users/jyellick","html_url":"https://github.com/jyellick","followers_url":"https://api.github.com/users/jyellick/followers","following_url":"https://api.github.com/users/jyellick/following{/other_user}","gists_url":"https://api.github.com/users/jyellick/gists{/gist_id}","starred_url":"https://api.github.com/users/jyellick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyellick/subscriptions","organizations_url":"https://api.github.com/users/jyellick/orgs","repos_url":"https://api.github.com/users/jyellick/repos","events_url":"https://api.github.com/users/jyellick/events{/privacy}","received_events_url":"https://api.github.com/users/jyellick/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T15:16:01Z","updated_at":"2016-05-12T15:16:01Z","body":"To expound on what @srderson said, my flow has been:\r\n\r\n```\r\ngit checkout upstream/master\r\ngit checkout -b bigfeature-pr1\r\n# do changes and commits push, submit PR\r\ngit checkout -b bigfeature-pr2\r\n# do changes and commits push, submit PR\r\n...\r\ngit checkout -b bigfeature-prn\r\n...\r\n```\r\n\r\nThen if there ends up being a merge conflict at some point, it's as easy as walking back through the tree\r\n\r\n```\r\ngit checkout bigfeature-pr2\r\ngit rebase upstream/master\r\ngit checkout bigfeature-pr3\r\ngit rebase bigfeature-pr2\r\ngit push -f\r\ngit checkout bigfeature-pr4\r\ngit rebase bigfeature-pr3\r\ngit push -f\r\n...\r\n```\r\n\r\nGithub PRs seem to handle the `push -f` pretty gracefully.  Though the diffs in the UI won't initially be great, they can always be viewed through the git cli."}}