GITFN_COMMIT_GET Function
Returns the specified attribute of the nth commit object that is associated with the local repository.
| Category: | Git |
|---|---|
| Restriction: | This function is not supported in a DATA step that runs in CAS. |
| See: | For more information see Using Git Functions in SAS. |
| The GITFN_ functions were deprecated and replaced with the GIT_ functions. For a list of the new GIT_ functions and the deprecated functions that they replace, see Deprecated Git Functions. |
Table of Contents
Syntax
Required Arguments
n
specifies the nth commit object to retrieve attributes from.
directory
specifies the path of a cloned Git repository on the SAS server.
attribute
specifies the attribute of the status object to return.
attribute-out
specifies a character variable that stores the returned attribute.
Details
Overview
The GITFN_COMMIT_GET function returns a specified attribute from the nth commit object in the local repository. Here are the valid attributes:
|
Attribute |
Description |
|---|---|
|
COMMIT_ID |
Specifies the commit ID of the commit object. |
|
AUTHOR |
Specifies the author who submitted the commit. |
|
|
Specifies the email of the commit author. |
|
MESSAGE |
Specifies the commit message. |
|
PARENT_IDS |
Specifies the parent commit IDs of the commit object. |
|
TIME |
Specifies the time of the commit. |
Return Codes
There are no return codes for the GITFN_COMMIT_GET function.
Example: Retrieve an Attribute From a Commit Record.
data _null_;
length attribute-out $ 1024; /*1*/
attribute-out = ""; /*2*/
rc = GITFN_COMMIT_GET( /*3*/
n, /*4*/
"directory", /*5*/
"attribute", /*6*/
attribute-out); /*7*/
put attribute-out=; /*8*/
run;
-
Set a length for a storage variable that stores the returned attribute. Ensure that the length is equal to or greater than the attribute that is returned. This variable is used for the attribute-out argument.
-
Initialize the storage character variable.
-
Assign a variable to the GITFN_COMMIT_GET function.
-
Specify the numeric integer number of the commit object that you want to retrieve an attribute from. The number of commit objects is found using the GITFN_COMMIT_LOG function.
-
Specify the location of the local Git repository that you want to retrieve a status record from.
-
Specify the attribute that you want to retrieve from the status object.
-
Specify the variable that will store the returned attribute from the status object. The variable must be initialized prior to calling the GITFN_COMMIT_GET function.
-
Use the PUT statement to display the returned attribute in the SAS log.
The preceding statements produce this result:
attribute-out= your-returned-attribute