From 62d7bce2494f733be15cab3c13884a64d26982d2 Mon Sep 17 00:00:00 2001 From: Allan Bowe Date: Sun, 4 Dec 2022 17:23:53 +0000 Subject: [PATCH] feat: adding nobs limit to mp_gitlog --- all.sas | 7 ++++++- base/mp_gitlog.sas | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/all.sas b/all.sas index 398c61f..708041e 100644 --- a/all.sas +++ b/all.sas @@ -8352,6 +8352,8 @@ https://documentation.sas.com/doc/ko/pgmsascdc/v_033/lefunctionsref/n1qo5miyvry1 @li commit_time_str the commit_time_num variable cast as string @param [in] mdebug= (0) Set to 1 to enable DEBUG messages + @param [in] nobs= (0) Set to an integer greater than 0 to restrict the number + of rows returned

SAS Macros

@li mf_getgitbranch.sas @@ -8363,7 +8365,7 @@ https://documentation.sas.com/doc/ko/pgmsascdc/v_033/lefunctionsref/n1qo5miyvry1 **/ -%macro mp_gitlog(gitdir,outds=work.mp_gitlog,mdebug=0,filter=BRANCHONLY); +%macro mp_gitlog(gitdir,outds=work.mp_gitlog,mdebug=0,filter=BRANCHONLY,nobs=0); %local varlist i var; %let varlist=author children_ids committer committer_email email id @@ -8405,6 +8407,9 @@ data &outds; if cats(in_current_branch)='TRUE' then output; end; else output; + %if &nobs>0 %then %do; + if n ge &nobs then stop; + %end; end; rc=git_commit_free(trim(gitdir)); keep gitdir branch &varlist message time commit_time_num commit_time_str; diff --git a/base/mp_gitlog.sas b/base/mp_gitlog.sas index 830fc18..434a8fb 100644 --- a/base/mp_gitlog.sas +++ b/base/mp_gitlog.sas @@ -38,6 +38,8 @@ https://documentation.sas.com/doc/ko/pgmsascdc/v_033/lefunctionsref/n1qo5miyvry1 @li commit_time_str the commit_time_num variable cast as string @param [in] mdebug= (0) Set to 1 to enable DEBUG messages + @param [in] nobs= (0) Set to an integer greater than 0 to restrict the number + of rows returned

SAS Macros

@li mf_getgitbranch.sas @@ -49,7 +51,7 @@ https://documentation.sas.com/doc/ko/pgmsascdc/v_033/lefunctionsref/n1qo5miyvry1 **/ -%macro mp_gitlog(gitdir,outds=work.mp_gitlog,mdebug=0,filter=BRANCHONLY); +%macro mp_gitlog(gitdir,outds=work.mp_gitlog,mdebug=0,filter=BRANCHONLY,nobs=0); %local varlist i var; %let varlist=author children_ids committer committer_email email id @@ -91,6 +93,9 @@ data &outds; if cats(in_current_branch)='TRUE' then output; end; else output; + %if &nobs>0 %then %do; + if n ge &nobs then stop; + %end; end; rc=git_commit_free(trim(gitdir)); keep gitdir branch &varlist message time commit_time_num commit_time_str;