Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git gui no longer respects [commit] gpgsign = true #850

Closed
1 task done
retep998 opened this issue Aug 10, 2016 · 13 comments
Closed
1 task done

git gui no longer respects [commit] gpgsign = true #850

retep998 opened this issue Aug 10, 2016 · 13 comments
Milestone

Comments

@retep998
Copy link

retep998 commented Aug 10, 2016

  • I was not able to find an open
    or closed issue
    matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? 32-bit or 64-bit? Include the
    output of git version as well.

    Git 2.9.2 64-bit.

    > git --version
    git version 2.9.2.windows.1
    

    Still broken as of git version 2.9.3.windows.1

  • Which version of Windows are you running? 32-bit or 64-bit?

    Windows 10 64-bit

  • What options did you set as part of the installation? Or did you choose the
    defaults?

    Typical upgrade with Git in my PATH and using mintty for git bash.

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

    I just upgraded from Git 2.8.x which did not have this issue.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

    Powershell inside conhost.

  • What commands did you run to trigger this issue? If you can provide a
    Minimal, Complete, and Verifiable example
    this will help us understand the issue.

git config -e --global
# [commit]
#    gpgsign = true
git gui
# Create a commit and push it to github
# Notice the lack of a verified stamp
git commit --amend
# Push this commit to github instead
# Notice the verified stamp does exist
  • What did you expect to occur after running these commands?

    I expect commits created by git gui to be gpg signed. This is the behavior that happened in previous versions of Git without issue.

  • What actually happened instead?

    The commits were not gpg signed.

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

    Happens to any git repo

@dscho
Copy link
Member

dscho commented Sep 8, 2016

Is this a Windows-specific issue? I guess you have no easy way to test on Linux...

@retep998
Copy link
Author

retep998 commented Sep 8, 2016

I have no idea whether it is Windows specific. I just know that the issue does exist in Git for Windows.

@landstander668
Copy link

landstander668 commented Sep 8, 2016

From a quick test using Ubuntu 16.04 x86_64 on VirtualBox, this issue does not appear to occur on Linux.

:) adric@adric-VirtualBox ~
$ git version
git version 2.9.3

:) adric@adric-VirtualBox ~
$ git init foo && cd foo
Initialized empty Git repository in /home/adric/foo/.git/

:) adric@adric-VirtualBox foo (master)
$ git config --local commit.gpgsign true

:) adric@adric-VirtualBox foo (master)
$ git commit --allow-empty -m "Empty"

You need a passphrase to unlock the secret key for
user: "Adric Norris <adric.norris@egov.com>"
4096-bit RSA key, ID 65D3F218, created 2014-05-06

[master (root-commit) 11a3db5] Empty

:) adric@adric-VirtualBox foo (master)
$ git log --show-signature
commit 11a3db5304c8b10fcca3b116ff84846ac46a8fd6
gpg: Signature made Thu 08 Sep 2016 11:30:05 AM CDT using RSA key ID 72B3E137
gpg: Good signature from "Adric Norris <landstander668@gmail.com>"
Author: Adric Norris <adric.norris@egov.com>
Date:   Thu Sep 8 11:30:05 2016 -0500

    Empty

@retep998
Copy link
Author

retep998 commented Sep 8, 2016

@landstander668 Did you create the commit with git gui? git commit works fine and isn't the issue.

@landstander668
Copy link

No, I somehow managed to completely overlook that detail. :( Sorry for the noise.

@dscho
Copy link
Member

dscho commented Sep 8, 2016

@landstander668 if you get a chance, could you try with git gui on Linux?

@landstander668
Copy link

I can reproduce this issue using git gui on Linux, using the same Ubuntu environment with Git 2.9.3 as the previous test. I tried setting commit.gpgsign to true at the local and global levels, both of which resulted in an unsigned commit.

@dscho
Copy link
Member

dscho commented Sep 9, 2016

Thanks for testing this!

My guess is that the culprit is described in this part of 2.9.0's release notes:

"git commit-tree" plumbing command required the user to always sign
its result when the user sets the commit.gpgsign configuration
variable, which was an ancient mistake, which this release corrects.
A script that drives commit-tree, if it relies on this mistake, now
needs to read commit.gpgsign and pass the -S option as necessary.

So I guess we would have to patch git gui accordingly.

Most likely, we will have to patch git-gui/lib/commit.tcl's commit_committree function to insert the lines

    # -- Create the commit.
    #
    set cmd [list commit-tree $tree_id]
+   if {[is_config_true commit.gpgsign]} {
+       lappend cmd -S
+   }
    foreach p [concat $PARENT $MERGE_HEAD] {
        lappend cmd -p $p
}

@landstander668 could you test this? The commit.tcl file should be in <prefix>/share/git-gui/lib/, so you could even patch it in an already-installed Git.

@retep998
Copy link
Author

retep998 commented Sep 9, 2016

I can confirm patching my commit.tcl fixes the issue on Windows.

@dscho
Copy link
Member

dscho commented Sep 9, 2016

@retep998 awesome! Thanks for your feedback.

@dscho dscho closed this as completed in eda474c Sep 9, 2016
dscho added a commit to dscho/git that referenced this issue Sep 9, 2016
As of v2.9.0, `git commit-tree` no longer heeds the `commit.gpgsign`
config setting. This broke committing in Git GUI.

This fixes git-for-windows#850

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
0day-ci pushed a commit to 0day-ci/git that referenced this issue Sep 9, 2016
As of v2.9.0, `git commit-tree` no longer heeds the `commit.gpgsign`
config setting. This broke committing in Git GUI.

This fixes git-for-windows#850

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to dscho/build-extra that referenced this issue Sep 9, 2016
Git GUI [respects the `commit.gpgsign` setting
again](git-for-windows/git#850).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho added this to the v2.10.0(2) milestone Sep 9, 2016
@dscho
Copy link
Member

dscho commented Sep 9, 2016

gitster pushed a commit to git/git that referenced this issue Sep 9, 2016
As of v2.9.0, `git commit-tree` no longer heeds the `commit.gpgsign`
config setting. This broke committing in Git GUI.

This fixes git-for-windows#850

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dscho added a commit that referenced this issue Sep 10, 2016
As of v2.9.0, `git commit-tree` no longer heeds the `commit.gpgsign`
config setting. This broke committing in Git GUI.

This fixes #850

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@hasufell
Copy link

Shouldn't this be relayed to the main git repo as well? It basically has the same problem.

gitster pushed a commit to git/git that referenced this issue Sep 11, 2016
As of v2.9.0, `git commit-tree` no longer heeds the `commit.gpgsign`
config setting. This broke committing with GPG signature in Git GUI.

This fixes git-for-windows#850

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dscho added a commit to dscho/git that referenced this issue Sep 12, 2016
As of v2.9.0, `git commit-tree` no longer heeds the `commit.gpgsign`
config setting. This broke committing in Git GUI.

This fixes git-for-windows#850

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member

dscho commented Sep 12, 2016

dscho added a commit that referenced this issue Sep 13, 2016
As of v2.9.0, `git commit-tree` no longer heeds the `commit.gpgsign`
config setting. This broke committing in Git GUI.

This fixes #850

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
patthoyts pushed a commit to patthoyts/git-gui that referenced this issue Oct 3, 2016
As of v2.9.0, `git commit-tree` no longer heeds the `commit.gpgsign`
config setting. This broke committing in Git GUI.

This fixes git-for-windows/git#850

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
patthoyts pushed a commit to patthoyts/git-gui that referenced this issue Oct 3, 2016
As of v2.9.0, `git commit-tree` no longer heeds the `commit.gpgsign`
config setting. This broke committing in Git GUI.

This fixes git-for-windows/git#850

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants