]> git.corax.cc Git - foundry/commitdiff
include/msg/commit: Rename "commit" field to "ref"
authorMatthias Kruk <m@m10k.eu>
Fri, 26 Nov 2021 11:41:58 +0000 (20:41 +0900)
committerMatthias Kruk <m@m10k.eu>
Fri, 26 Nov 2021 11:41:58 +0000 (20:41 +0900)
The field that stores the source-level version in the commit message
is named "commit", which is different from the terminology used by
git and other development tools.
This commit renames the "commit" field of commit messages to "ref".
Related functions are also renamed accordingly.

include/msg/commit.sh
spec/commit.json

index 65befea77539681a2aeac3f51ae084340ff86802..e287a9f5c2dc9fcbc67e5341b9d0151f5cd5959c 100644 (file)
@@ -13,14 +13,14 @@ __init() {
 foundry_msg_commit_new() {
        local repository="$1"
        local branch="$2"
-       local commit="$3"
+       local ref="$3"
 
        local data
        local msg
 
        if ! data=$(json_object "repository" "$repository" \
-                               "commit"     "$commit"     \
-                               "branch"     "$branch"); then
+                               "branch"     "$branch"     \
+                               "ref"        "$ref"); then
                return 1
        fi
 
@@ -58,15 +58,15 @@ foundry_msg_commit_get_branch() {
        return 0
 }
 
-foundry_msg_commit_get_commit() {
+foundry_msg_commit_get_ref() {
        local msg="$1"
 
-       local commit
+       local ref
 
-       if ! commit=$(foundry_msg_get_data_field "$msg" "commit"); then
+       if ! ref=$(foundry_msg_get_data_field "$msg" "ref"); then
                return 1
        fi
 
-       echo "$commit"
+       echo "$ref"
        return 0
 }
index 7b155c9c7630fff4144e1aadb33f8f81c5a30d7c..bb8a2da4e0009a30f83c38fc80f07d73a4573a35 100644 (file)
@@ -16,8 +16,8 @@
            "type": "string"
        },
 
-       "commit": {
-           "description": "The hash of the detected commit",
+       "ref": {
+           "description": "Identifier of the source code version",
            "type": "string",
            "pattern": "^[0-9a-fA-F]+$"
        }
@@ -26,6 +26,6 @@
     "required": [
        "repository",
        "commit",
-       "branch"
+       "ref"
     ]
 }