pkgcore / pkgdev

collection of tools for Gentoo development
https://pkgcore.github.io/pkgdev/
BSD 3-Clause "New" or "Revised" License
29 stars 10 forks source link

pkgcheck auto-detects "update DESCRIPTION, HOMEPAGE, LICENSE" wrongly #115

Open juippis opened 1 year ago

juippis commented 1 year ago

Hey, so here's the patch I was pushing:

diff --git a/app-forensics/aide/aide-0.17.4-r3.ebuild b/app-forensics/aide/aide-0.17.4-r3.ebuild
index 4623eda866f..0684f472885 100644
--- a/app-forensics/aide/aide-0.17.4-r3.ebuild
+++ b/app-forensics/aide/aide-0.17.4-r3.ebuild
@@ -12,9 +12,10 @@ SRC_URI="https://github.com/aide/aide/releases/download/v${PV}/${P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="amd64 ~arm64 x86"
-IUSE="acl audit curl e2fs mhash selinux xattr zlib"
+IUSE="acl audit curl e2fs mhash selinux xattr"

 DEPEND="dev-libs/libpcre
+       sys-libs/zlib
        acl? ( virtual/acl )
        audit? ( sys-process/audit )
        curl? ( net-misc/curl )
@@ -25,8 +26,7 @@ DEPEND="dev-libs/libpcre
        )
        mhash? ( app-crypt/mhash )
        selinux? ( sys-libs/libselinux )
-       xattr? ( sys-apps/attr )
-       zlib? ( sys-libs/zlib )"
+       xattr? ( sys-apps/attr )"
 RDEPEND="${DEPEND}
        selinux? ( sec-policy/selinux-aide )"
 BDEPEND="sys-devel/bison
@@ -73,7 +73,8 @@ src_configure() {
                --without-locale

                --without-prelink
-               $(use_with zlib)
+
+               --with-zlib
                $(use_with curl)
                $(use_with acl posix-acl)
                $(use_with selinux)

And pkgcheck auto-detected commit summary for me:

app-forensics/aide: update DESCRIPTION, HOMEPAGE, LICENSE

Here's the whole git log thing:

commit 7931d9409fce2bde3754b71cc874c18469cace31 (HEAD -> master)
Author: Joonas Niilola <juippis@gentoo.org>
Date:   Sun Jan 8 09:07:58 2023 +0200

    app-forensics/aide: update DESCRIPTION, HOMEPAGE, LICENSE

    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

diff --git a/app-forensics/aide/aide-0.17.4-r3.ebuild b/app-forensics/aide/aide-0.17.4-r3.ebuild
index 4623eda866f..0684f472885 100644
--- a/app-forensics/aide/aide-0.17.4-r3.ebuild
+++ b/app-forensics/aide/aide-0.17.4-r3.ebuild
@@ -12,9 +12,10 @@ SRC_URI="https://github.com/aide/aide/releases/download/v${PV}/${P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0"
 KEYWORDS="amd64 ~arm64 x86"
-IUSE="acl audit curl e2fs mhash selinux xattr zlib"
+IUSE="acl audit curl e2fs mhash selinux xattr"

 DEPEND="dev-libs/libpcre
+       sys-libs/zlib
        acl? ( virtual/acl )
        audit? ( sys-process/audit )
        curl? ( net-misc/curl )
@@ -25,8 +26,7 @@ DEPEND="dev-libs/libpcre
        )
        mhash? ( app-crypt/mhash )
        selinux? ( sys-libs/libselinux )
-       xattr? ( sys-apps/attr )
-       zlib? ( sys-libs/zlib )"
+       xattr? ( sys-apps/attr )"
 RDEPEND="${DEPEND}
        selinux? ( sec-policy/selinux-aide )"
 BDEPEND="sys-devel/bison
@@ -73,7 +73,8 @@ src_configure() {
                --without-locale

                --without-prelink
-               $(use_with zlib)
+
+               --with-zlib
                $(use_with curl)
                $(use_with acl posix-acl)
                $(use_with selinux)

$ pkgcheck --version pkgcheck 0.10.19

arthurzam commented 1 year ago

Not that it really matters, but I wanted to make sure I didn't misunderstand - you mean the auto-generated commit title by pkgdev commit, right?

juippis commented 1 year ago

Ah yes indeed. $ pkgdev --version pkgdev 0.2.4

I forgot these are different tools since I've aliased the commands :)

juippis commented 1 year ago

Thanks, I was actually going to ask if an issue can be moved - was gonna report it under pkgdev I swear!

arthurzam commented 1 year ago

Hmm, something isn't logical here.

I was trying to reproduce by doing:

  1. git checkout 31991cf623421898a80026fda9594903ad4b5604 (commit at tree that contains the changes here)
  2. git reset --soft HEAD~1 (to undo changes)
  3. pkgdev commit app-forensics/aide

And it always failed in finding a good summary, meaning forcing to show the editor for commit title. I notice that you did here a revbump, on which the code doesn't do the selecting of this title variant. I've tried to perform it without revbump, and still same result - no summary found. I've traversed the code around those selections, and I can't guess how it could mistake it.

juippis commented 1 year ago

Indeed I can't reproduce this either :\

juippis commented 1 year ago

Oh, I got it!

$ git checkout 0a1e76962418bcdf85ba32984bccce07d1d7aa67 $ cd app-forensics/aide/ $ edit aide-0.17.4-r3.ebuild $ git add aide-0.17.4-r3.ebuild $ pkgdev commit [detached HEAD 8a49531dbd5b] app-forensics/aide: update DESCRIPTION, HOMEPAGE, LICENSE 1 file changed, 5 insertions(+), 4 deletions(-)

So checkout to a commit before the aide change, manually edit exactly the changes as above, git add and commit (no revbumping).