aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-04-18 22:18:53 +0200
committerTeddy Wing2018-04-18 22:20:50 +0200
commitb140fe3a32a16d50f06e307ecf59d9c860f1a591 (patch)
treefa34fccb64b634060e6f0344bba9790ab21af4b6
parentccedafb019f7287010f89742d42ac46afe1fdb52 (diff)
downloadredprine-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-xredprine27
1 files changed, 0 insertions, 27 deletions
diff --git a/redprine b/redprine
index fd21649..f64cdb1 100755
--- a/redprine
+++ b/redprine
@@ -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")