Re: Skipping adding Signed-off-by even if it's not the last on git commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 09, 2022 at 10:23:52AM +0900, Junio C Hamano wrote:

> > ... The one exception is that the
> > generic trailer.ifExists, etc, would start affecting --signoff, which
> > _might_ be a surprise. If we wanted to retain the behavior there, we
> > could say "--signoff is special, and doesn't respect generic trailer
> > config".
> 
> Yeah, that may be safe, however it is very unsatisfying.

Agreed. ;)

> > Alternatively, it would be nice if there was an easy way to put your
> > ident into a trailer (what I wrote above doesn't really work unless you
> > have those variables in your environment, and of course it's a lot of
> > typing). I think you can hack it up like:
> >
> >   git config trailer.sign.key Signed-off-by
> >   git config trailer.sign.cmd \
> >     'git var GIT_COMMITTER_IDENT | sed "s/>.*/>/";:'
> >   git commit --trailer=sign
> >
> > which is only a little more typing than --signoff, but it's not very
> > ergonomic.
> 
> It does not look _too_ bad, though.

What I don't like about it is:

  - the external cmd is complicated and slow. It would be nice if you
    could just set trailer.sign.ident=true or something, and it would
    use your ident by default if no value is given (and maybe even do
    completion similar to "commit --author" if a value is given).

  - you have to know to be clever enough to define and use
    --trailer=sign. If --signoff didn't exist, that's not too big a
    stretch. But since it does, everyone will naturally reach for it
    first.

The two could be solved independently, of course. And even if we did
want to solve both by making --signoff behave more like other trailers,
having trailer.*.ident might be nice in general.

I admit I just thought of this concept, though, so I don't have plans to
work up patches, and I make no claims there isn't a gotcha waiting
somewhere. ;)

-Peff



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux