All of lore.kernel.org
 help / color / mirror / Atom feed
* Request for git merge --signoff
@ 2017-07-01 15:24 Dan Kohn
  2017-07-01 17:45 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dan Kohn @ 2017-07-01 15:24 UTC (permalink / raw)
  To: git

https://github.com/coreinfrastructure/best-practices-badge is a user
of the https://github.com/probot/dco bot which checks that commits
have a signoff. The issue is that there is no `--signoff` option in
git for merge commits, which is a standard part of our workflow with
feature branches. Here is a workflow where we currently get stuck:

```sh
(master)$ git checkout -b feature-branch
# make some changes
(feature-branch)$ git commit -sam 'Adding features'
# Changes have occurred on master so need to add them for easier merge
(feature-branch)$ git fetch
(feature-branch)$ git merge origin/master
# Save default commit message
(feature-branch)$ git push
# This now fails the DCObot check because the merge commit is not signed.
```

This alternative workflow works, but is obviously tedious:

```sh
# First 3 steps are the same
(feature-branch)$ git merge origin/master
# Save default commit message
(feature-branch)$ git commit --amend -s
# Commit message now has signoff line
(feature-branch)$ git push
# This now passes the DCObot check.
```

Or, I could manually add the Signoff line to the proposed git merge
commit message, which would allow me to skip the `--amend` step.

Could you please add a `--signoff` option to `git merge`?

Probot issue reference: https://github.com/probot/dco/issues/13
--
Dan Kohn <mailto:dan@linuxfoundation.org>
Executive Director, Cloud Native Computing Foundation <https://cncf.io/>
tel:+1-415-233-1000

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

* Re: Request for git merge --signoff
  2017-07-01 15:24 Request for git merge --signoff Dan Kohn
@ 2017-07-01 17:45 ` Junio C Hamano
  2017-07-01 18:15   ` Dan Kohn
  2017-07-01 22:15 ` Ævar Arnfjörð Bjarmason
  2017-07-25  5:42 ` Christian Couder
  2 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2017-07-01 17:45 UTC (permalink / raw)
  To: Dan Kohn; +Cc: git

Dan Kohn <dan@linuxfoundation.org> writes:

> This alternative workflow works, but is obviously tedious:
>
> ```sh
> # First 3 steps are the same
> (feature-branch)$ git merge origin/master
> # Save default commit message
> (feature-branch)$ git commit --amend -s
> # Commit message now has signoff line
> (feature-branch)$ git push
> # This now passes the DCObot check.
> ```
>
> Or, I could manually add the Signoff line to the proposed git merge
> commit message, which would allow me to skip the `--amend` step.
>
> Could you please add a `--signoff` option to `git merge`?

The reason why we changed the default for "git merge" to start an
editor at around v1.7.10 was because we wanted to encourage people
to write log message that more meaningfully documents the change,
and adding sign-off is probably in line with that.  

I've done that "commit --amend" on a merge to tweak its message
myself number of times, but I have to admit that I never did so for
sign-off, but why not? ;-)


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

* Re: Request for git merge --signoff
  2017-07-01 17:45 ` Junio C Hamano
@ 2017-07-01 18:15   ` Dan Kohn
  2017-07-01 20:25     ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Kohn @ 2017-07-01 18:15 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Sat, Jul 1, 2017 at 1:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Dan Kohn <dan@linuxfoundation.org> writes:

>> Could you please add a `--signoff` option to `git merge`?

> The reason why we changed the default for "git merge" to start an
> editor at around v1.7.10 was because we wanted to encourage people
> to write log message that more meaningfully documents the change,
> and adding sign-off is probably in line with that.

> I've done that "commit --amend" on a merge to tweak its message
> myself number of times, but I have to admit that I never did so for
> sign-off, but why not? ;-)

I'm not opposed to starting the editor, although in the case of our
workflow there's not much more to say beyond "Merged in master". I
would just like the Sign-Off line to appear by default in the commit
message if I do `git merge origin/master --signoff`. I know it seems
trivial, but many GitHub users aren't familiar with the exact header
syntax to use, as they're used to just doing `git commit -sam 'New
Feature'`.

Separately, I just came back from Beijing where Linus spoke at LC3
<https://www.lfasiallc.com/linuxcon-containercon-cloudopen-china>. He
was asked about git and explained that he had largely bowed out of any
development after the first few months and credited your stewardship.
Even if you turn down my request for a new flag here, thanks for the
amazing project!
--
Dan Kohn <mailto:dan@linuxfoundation.org>
Executive Director, Cloud Native Computing Foundation <https://cncf.io/>
tel:+1-415-233-1000

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

* Re: Request for git merge --signoff
  2017-07-01 18:15   ` Dan Kohn
@ 2017-07-01 20:25     ` Junio C Hamano
  0 siblings, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2017-07-01 20:25 UTC (permalink / raw)
  To: Dan Kohn; +Cc: git

Dan Kohn <dan@linuxfoundation.org> writes:

> On Sat, Jul 1, 2017 at 1:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Dan Kohn <dan@linuxfoundation.org> writes:
>
>>> Could you please add a `--signoff` option to `git merge`?
>
>> The reason why we changed the default for "git merge" to start an
>> editor at around v1.7.10 was because we wanted to encourage people
>> to write log message that more meaningfully documents the change,
>> and adding sign-off is probably in line with that.
>
>> I've done that "commit --amend" on a merge to tweak its message
>> myself number of times, but I have to admit that I never did so for
>> sign-off, but why not? ;-)
>
> I'm not opposed to starting the editor, although ...
> ...
> Even if you turn down my request for a new flag here,...

Was I a bit too oblique?  I said that do think "merge --signoff" is
in line with the latest philosophy, i.e. not rejecting the idea of
add such an option.  IOW, patches welcome (either from you or other
people).


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

* Re: Request for git merge --signoff
  2017-07-01 15:24 Request for git merge --signoff Dan Kohn
  2017-07-01 17:45 ` Junio C Hamano
@ 2017-07-01 22:15 ` Ævar Arnfjörð Bjarmason
  2017-07-25  5:42 ` Christian Couder
  2 siblings, 0 replies; 6+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-07-01 22:15 UTC (permalink / raw)
  To: Dan Kohn; +Cc: git


On Sat, Jul 01 2017, Dan Kohn jotted:

> https://github.com/coreinfrastructure/best-practices-badge is a user
> of the https://github.com/probot/dco bot which checks that commits
> have a signoff. The issue is that there is no `--signoff` option in
> git for merge commits.

I think it's fine to add such a feature, but it seems like an obvious
bug to me in such a bot[1] that it's enforcing the DCO on merge commits.

The entire point of the DCO is to certify that you have the rights to
submit the patch etc., it's quite dubious to be applying that to merge
commits which contain no original work (most of the time, although of
course a merge commit can have significant conflict resolution).

So yeah, it would make sense to have a --signoff option, especially to
use when the merge actually does contain original work, but your stated
reason for wanting this just seems like an easily solved bug in the bot:
Exclude those commits that have no patch contents.

1. https://github.com/probot/dco/

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

* Re: Request for git merge --signoff
  2017-07-01 15:24 Request for git merge --signoff Dan Kohn
  2017-07-01 17:45 ` Junio C Hamano
  2017-07-01 22:15 ` Ævar Arnfjörð Bjarmason
@ 2017-07-25  5:42 ` Christian Couder
  2 siblings, 0 replies; 6+ messages in thread
From: Christian Couder @ 2017-07-25  5:42 UTC (permalink / raw)
  To: Dan Kohn; +Cc: git

On Sat, Jul 1, 2017 at 5:24 PM, Dan Kohn <dan@linuxfoundation.org> wrote:
> https://github.com/coreinfrastructure/best-practices-badge is a user
> of the https://github.com/probot/dco bot which checks that commits
> have a signoff. The issue is that there is no `--signoff` option in
> git for merge commits, which is a standard part of our workflow with
> feature branches. Here is a workflow where we currently get stuck:

[...]

> Or, I could manually add the Signoff line to the proposed git merge
> commit message, which would allow me to skip the `--amend` step.

Perhaps you could use a prepare-commit-msg hook (or maybe a commit-msg
hook) to automatically add your Signoff line to any commit message if
it isn't there already.

In the prepare-commit-msg hook sample there is already commented out
code to do that:

https://github.com/git/git/blob/master/templates/hooks--prepare-commit-msg.sample#L35-L36

Alternatively you might want to use `git interpret-trailers` to do
that or more fancy trailer related things.

> Could you please add a `--signoff` option to `git merge`?

I am not opposed to add a `--signoff` option to `git merge`, but I
think the main plan to improve git in this area has been to first make
it possible for git commands that can create commits to accept options
like "--trailer 'Signed-off-by: Alice <alice@example.com>'" and to
pass them to `git interpret-trailers` (or its underlying code).

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

end of thread, other threads:[~2017-07-25  5:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-01 15:24 Request for git merge --signoff Dan Kohn
2017-07-01 17:45 ` Junio C Hamano
2017-07-01 18:15   ` Dan Kohn
2017-07-01 20:25     ` Junio C Hamano
2017-07-01 22:15 ` Ævar Arnfjörð Bjarmason
2017-07-25  5:42 ` Christian Couder

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.