{"action":"created","issue":{"url":"https://api.github.com/repos/isomorphic-git/isomorphic-git/issues/631","repository_url":"https://api.github.com/repos/isomorphic-git/isomorphic-git","labels_url":"https://api.github.com/repos/isomorphic-git/isomorphic-git/issues/631/labels{/name}","comments_url":"https://api.github.com/repos/isomorphic-git/isomorphic-git/issues/631/comments","events_url":"https://api.github.com/repos/isomorphic-git/isomorphic-git/issues/631/events","html_url":"https://github.com/isomorphic-git/isomorphic-git/issues/631","id":389076062,"node_id":"MDU6SXNzdWUzODkwNzYwNjI=","number":631,"title":"Naming things consistantly","user":{"login":"wmhilton","id":587740,"node_id":"MDQ6VXNlcjU4Nzc0MA==","avatar_url":"https://avatars2.githubusercontent.com/u/587740?v=4","gravatar_id":"","url":"https://api.github.com/users/wmhilton","html_url":"https://github.com/wmhilton","followers_url":"https://api.github.com/users/wmhilton/followers","following_url":"https://api.github.com/users/wmhilton/following{/other_user}","gists_url":"https://api.github.com/users/wmhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/wmhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmhilton/subscriptions","organizations_url":"https://api.github.com/users/wmhilton/orgs","repos_url":"https://api.github.com/users/wmhilton/repos","events_url":"https://api.github.com/users/wmhilton/events{/privacy}","received_events_url":"https://api.github.com/users/wmhilton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-12-09T23:16:18Z","updated_at":"2018-12-10T21:34:53Z","closed_at":null,"author_association":"MEMBER","body":"I have tried REALLY hard to be consistent with how I name things throughout the API so there are no surprises. But a few inconsistencies have come to my attention:\r\n\r\nFiles (in the index)\r\n- add({ filepath })\r\n- remove({ filepath })\r\n- listFiles({ })\r\n\r\nBranches\r\n- branch({ ref }) _(why isn't this argument `branch`?)_\r\n- deleteBranch({ ref })\r\n- listBranches({ })\r\n\r\nRemotes\r\n- addRemote({ remote }) _(why isn't this called `remote`?)_\r\n- deleteRemote({ remote })\r\n- listRemotes({ })\r\n\r\nTags\r\n- TBD\r\n- TBD\r\n- listTags({ })\r\n\r\nThere's a few competing goals:\r\n1. Consistency with canonical git. Examples:\r\n  - `add` = `git add`\r\n  - `remove` = `git rm`\r\n  - `listFiles` = `git ls-files`\r\n  - `branch` = `git branch`\r\n2. Self-consistency (made difficult because canonical git is inconsistent). Examples:\r\n  - `addFile({ file })` would be consistent with `addRemote({ remote })`\r\n  - `addBranch({ branch })` would be consistent with `addTag({ tag })`\r\n\r\n@mojavelinux @yuhr @juancampa which style do you prefer? (If we change anything, we would add aliases for arguments / function names to preserve backwards compatibility for the 0.x series as always!)"},"comment":{"url":"https://api.github.com/repos/isomorphic-git/isomorphic-git/issues/comments/445982230","html_url":"https://github.com/isomorphic-git/isomorphic-git/issues/631#issuecomment-445982230","issue_url":"https://api.github.com/repos/isomorphic-git/isomorphic-git/issues/631","id":445982230,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NTk4MjIzMA==","user":{"login":"wmhilton","id":587740,"node_id":"MDQ6VXNlcjU4Nzc0MA==","avatar_url":"https://avatars2.githubusercontent.com/u/587740?v=4","gravatar_id":"","url":"https://api.github.com/users/wmhilton","html_url":"https://github.com/wmhilton","followers_url":"https://api.github.com/users/wmhilton/followers","following_url":"https://api.github.com/users/wmhilton/following{/other_user}","gists_url":"https://api.github.com/users/wmhilton/gists{/gist_id}","starred_url":"https://api.github.com/users/wmhilton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmhilton/subscriptions","organizations_url":"https://api.github.com/users/wmhilton/orgs","repos_url":"https://api.github.com/users/wmhilton/repos","events_url":"https://api.github.com/users/wmhilton/events{/privacy}","received_events_url":"https://api.github.com/users/wmhilton/received_events","type":"User","site_admin":false},"created_at":"2018-12-10T21:34:53Z","updated_at":"2018-12-10T21:34:53Z","author_association":"MEMBER","body":"Ah. To muddy the waters a bit, I remember now why the argument to `remote` is `remote` and the argument to `branch` is `ref`: re-usability of the params:\r\n\r\n```js\r\nlet ref = 'new-branch'\r\nawait git.branch({ dir, ref })\r\nawait git.checkout({ dir, ref })\r\nawait git.push({ dir, ref })\r\n\r\nlet remote = 'upstream'\r\nlet url = 'https://github.com/isomorphic-git/isomorphic-git'\r\nawait git.addRemote({ dir, remote, url })\r\nawait git.fetch({ dir, remote })\r\nawait git.checkout({ dir, ref, remote })\r\n```\r\n\r\nSo by this logic... really the argument to `tag` should _also_ be `ref`."}}
{"actor":{"display_login":"wmhilton"}}