git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] git-stash: Don't GPG sign when stashing changes
@ 2015-11-06 17:32 Cameron Currie
  2015-11-06 18:56 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Cameron Currie @ 2015-11-06 17:32 UTC (permalink / raw)
  To: git

This is helpful for folks with commit.gpgsign = true in their .gitconfig.
---
 git-stash.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-stash.sh b/git-stash.sh
index c7c65e2..fcf01b9 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -85,7 +85,7 @@ create_stash () {
 	# state of the index
 	i_tree=$(git write-tree) &&
 	i_commit=$(printf 'index on %s\n' "$msg" |
-		git commit-tree $i_tree -p $b_commit) ||
+		git commit-tree --no-gpg-sign $i_tree -p $b_commit) ||
 		die "$(gettext "Cannot save the current index state")"
 
 	if test -n "$untracked"
@@ -99,7 +99,7 @@ create_stash () {
 				rm -f "$TMPindex" &&
 				git update-index -z --add --remove --stdin &&
 				u_tree=$(git write-tree) &&
-				printf 'untracked files on %s\n' "$msg" | git commit-tree $u_tree  &&
+				printf 'untracked files on %s\n' "$msg" | git commit-tree --no-gpg-sign $u_tree  &&
 				rm -f "$TMPindex"
 		) ) || die "Cannot save the untracked files"
 
@@ -153,7 +153,7 @@ create_stash () {
 		stash_msg=$(printf 'On %s: %s' "$branch" "$stash_msg")
 	fi
 	w_commit=$(printf '%s\n' "$stash_msg" |
-	git commit-tree $w_tree -p $b_commit -p $i_commit $untracked_commit_option) ||
+	git commit-tree --no-gpg-sign $w_tree -p $b_commit -p $i_commit $untracked_commit_option) ||
 	die "$(gettext "Cannot record working tree state")"
 }
 

--
https://github.com/git/git/pull/186

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] git-stash: Don't GPG sign when stashing changes
  2015-11-06 17:32 [PATCH] git-stash: Don't GPG sign when stashing changes Cameron Currie
@ 2015-11-06 18:56 ` Junio C Hamano
  2016-04-07  2:24 ` daurnimator
  2016-05-02 20:50 ` [PATCH v2] " Cameron Currie
  2 siblings, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2015-11-06 18:56 UTC (permalink / raw)
  To: Cameron Currie; +Cc: git

Cameron Currie <me@cameroncurrie.net> writes:

> This is helpful for folks with commit.gpgsign = true in their .gitconfig.
> ---
>  git-stash.sh | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

I have to wonder if the right fix is to change "git commit-tree" to
ignore that configuration variable?  After all, the plumbing
commands are about stability of the interface, not convenience, and
it feels wrong for them to be affected by end-user configurations.

Patching git-stash.sh does not help other scripts (either in-tree or
third-party) that use commit-tree; they will also be broken by
over-eager users who set commit.gpgsign configuration.

>
> diff --git a/git-stash.sh b/git-stash.sh
> index c7c65e2..fcf01b9 100755
> --- a/git-stash.sh
> +++ b/git-stash.sh
> @@ -85,7 +85,7 @@ create_stash () {
>  	# state of the index
>  	i_tree=$(git write-tree) &&
>  	i_commit=$(printf 'index on %s\n' "$msg" |
> -		git commit-tree $i_tree -p $b_commit) ||
> +		git commit-tree --no-gpg-sign $i_tree -p $b_commit) ||
>  		die "$(gettext "Cannot save the current index state")"
>  
>  	if test -n "$untracked"
> @@ -99,7 +99,7 @@ create_stash () {
>  				rm -f "$TMPindex" &&
>  				git update-index -z --add --remove --stdin &&
>  				u_tree=$(git write-tree) &&
> -				printf 'untracked files on %s\n' "$msg" | git commit-tree $u_tree  &&
> +				printf 'untracked files on %s\n' "$msg" | git commit-tree --no-gpg-sign $u_tree  &&
>  				rm -f "$TMPindex"
>  		) ) || die "Cannot save the untracked files"
>  
> @@ -153,7 +153,7 @@ create_stash () {
>  		stash_msg=$(printf 'On %s: %s' "$branch" "$stash_msg")
>  	fi
>  	w_commit=$(printf '%s\n' "$stash_msg" |
> -	git commit-tree $w_tree -p $b_commit -p $i_commit $untracked_commit_option) ||
> +	git commit-tree --no-gpg-sign $w_tree -p $b_commit -p $i_commit $untracked_commit_option) ||
>  	die "$(gettext "Cannot record working tree state")"
>  }
>  
>
> --
> https://github.com/git/git/pull/186

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] git-stash: Don't GPG sign when stashing changes
  2015-11-06 17:32 [PATCH] git-stash: Don't GPG sign when stashing changes Cameron Currie
  2015-11-06 18:56 ` Junio C Hamano
@ 2016-04-07  2:24 ` daurnimator
  2016-04-07  8:19   ` Johannes Schindelin
  2016-05-02 20:50 ` [PATCH v2] " Cameron Currie
  2 siblings, 1 reply; 12+ messages in thread
From: daurnimator @ 2016-04-07  2:24 UTC (permalink / raw)
  To: git

Cameron Currie <me <at> cameroncurrie.net> writes:
> This is helpful for folks with commit.gpgsign = true in their .gitconfig.

> https://github.com/git/git/pull/186

I too would like this.
Bumping due to lack of attention.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] git-stash: Don't GPG sign when stashing changes
  2016-04-07  2:24 ` daurnimator
@ 2016-04-07  8:19   ` Johannes Schindelin
  2016-04-12  2:46     ` Daurnimator
  0 siblings, 1 reply; 12+ messages in thread
From: Johannes Schindelin @ 2016-04-07  8:19 UTC (permalink / raw)
  To: daurnimator; +Cc: git

Hi,

you dropped the Cc: list. So most likely Cameron won't get your mail nor
any response to your mail.

On Thu, 7 Apr 2016, daurnimator wrote:

> Cameron Currie <me <at> cameroncurrie.net> writes:
> > This is helpful for folks with commit.gpgsign = true in their .gitconfig.
> 
> > https://github.com/git/git/pull/186
> 
> I too would like this.
> Bumping due to lack of attention.

It lacks a Sign-off, our convention is to continue in lower-case after the
colon in the commit's subject, and I think that it would be good to write
so much as one paragraph in the commit message.

Ciao,
Johannes

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] git-stash: Don't GPG sign when stashing changes
  2016-04-07  8:19   ` Johannes Schindelin
@ 2016-04-12  2:46     ` Daurnimator
       [not found]       ` <CAOAY-+1TztY95z3Yi34HB3aYUG5aOHKK9G3OmpYM41ugDMtJUA@mail.gmail.com>
  0 siblings, 1 reply; 12+ messages in thread
From: Daurnimator @ 2016-04-12  2:46 UTC (permalink / raw)
  To: Johannes Schindelin, me; +Cc: git

On 7 April 2016 at 18:19, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> you dropped the Cc: list. So most likely Cameron won't get your mail nor
> any response to your mail.

I originally replied via the gmane web interface, apparently it
doesn't CC the original sender.
CCd now.

> On Thu, 7 Apr 2016, daurnimator wrote:
>
>> Cameron Currie <me <at> cameroncurrie.net> writes:
>> > This is helpful for folks with commit.gpgsign = true in their .gitconfig.
>>
>> > https://github.com/git/git/pull/186
>>
>> I too would like this.
>> Bumping due to lack of attention.
>
> It lacks a Sign-off, our convention is to continue in lower-case after the
> colon in the commit's subject, and I think that it would be good to write
> so much as one paragraph in the commit message.
>
> Ciao,
> Johannes

Cameron, able you able to complete this?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] git-stash: Don't GPG sign when stashing changes
       [not found]       ` <CAOAY-+1TztY95z3Yi34HB3aYUG5aOHKK9G3OmpYM41ugDMtJUA@mail.gmail.com>
@ 2016-04-14 15:50         ` Johannes Schindelin
  2016-05-02  6:06           ` Daurnimator
  0 siblings, 1 reply; 12+ messages in thread
From: Johannes Schindelin @ 2016-04-14 15:50 UTC (permalink / raw)
  To: Cameron Currie; +Cc: Daurnimator, git

Hi Cameron,

On Wed, 13 Apr 2016, Cameron Currie wrote:

> > > On Thu, 7 Apr 2016, daurnimator wrote:
> > >
> > >> Cameron Currie <me <at> cameroncurrie.net> writes:
> > >> > This is helpful for folks with commit.gpgsign = true in their
> > >> > .gitconfig.
> > >>
> > >> > https://github.com/git/git/pull/186
> > >>
> > >> I too would like this.
> > >> Bumping due to lack of attention.
> > >
> > > It lacks a Sign-off, our convention is to continue in lower-case
> > > after the colon in the commit's subject, and I think that it would
> > > be good to write so much as one paragraph in the commit message.
>
> I don't think I can find the time right now. Feel free to rewrite the
> commit message to match convention.

I am afraid that it would be improper for anybody to add your Sign-off, as
it is *your* statement that you are indeed contributing this as Open
Source, and that you indeed are free to do so.

If you do not find the time to take care of these small changes, I fear
the Git maintainer will *have* to drop your patch to avoid hassle for
himself.

Ciao,
Johannes

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] git-stash: Don't GPG sign when stashing changes
  2016-04-14 15:50         ` Johannes Schindelin
@ 2016-05-02  6:06           ` Daurnimator
  0 siblings, 0 replies; 12+ messages in thread
From: Daurnimator @ 2016-05-02  6:06 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Cameron Currie, git

On 15 April 2016 at 01:50, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi Cameron,
>
> On Wed, 13 Apr 2016, Cameron Currie wrote:
>
>> > > On Thu, 7 Apr 2016, daurnimator wrote:
>> > >
>> > >> Cameron Currie <me <at> cameroncurrie.net> writes:
>> > >> > This is helpful for folks with commit.gpgsign = true in their
>> > >> > .gitconfig.
>> > >>
>> > >> > https://github.com/git/git/pull/186
>> > >>
>> > >> I too would like this.
>> > >> Bumping due to lack of attention.
>> > >
>> > > It lacks a Sign-off, our convention is to continue in lower-case
>> > > after the colon in the commit's subject, and I think that it would
>> > > be good to write so much as one paragraph in the commit message.
>>
>> I don't think I can find the time right now. Feel free to rewrite the
>> commit message to match convention.
>
> I am afraid that it would be improper for anybody to add your Sign-off, as
> it is *your* statement that you are indeed contributing this as Open
> Source, and that you indeed are free to do so.
>
> If you do not find the time to take care of these small changes, I fear
> the Git maintainer will *have* to drop your patch to avoid hassle for
> himself.
>
> Ciao,
> Johannes

Cameron, could you please add a sign off to your commit?
It should be as simple as running `git commit --amend -s`

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2] git-stash: Don't GPG sign when stashing changes
  2015-11-06 17:32 [PATCH] git-stash: Don't GPG sign when stashing changes Cameron Currie
  2015-11-06 18:56 ` Junio C Hamano
  2016-04-07  2:24 ` daurnimator
@ 2016-05-02 20:50 ` Cameron Currie
  2016-05-02 21:57   ` Junio C Hamano
  2 siblings, 1 reply; 12+ messages in thread
From: Cameron Currie @ 2016-05-02 20:50 UTC (permalink / raw)
  To: git

This is helpful for folks with commit.gpgsign = true in their .gitconfig.

Signed-off-by: Cameron Currie <me@cameroncurrie.net>
---
 git-stash.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/git-stash.sh b/git-stash.sh
index c7c65e2..fcf01b9 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -85,7 +85,7 @@ create_stash () {
 	# state of the index
 	i_tree=$(git write-tree) &&
 	i_commit=$(printf 'index on %s\n' "$msg" |
-		git commit-tree $i_tree -p $b_commit) ||
+		git commit-tree --no-gpg-sign $i_tree -p $b_commit) ||
 		die "$(gettext "Cannot save the current index state")"
 
 	if test -n "$untracked"
@@ -99,7 +99,7 @@ create_stash () {
 				rm -f "$TMPindex" &&
 				git update-index -z --add --remove --stdin &&
 				u_tree=$(git write-tree) &&
-				printf 'untracked files on %s\n' "$msg" | git commit-tree $u_tree  &&
+				printf 'untracked files on %s\n' "$msg" | git commit-tree --no-gpg-sign $u_tree  &&
 				rm -f "$TMPindex"
 		) ) || die "Cannot save the untracked files"
 
@@ -153,7 +153,7 @@ create_stash () {
 		stash_msg=$(printf 'On %s: %s' "$branch" "$stash_msg")
 	fi
 	w_commit=$(printf '%s\n' "$stash_msg" |
-	git commit-tree $w_tree -p $b_commit -p $i_commit $untracked_commit_option) ||
+	git commit-tree --no-gpg-sign $w_tree -p $b_commit -p $i_commit $untracked_commit_option) ||
 	die "$(gettext "Cannot record working tree state")"
 }
 

--
https://github.com/git/git/pull/186

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] git-stash: Don't GPG sign when stashing changes
  2016-05-02 20:50 ` [PATCH v2] " Cameron Currie
@ 2016-05-02 21:57   ` Junio C Hamano
  2016-05-02 23:56     ` Daurnimator
  0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2016-05-02 21:57 UTC (permalink / raw)
  To: Cameron Currie, Daurnimator; +Cc: git

Cameron Currie <me@cameroncurrie.net> writes:

> This is helpful for folks with commit.gpgsign = true in their .gitconfig.
>
> Signed-off-by: Cameron Currie <me@cameroncurrie.net>
> ---

I do not think this is particularly a good change.

There are a few other in-tree users of "git commit-tree",
e.g. quiltimport and filter-branch, and their users would be hurt
the same way if they set commit.gpgsign in the configuration.

I think it was a mistake that "commit-tree" was made to pay
attention to the configuration variable in the first place.
Allowing scripts that use commit-tree to explicitly pass -S to it is
perfectly fine (and these calling scripts are welcome to honor
commit.gpgsign by reading the configration themselves if their users
want it that way).

I'll send a pair of proposed alternative solutions shortly.

>  git-stash.sh | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/git-stash.sh b/git-stash.sh
> index c7c65e2..fcf01b9 100755
> --- a/git-stash.sh
> +++ b/git-stash.sh
> @@ -85,7 +85,7 @@ create_stash () {
>  	# state of the index
>  	i_tree=$(git write-tree) &&
>  	i_commit=$(printf 'index on %s\n' "$msg" |
> -		git commit-tree $i_tree -p $b_commit) ||
> +		git commit-tree --no-gpg-sign $i_tree -p $b_commit) ||
>  		die "$(gettext "Cannot save the current index state")"
>  
>  	if test -n "$untracked"
> @@ -99,7 +99,7 @@ create_stash () {
>  				rm -f "$TMPindex" &&
>  				git update-index -z --add --remove --stdin &&
>  				u_tree=$(git write-tree) &&
> -				printf 'untracked files on %s\n' "$msg" | git commit-tree $u_tree  &&
> +				printf 'untracked files on %s\n' "$msg" | git commit-tree --no-gpg-sign $u_tree  &&
>  				rm -f "$TMPindex"
>  		) ) || die "Cannot save the untracked files"
>  
> @@ -153,7 +153,7 @@ create_stash () {
>  		stash_msg=$(printf 'On %s: %s' "$branch" "$stash_msg")
>  	fi
>  	w_commit=$(printf '%s\n' "$stash_msg" |
> -	git commit-tree $w_tree -p $b_commit -p $i_commit $untracked_commit_option) ||
> +	git commit-tree --no-gpg-sign $w_tree -p $b_commit -p $i_commit $untracked_commit_option) ||
>  	die "$(gettext "Cannot record working tree state")"
>  }
>  
>
> --
> https://github.com/git/git/pull/186

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] git-stash: Don't GPG sign when stashing changes
  2016-05-02 21:57   ` Junio C Hamano
@ 2016-05-02 23:56     ` Daurnimator
  2016-05-03  1:21       ` Junio C Hamano
  0 siblings, 1 reply; 12+ messages in thread
From: Daurnimator @ 2016-05-02 23:56 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Cameron Currie, git

On 3 May 2016 at 07:57, Junio C Hamano <gitster@pobox.com> wrote:
> I do not think this is particularly a good change.
>
> There are a few other in-tree users of "git commit-tree",
> e.g. quiltimport and filter-branch, and their users would be hurt
> the same way if they set commit.gpgsign in the configuration.

I agree quiltimport should not, but I think filter-branch possibly
should... at least for your *own* commits.
I often think of filter-branch as an "advanced" `git commit --amend`

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] git-stash: Don't GPG sign when stashing changes
  2016-05-02 23:56     ` Daurnimator
@ 2016-05-03  1:21       ` Junio C Hamano
  2016-05-06  6:06         ` Daurnimator
  0 siblings, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2016-05-03  1:21 UTC (permalink / raw)
  To: Daurnimator; +Cc: Cameron Currie, Git Mailing List

On Mon, May 2, 2016 at 4:56 PM, Daurnimator <quae@daurnimator.com> wrote:
> On 3 May 2016 at 07:57, Junio C Hamano <gitster@pobox.com> wrote:
>
> I agree quiltimport should not, but I think filter-branch possibly
> should... at least for your *own* commits.
> I often think of filter-branch as an "advanced" `git commit --amend`

But it does not do the gpgsign thing only for your own commits right now, and
even if it did, you would not necessarily want it to always use the configured
setting. That means that the command, if it wants to work well with the signed
commits, must learn to honor command line option to enable or disable passing
--gpgsign option to underlying commit-tree *anyway*.

So I think it is a right thing to fix commit-tree to ignore
commit.gpgsign at least
by default.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] git-stash: Don't GPG sign when stashing changes
  2016-05-03  1:21       ` Junio C Hamano
@ 2016-05-06  6:06         ` Daurnimator
  0 siblings, 0 replies; 12+ messages in thread
From: Daurnimator @ 2016-05-06  6:06 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Cameron Currie, Git Mailing List

On 3 May 2016 at 11:21, Junio C Hamano <gitster@pobox.com> wrote:
> On Mon, May 2, 2016 at 4:56 PM, Daurnimator <quae@daurnimator.com> wrote:
>> On 3 May 2016 at 07:57, Junio C Hamano <gitster@pobox.com> wrote:
>>
>> I agree quiltimport should not, but I think filter-branch possibly
>> should... at least for your *own* commits.
>> I often think of filter-branch as an "advanced" `git commit --amend`
>
> But it does not do the gpgsign thing only for your own commits right now, and
> even if it did, you would not necessarily want it to always use the configured
> setting. That means that the command, if it wants to work well with the signed
> commits, must learn to honor command line option to enable or disable passing
> --gpgsign option to underlying commit-tree *anyway*.
>
> So I think it is a right thing to fix commit-tree to ignore
> commit.gpgsign at least
> by default.

Okay, that makes sense.
Will you work on a patch?

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-05-06  6:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-06 17:32 [PATCH] git-stash: Don't GPG sign when stashing changes Cameron Currie
2015-11-06 18:56 ` Junio C Hamano
2016-04-07  2:24 ` daurnimator
2016-04-07  8:19   ` Johannes Schindelin
2016-04-12  2:46     ` Daurnimator
     [not found]       ` <CAOAY-+1TztY95z3Yi34HB3aYUG5aOHKK9G3OmpYM41ugDMtJUA@mail.gmail.com>
2016-04-14 15:50         ` Johannes Schindelin
2016-05-02  6:06           ` Daurnimator
2016-05-02 20:50 ` [PATCH v2] " Cameron Currie
2016-05-02 21:57   ` Junio C Hamano
2016-05-02 23:56     ` Daurnimator
2016-05-03  1:21       ` Junio C Hamano
2016-05-06  6:06         ` Daurnimator

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).