@@ -24,7 +24,7 @@ def process_git_request(fname, target_branch, source_branch, prj_dir):
2424 os .chdir (working_dir )
2525# print(f"pwd : {os.getcwd()}")
2626 git_cmd = f"git log --oneline --no-abbrev-commit origin/{ target_branch } ..origin/{ source_branch } "
27- # print(git_cmd)
27+ print (f"git command is { git_cmd } " )
2828 loglines_to_check = 13
2929 try :
3030 out , err = subprocess .Popen (git_cmd , shell = True , stdout = subprocess .PIPE ,
@@ -46,7 +46,7 @@ def process_git_request(fname, target_branch, source_branch, prj_dir):
4646 y = x .split ()
4747 print (f"This is y { y } " )
4848 commit_sha = str (y [0 ])
49- print ("Found a commit in line " , commit_sha )
49+ print (f "Found a commit in line " , commit_sha )
5050
5151 git_cmd = "git show " + commit_sha
5252 gitlog_out , gitlog_err = subprocess .Popen (git_cmd , shell = True , stdout = subprocess .PIPE , stderr = subprocess .PIPE , universal_newlines = True ).communicate ()
@@ -58,7 +58,7 @@ def process_git_request(fname, target_branch, source_branch, prj_dir):
5858 upstream_diff = False
5959
6060 for logline in loglines :
61- print (f"Processing logline { commit_sh } " )
61+ print (f"Processing logline { commit_sha } " )
6262 lines_counted += 1
6363 if lines_counted == 1 :
6464 file .write ("Merge Request sha: " + local_diffdiff_sha )
@@ -81,7 +81,7 @@ def process_git_request(fname, target_branch, source_branch, prj_dir):
8181 if "commit" in logline .lower ():
8282 commit_sha = re .search (r'[0-9a-f]{40}' , logline )
8383 upstream_diffdiff_sha = str (commit_sha .group (0 )) if commit_sha else ""
84- print ("Upstream : " + upstream_diffdiff_sha )
84+ print (f "Upstream : " + upstream_diffdiff_sha )
8585 if upstream_diffdiff_sha :
8686 file .write ("\t Upstream sha: " + upstream_diffdiff_sha )
8787 file .write ("\n " )
@@ -99,10 +99,12 @@ def process_git_request(fname, target_branch, source_branch, prj_dir):
9999 diff_status = process .returncode
100100
101101 if diff_status != 0 and not upstream_diff :
102- print ("diffdiff out: " + diff_out )
103- print ("diffdiff err: " + diff_err )
102+ print (f "diffdiff out: " + diff_out )
103+ print (f "diffdiff err: " + diff_err )
104104 retcode = 1
105105 file .write ("error:\n Commit: " + local_diffdiff_sha + " differs with no upstream tag in commit message\n " )
106+ except :
107+ print (f"Exception in git log command error { err } " )
106108
107109 finally :
108110 file .close ()
0 commit comments