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.

Syntax

GITFN_COMMIT_GET( n, directory, attribute, attribute-out)

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:

Commit Object Attributes

Attribute

Description

COMMIT_ID

Specifies the commit ID of the commit object.

AUTHOR

Specifies the author who submitted the commit.

EMAIL

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;
  1. 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.

  2. Initialize the storage character variable.

  3. Assign a variable to the GITFN_COMMIT_GET function.

  4. 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.

  5. Specify the location of the local Git repository that you want to retrieve a status record from.

  6. Specify the attribute that you want to retrieve from the status object.

  7. 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.

  8. Use the PUT statement to display the returned attribute in the SAS log.

The preceding statements produce this result:

attribute-out= your-returned-attribute

See Also

Last updated: September 14, 2026