public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/rpkg] 1.70-1: Patch: Do not generate pre-push hook script in some cases
Date: Mon, 10 Aug 2026 21:44:33 GMT	[thread overview]
Message-ID: <178639827319.1.15639210147049017983.rpms-rpkg-8c7be4434e18@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/rpkg
            Branch : 1.70-1
            Commit : 8c7be4434e1894ba636e5780df584e1641422dbf
            Author : Ondřej Nosek <onosek@redhat.com>
            Date   : 2023-03-10T00:11:52+00:00
            Stats  : +42/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/rpkg/c/8c7be4434e1894ba636e5780df584e1641422dbf?branch=1.70-1

            Log:
            Patch: Do not generate pre-push hook script in some cases

Signed-off-by: Ondřej Nosek <onosek@redhat.com>

---
diff --git a/0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch b/0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch
new file mode 100644
index 0000000..3369959
--- /dev/null
+++ b/0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch
@@ -0,0 +1,37 @@
+From 30f189736137a50da4b740acf775ff6675a15a70 Mon Sep 17 00:00:00 2001
+From: Ondrej Nosek <onosek@redhat.com>
+Date: Wed, 8 Mar 2023 16:39:16 +0100
+Subject: [PATCH] Do not generate pre-push hook script in some cases
+
+Some rpkg users don't use fedpkg or similar tool for cloning
+and therefore there is no tool to execute the pre-push-check
+function. Do not generate the hook script in this case.
+
+Fixes: #665
+JIRA: RHELCMP-11392
+Signed-off-by: Ondrej Nosek <onosek@redhat.com>
+---
+ pyrpkg/__init__.py | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py
+index acdad22..776cb21 100644
+--- a/pyrpkg/__init__.py
++++ b/pyrpkg/__init__.py
+@@ -1795,6 +1795,13 @@ class Commands(object):
+         for possible user mistakes.
+         """
+         tool_name = os.path.basename(sys.argv[0])  # rhpkg|fedpkg|...
++        if not tool_name:
++            # empty argv - this functionality is not executed from x-pkg tool
++            # and therefore there isn't a program that can run pre-push-check.
++            # Example: the COPR team executes 'clone' by their own script.
++            self.log.debug('Pre-push hook script was NOT added - missing '
++                           'the packaging tool like fedpkg, rhpkg, ...')
++            return
+         hook_content = textwrap.dedent("""
+             #!/bin/bash
+ 
+-- 
+2.39.2
+

diff --git a/rpkg.spec b/rpkg.spec
index 4c557e0..50604bf 100644
--- a/rpkg.spec
+++ b/rpkg.spec
@@ -1,6 +1,6 @@
 Name:           rpkg
 Version:        1.66
-Release:        3%{?dist}
+Release:        4%{?dist}
 
 Summary:        Python library for interacting with rpm+git
 License:        GPLv2+ and LGPLv2
@@ -39,6 +39,7 @@ Patch3:         0003-Remove-Environment-Markers-syntax.patch
 %endif
 Patch4:         0004-Process-source-URLs-with-fragment-in-pre-push-hook.patch
 Patch5:         0005-container-build-update-signing-intent-help-for-OSBS-.patch
+Patch6:         0006-Do-not-generate-pre-push-hook-script-in-some-cases.patch
 
 %description
 Python library for interacting with rpm+git
@@ -255,6 +256,9 @@ example_cli_dir=$RPM_BUILD_ROOT%{_datadir}/%{name}/examples/cli
 
 
 %changelog
+* Fri Mar 10 2023 Ondřej Nosek <onosek@redhat.com> - 1.66-4
+- Patch: Do not generate pre-push hook script in some cases
+
 * Wed Mar 1 2023 Ondřej Nosek <onosek@redhat.com> - 1.66-3
 - Patch: Process source URLs with fragment in pre-push hook
 - Patch: container-build: update --signing-intent help for OSBS 2

                 reply	other threads:[~2026-08-10 21:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178639827319.1.15639210147049017983.rpms-rpkg-8c7be4434e18@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox