diff options
author | Teddy Wing | 2018-04-18 22:18:53 +0200 |
---|---|---|
committer | Teddy Wing | 2018-04-18 22:20:50 +0200 |
commit | b140fe3a32a16d50f06e307ecf59d9c860f1a591 (patch) | |
tree | fa34fccb64b634060e6f0344bba9790ab21af4b6 | |
parent | ccedafb019f7287010f89742d42ac46afe1fdb52 (diff) | |
download | redprine-b140fe3a32a16d50f06e307ecf59d9c860f1a591.tar.bz2 |
Get rid of commented reference code
These are stored references to things I tried in the shell to end up
with the results that we have in our uncommented functions. These are
historical and no longer relevant.
-rwxr-xr-x | redprine | 27 |
1 files changed, 0 insertions, 27 deletions
@@ -33,8 +33,6 @@ function fetch_pull_requests () { echo $pull_requests } -# fetch_pull_requests - function cache_my_pull_requests () { local pull_requests="$1" @@ -56,30 +54,16 @@ function cache_my_pull_requests () { echo $my_pull_requests > "$CACHE_FILE" } -# branch_heads=$(printf "%s\n" "$pull_requests" | -# jq '. | map([.["html_url"], .["head"]["label"]]) | .[] | @tsv' --raw-output) - -# jq -C '. | map({ html_url, number, user: .user.login, ref: .head.ref, created_at })' pulls.json -# jq -C '. | map({ html_url, number, user: .user.login, ref: .head.ref, created_at }) | map(select(.user == "teddywing"))' pulls.json - -# pull_requests=$(fetch_pull_requests) -# cache_my_pull_requests "$pull_requests" - -# function compare_with_cache () { function new_pull_requests () { local pull_requests=$(fetch_pull_requests) local my_prs=$(extract_data_from_pull_request_json "$pull_requests") - # echo "$my_prs" local new=$(jq "${my_prs} - ." "$CACHE_FILE") echo "$new" } -# jq '[ { "html_url": "https://github.com/owner/repo/pull/487", "number": 487, "user": "teddywing", "ref": "9999-this-is-a-test", "created_at": "2018-04-16T16:17:52Z" } ] - .' pulls-my.json #=> [] -# jq '[ { "html_url": "https://github.com/owner/repo/pull/487", "number": 487, "user": "teddywing", "ref": "9999-this-is-a-test", "created_at": "2018-04-16T16:17:52Z" } ] - . | length' pulls-my.json #=> 0 - function extract_data_from_pull_request_json () { local pull_requests="$1" @@ -114,11 +98,6 @@ function extract_redmine_issue_numbers_from_pull_request () { echo "$issue_ids" } -# jq --raw-output 'map(.ref) | .[] | @text' pulls-my.json -# jq --raw-output 'map(.ref) | .[] | @text' pulls-my.json | perl -ne '/^(\d{4})-/ && print "$1\n"' - -# jq --raw-output '. | map({ html_url, number, user: .user.login, ref: .head.ref, created_at }) | map(select(.user == "teddywing")) | map([.ref, .html_url]) | .[] | @tsv' pulls.json - function branches_and_pull_request_urls () { local pull_requests="$1" @@ -135,8 +114,6 @@ function issue_numbers_and_pull_request_urls () { perl -ne '/^(\d{4})-[^\t]*\t(.*)/ && print "$1\t$2\n"' } -# jq --raw-output '. | map({ html_url, number, user: .user.login, ref: .head.ref, created_at }) | map(select(.user == "teddywing")) | map([.ref, .html_url]) | .[] | @tsv' pulls.json | perl -ne '/^(\d{4})-[^\t]*\t(.*)/ && print "$1\t$2\n"' - # Updates the "Done", "Status", and "Pull Request" fields for each given issue. function update_redmine_statuses () { local issue_ids_and_urls="$1" @@ -174,8 +151,6 @@ function update_redmine_status () { } }" - # echo "$json" - # echo "${REDMINE_BASE_URL}/issues/${issue_id}.json" curl \ --verbose \ --header 'Content-Type: application/json' \ @@ -199,8 +174,6 @@ function update_cache_with_new_pulls () { -# pull_requests=$(fetch_pull_requests) -# cache_my_pull_requests "$pull_requests" pr_json=$(new_pull_requests) issue_prs=$(issue_numbers_and_pull_request_urls "$pr_json") |