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

Creates a dataset with the output from GIT_STATUS() More...

Go to the source code of this file.

Detailed Description

Uses git_status() to fetch the number of changed files, then iterates with git_status_get(), inserting all attributes into an output dataset.

Usage:

%let dir=%sysfunc(pathname(work))/core;
%let repo=https://github.com/sasjs/core;
%put source clone rc=%sysfunc(GITFN_CLONE(&repo,&dir));
%mf_writefile(&dir/somefile.txt,l1=some content)
%mf_deletefile(&dir/package.json)

%mp_gitstatus(&dir,outds=work.gitstatus)

More info on these functions is in this helpful paper by Danny Zimmerman.

Parameters
[in]gitdirThe directory containing the GIT repository
[out]outds=(work.git_status) The output dataset to create. Vars:
  • gitdir $1024 - directory of repo
  • path $1024 - relative path to the file in the repo
  • staged $32 - whether the file is staged (TRUE or FALSE)
  • status $64 - either new, deleted, or modified
  • cnt - number of files
  • n - the "nth" file in the list from git_status()
[in]mdebug=(0) Set to 1 to enable DEBUG messages

Related Files

Definition in file mp_gitstatus.sas.