From 69295768d519d27d8ba29c972bc4295ba89d8d68 Mon Sep 17 00:00:00 2001 From: jonnybravo Date: Wed, 9 Oct 2024 18:01:24 +0200 Subject: [PATCH] try --- check_git.py | 19 +++++++++++++++++++ ssh_with_sub/check_git.py | 0 test_skripte/check_git.py | 16 ++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 check_git.py create mode 100644 ssh_with_sub/check_git.py create mode 100644 test_skripte/check_git.py diff --git a/check_git.py b/check_git.py new file mode 100644 index 0000000..e978dab --- /dev/null +++ b/check_git.py @@ -0,0 +1,19 @@ + +import subprocess, os + +def git_test(git_file=str, git_root=str): + return subprocess.Popen( + "git -C {git_root} log -1 --pretty=format:%h:%ct {git_file}".format( + git_file=git_file, + git_root=git_root), + shell=True, + universal_newlines=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ).communicate() + + +if __name__ == "__main__": + print(git_test(git_file="/home/jonnybravo/Projekte/Python_Skripte/jenkins/use_jenkins_api.py", git_root="/home/jonnybravo/Projekte/Python_Skripte")[0]) + #git log -1 --pretty=format:%h:%c /home/jonnybravo/Projekte/Python_Skripte/jenkins/use_jenkins_api.py + diff --git a/ssh_with_sub/check_git.py b/ssh_with_sub/check_git.py new file mode 100644 index 0000000..e69de29 diff --git a/test_skripte/check_git.py b/test_skripte/check_git.py new file mode 100644 index 0000000..da31ec4 --- /dev/null +++ b/test_skripte/check_git.py @@ -0,0 +1,16 @@ + +import subprocess, os + +def git_test(git_file=str) + return subprocess.Popen( + 'git log -1 --pretty=format:"%h:%c" {git_file}'.format( + git_file=git_file ), + shell=True, + universal_newlines=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + ).communicate() + + +if __name__ == "__main__": + print(git_test=(git_file="/home/jonnybravo/Python_Skripte/jenkins-module.txt"))