GITFN_COMMIT_LOG Function
Returns the number of commit objects that are 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 Argument
directory
specifies the pathname of a cloned Git repository on the SAS server.
Details
Overview
The GITFN_COMMIT_LOG function creates a commit record object and returns the number of commit objects that are associated with the local Git repository.
Return Codes
The GITFN_COMMIT_LOG function has return codes that indicate whether the operation was successful.
|
Return Code |
Description |
|---|---|
|
–1 |
The libgit2 library is unavailable and no Git operations can be used. |
Example: Return the Number of Commit Objects in a Local Repository
data _null_;
n = GITFN_COMMIT_LOG("your-directory"); /*1*/
put n=; /*2*/
run;
-
Assign the GITFN_COMMIT_LOG function to a variable. Specify the directory of your local repository.
-
Use the PUT statement to display the return code to the SAS log.
The following log shows that there is 1 commit object in the repository, so the variable n returns 1.
n= 1