Macros for SAS Application Developers
https://github.com/sasjs/core
mp_gitlog.sas File Reference

Creates a dataset with the commit history of a local repository. More...

Go to the source code of this file.

Detailed Description

Returns the commit history from a local repository. The name of the branch is also returned.

More details here: https://documentation.sas.com/doc/ko/pgmsascdc/v_033/lefunctionsref/n1qo5miyvry1nen111js203hlwrh.htm

Usage:

%let gitdir=%sysfunc(pathname(work))/core;
%let repo=https://github.com/sasjs/core;
%put source clone rc=%sysfunc(GITFN_CLONE(&repo,&dir));

%mp_gitlog(&gitdir,outds=work.mp_gitlog)
Parameters
[in]gitdirThe directory containing the GIT repository
[in]filter=(BRANCHONLY) To return only the commits for the current branch, use BRANCHONLY (the default). Anything else will return the entire commit history.
[out]outds=(work.mp_gitlog) The output dataset to create. All vars are $128 except message which is $4000.
  • author returns the author who submitted the commit.
  • children_ids returns a list of the children commit IDs
  • committer returns the name of the committer.
  • committer_email returns the email of the committer.
  • email returns the email of the commit author.
  • id returns the commit ID of the commit object.
  • in_current_branch returns "TRUE" or "FALSE" to indicate if the commit is in the current branch.
  • message returns the commit message.
  • parent_ids returns a list of the parent commit IDs.
  • stash returns "TRUE" or "FALSE" to indicate if the commit is a stash commit.
  • time returns the time of the commit as numeric string
  • commit_time_num time of the commit as numeric SAS datetime
  • commit_time_str the commit_time_num variable cast as string
[in]mdebug=(0) Set to 1 to enable DEBUG messages
[in]nobs=(0) Set to an integer greater than 0 to restrict the number of rows returned

SAS Macros

Related Files

Definition in file mp_gitlog.sas.