From bfa38b2401bb84bdaa980a2b7a16e0e4c9dac1f0 Mon Sep 17 00:00:00 2001
From: Tim Jaacks <tim.jaacks@garz-fricke.com>
Date: Wed, 10 Aug 2022 09:06:47 +0200
Subject: [PATCH] Improve log messages

---
 scripts/common.py                  | 10 ++++++++--
 scripts/integrate_into_manifest.py | 10 ++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/scripts/common.py b/scripts/common.py
index 26f6af0a..cd1b8b4b 100755
--- a/scripts/common.py
+++ b/scripts/common.py
@@ -163,8 +163,14 @@ def commit_and_push(
     """Commit and push to a repo branch"""
     branch = repo.head.reference
     author = Actor(name, email)
+
+    logging.debug("Committing changes:")
+    logging.debug(repo.git.diff("--staged"))
+
     repo.index.commit(message, author=author, committer=author)
-    print(repo.git.log("--oneline", "-n", "5"))
+
+    logging.debug("Git log:")
+    logging.debug(repo.git.log("--oneline", "-n", "5"))
 
     # Push commit
     try:
@@ -179,7 +185,7 @@ def commit_and_push(
     print("Pushed new commit:")
     print(project.web_url + "/-/commit/" + revision)
     if not less_verbose:
-        print(repo.git.show("--summary", "--decorate"))
+        print(repo.git.show("--summary", "--decorate") + "\n")
 
     return revision
 
diff --git a/scripts/integrate_into_manifest.py b/scripts/integrate_into_manifest.py
index f943991b..c6491814 100755
--- a/scripts/integrate_into_manifest.py
+++ b/scripts/integrate_into_manifest.py
@@ -71,12 +71,12 @@ def update_srcrev(srcrev, recipe_name, new_revision):
 
 
 def integrate_into_manifest(
-    manifest_project,
+    manifest_project: Project,
     integration_base,
     manifest_file,
     srcrev_file,
     recipe_name,
-    project,
+    project: Project,
     merge_request,
 ):
     gitlab = manifest_project.manager.gitlab
@@ -92,6 +92,7 @@ def integrate_into_manifest(
 
         # Checkout manifest
         # TODO replace checkout with gitlab api access
+        print("Cloning manifest repo: %s" % manifest_project.http_url_to_repo)
         try:
             manifest_repo = Repo.clone_from(
                 clone_url.url, manifest_dir, branch=integration_base
@@ -115,7 +116,8 @@ def integrate_into_manifest(
             )
             logging.debug("Heads: %s", manifest_repo.heads)
             manifest_repo.heads[integration_branch].checkout()
-            print(manifest_repo.git.log("--oneline", "-n", "5"))
+            logging.debug(manifest_repo.git.log("--oneline", "-n", "5"))
+            print("Using existing integration branch: %s" % integration_branch)
         else:
             # Create integration branch (delete former one if already exists)
             integration_branch = common.integration_branch_name(
@@ -125,7 +127,7 @@ def integrate_into_manifest(
                 if integration_branch == ref.name:
                     manifest_repo.delete_head(ref)
 
-            logging.debug("Integration branch: %s", integration_branch)
+            print("Creating integration branch: %s" % integration_branch)
             manifest_repo.head.set_reference(
                 manifest_repo.create_head(integration_branch)
             )
-- 
GitLab