{"action":"created","issue":{"url":"https://api.github.com/repos/gitgitgadget/git/issues/101","repository_url":"https://api.github.com/repos/gitgitgadget/git","labels_url":"https://api.github.com/repos/gitgitgadget/git/issues/101/labels{/name}","comments_url":"https://api.github.com/repos/gitgitgadget/git/issues/101/comments","events_url":"https://api.github.com/repos/gitgitgadget/git/issues/101/events","html_url":"https://github.com/gitgitgadget/git/pull/101","id":391787600,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM5MjAzNTQy","number":101,"title":"git bisect: convert from shell to C","user":{"login":"tanushree27","id":22275398,"node_id":"MDQ6VXNlcjIyMjc1Mzk4","avatar_url":"https://avatars2.githubusercontent.com/u/22275398?v=4","gravatar_id":"","url":"https://api.github.com/users/tanushree27","html_url":"https://github.com/tanushree27","followers_url":"https://api.github.com/users/tanushree27/followers","following_url":"https://api.github.com/users/tanushree27/following{/other_user}","gists_url":"https://api.github.com/users/tanushree27/gists{/gist_id}","starred_url":"https://api.github.com/users/tanushree27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanushree27/subscriptions","organizations_url":"https://api.github.com/users/tanushree27/orgs","repos_url":"https://api.github.com/users/tanushree27/repos","events_url":"https://api.github.com/users/tanushree27/events{/privacy}","received_events_url":"https://api.github.com/users/tanushree27/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-12-17T16:21:59Z","updated_at":"2019-01-02T15:37:54Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/gitgitgadget/git/pulls/101","html_url":"https://github.com/gitgitgadget/git/pull/101","diff_url":"https://github.com/gitgitgadget/git/pull/101.diff","patch_url":"https://github.com/gitgitgadget/git/pull/101.patch"},"body":"### Changes since Pranit's v16:\r\n\r\n#### bisect--helper: `bisect_reset` shell function in C\r\n- The `return !printf(...);` construct was considered unsafe and disentangled into `printf(...); return 0;`\r\n- It is more elegant to release branch and argv first, and then return error(...) than to `error(...); release branch; clear argv; return -1;`\r\n- Prefix `!!` to `bisect_reset(...)` function call in `cmd_bisect__helper(...)` because its return value will be given to `exit()`\r\n\r\n#### bisect--helper: `bisect_write` shell function in C\r\n- The option `[--no-log]` is passed before `<state>`.\r\n- Remove `const` from `struct bisect_terms` variables because `const` pointers refers to memory owned by another code path.\r\n- Use `FREE_AND_NULL(...)` in `free_terms(...)`.\r\n- It makes more sense to free terms before set in `set_terms(...)` to avoid memory leak.\r\n- Remove `fail: retval = -1;` for cleaner code flow, replace `goto fail;` with `retval = -1; goto finish;` or `retval = error(...); goto finish;`\r\n- It is more consistent to introduce `--no-log` as option like `--no-checkout`.\r\n- Initialize `struct bisect_terms terms` in `cmd_bisect__helper(...)`.\r\n- The `return res;` in `cmd_bisect__helper(...)` may return `-1`, so prefixed `!!` to handle such cases.\r\n\r\n#### bisect--helper: `check_and_set_terms` shell function in C\r\n- `free_terms()` before `set_terms()` is obsolete as `set_terms()` frees terms before set.\r\n\r\n#### bisect--helper: `bisect_next_check` shell function in C\r\n- `[<term>]` is first argument of `bisect-next-check`.\r\n- `vocab_good` and `vocab_bad` for easier readability.\r\n- Declare `*_warning` char pointers.\r\n- Remove `fail:` label, its only job was to set `retval = -1;`.\r\n\r\n#### bisect--helper: `get_terms` & `bisect_terms` shell function in C\r\n- Remove `fail:` label, its only job was to set `res = -1;`.\r\n- Parse the `argv` in `cmd_bisect__helper()` and pass `option` to `bisect_terms()`.\r\n\r\n#### bisect--helper: `bisect_start` shell function partially in C\r\n- Remove `fail:` label, its only job was to set `retval = -1;`.\r\n- Spell correction `unrecognised` to `unrecognized`.\r\n- `if (revs.nr) must_write_terms = 1;` is more readable than `must_write_terms |= !!revs.nr;`.\r\n- `error()` messages starts with small letters.\r\n- `sha1_to_hex()` is old practice.\r\n- `sq_quote_argv()` now requires only two args.\r\n- Instead of nesting `if`s, use `&&`."},"comment":{"url":"https://api.github.com/repos/gitgitgadget/git/issues/comments/450895729","html_url":"https://github.com/gitgitgadget/git/pull/101#issuecomment-450895729","issue_url":"https://api.github.com/repos/gitgitgadget/git/issues/101","id":450895729,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDg5NTcyOQ==","user":{"login":"tanushree27","id":22275398,"node_id":"MDQ6VXNlcjIyMjc1Mzk4","avatar_url":"https://avatars2.githubusercontent.com/u/22275398?v=4","gravatar_id":"","url":"https://api.github.com/users/tanushree27","html_url":"https://github.com/tanushree27","followers_url":"https://api.github.com/users/tanushree27/followers","following_url":"https://api.github.com/users/tanushree27/following{/other_user}","gists_url":"https://api.github.com/users/tanushree27/gists{/gist_id}","starred_url":"https://api.github.com/users/tanushree27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanushree27/subscriptions","organizations_url":"https://api.github.com/users/tanushree27/orgs","repos_url":"https://api.github.com/users/tanushree27/repos","events_url":"https://api.github.com/users/tanushree27/events{/privacy}","received_events_url":"https://api.github.com/users/tanushree27/received_events","type":"User","site_admin":false},"created_at":"2019-01-02T15:37:54Z","updated_at":"2019-01-02T15:37:54Z","author_association":"NONE","body":"/submit"}}
{"actor":{"display_login":"tanushree27"}}