Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 403323 - repoman sign-commits = true fails with git<1.7.9
Summary: repoman sign-commits = true fails with git<1.7.9
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 406167 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-12 20:23 UTC by Christoph Junghans (RETIRED)
Modified: 2013-11-01 22:38 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Junghans (RETIRED) gentoo-dev 2012-02-12 20:23:58 UTC
An example from the science overlay. (This is sys-apps/portage-2.2.0_alpha86 and dev-vcs/git-1.7.8)

$ repoman commit

RepoMan scours the neighborhood...
>>> Creating Manifest for /var/lib/overlays/science/sci-chemistry/gromacs

Note: use --without-mask to check KEYWORDS on dependencies of masked packages
Note: use --include-dev (-d) to check dependencies for 'dev' profiles

* 2 files being committed... 
error: unknown option `gpg-sign'
usage: git commit [options] [--] <filepattern>...

    -q, --quiet           suppress summary after successful commit
...
...
    -u, --untracked-files[=<mode>]
                          show untracked files, optional modes: all, normal, no. (Default: all)

!!! Exiting on git (shell) error code: 129
Comment 1 Zac Medico gentoo-dev 2012-02-12 20:26:20 UTC
This is intentional, since the policy of the repository is to sign commits.
Comment 2 Zac Medico gentoo-dev 2012-02-12 21:11:48 UTC
What I plan to do is have it check if >=git-1.7.9 is installed if the commit fails, and suggest to install it in that case.
Comment 3 Christoph Junghans (RETIRED) gentoo-dev 2012-02-12 21:36:29 UTC
alexxy suggested to make it backward compatible. So if git cannot sign, just warn and do not sign the commit.

(In reply to comment #2)
> What I plan to do is have it check if >=git-1.7.9 is installed if the commit
> fails, and suggest to install it in that case.
that make sense. Right now git-1.7.9 is not even keyworded, which made me come across that problem.
Comment 4 Zac Medico gentoo-dev 2012-02-12 22:02:55 UTC
(In reply to comment #3)
> alexxy suggested to make it backward compatible. So if git cannot sign, just
> warn and do not sign the commit.

If we do that, then we may need a special layout.conf setting like "sign-commits = optional" to indicate that signatures aren't required, since allowing a mixture of signed and unsigned commits might not be acceptable for some repositories.
Comment 5 Zac Medico gentoo-dev 2012-02-28 16:16:38 UTC
*** Bug 406167 has been marked as a duplicate of this bug. ***
Comment 6 Zac Medico gentoo-dev 2012-03-05 00:53:12 UTC
(In reply to comment #2)
> What I plan to do is have it check if >=git-1.7.9 is installed if the commit
> fails, and suggest to install it in that case.

This is in implemented in git:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=350c094fd54644cbb49bcf8d483a75eb22cb4b6e
Comment 7 Christoph Junghans (RETIRED) gentoo-dev 2012-12-26 04:23:49 UTC
(In reply to comment #6)
> (In reply to comment #2)
> > What I plan to do is have it check if >=git-1.7.9 is installed if the commit
> > fails, and suggest to install it in that case.
> 
> This is in implemented in git:
> 
> http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;
> h=350c094fd54644cbb49bcf8d483a75eb22cb4b6e
Where did this commit go?
Comment 9 Christoph Junghans (RETIRED) gentoo-dev 2012-12-26 18:51:59 UTC
(In reply to comment #8)
> Here it is:
> 
> http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;
> h=43593de8225589fcd5c0d07ce70f45dfbe11bba9
Got it, but I never saw the error message. Where does logging.error sends it?
Comment 10 Zac Medico gentoo-dev 2012-12-26 20:54:02 UTC
The message should be displayed on stderr immediately, right when logging.error() is called. It's supposed to look like this:

[ERROR] Git >=1.7.9 is required for signed commits!
Comment 11 Christoph Junghans (RETIRED) gentoo-dev 2012-12-26 22:24:18 UTC
(In reply to comment #10)
> The message should be displayed on stderr immediately, right when
> logging.error() is called. It's supposed to look like this:
> 
> [ERROR] Git >=1.7.9 is required for signed commits!
Strange:
$ repoman -m "foobar" commit |& grep -i git
usage: git commit [options] [--] <filepattern>...
!!! Exiting on git (shell) error code: 129
Comment 12 Zac Medico gentoo-dev 2012-12-26 22:32:21 UTC
What's the output of git --version?
Comment 13 Christoph Junghans (RETIRED) gentoo-dev 2012-12-26 22:38:58 UTC
(In reply to comment #12)
> What's the output of git --version?
$ git --version
git version 1.7.8.6
Comment 14 Zac Medico gentoo-dev 2012-12-26 22:48:51 UTC
There was a bug in git_supports_gpg_sign, and this should fix it:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d93959f2f295b47a0b17c33ee8df1633a0e479ee