Skip to content

Commit

Permalink
feat: adding nobs limit to mp_gitlog
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan Bowe committed Dec 4, 2022
1 parent fe6c9a7 commit 62d7bce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion all.sas
Original file line number Diff line number Diff line change
Expand Up @@ -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

<h4> SAS Macros </h4>
@li mf_getgitbranch.sas
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion base/mp_gitlog.sas
Original file line number Diff line number Diff line change
Expand Up @@ -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
<h4> SAS Macros </h4>
@li mf_getgitbranch.sas
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 62d7bce

Please sign in to comment.