git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jeff King <peff@peff.net>
Date
Dec 9, 2022, 20:39 UTC
Message-ID
<Y5OdHL4VFCIjgrk7@coredump.intra.peff.net>
In-Reply-To
<xmqqcz8t1avz.fsf@gitster.g>
On Fri, Dec 09, 2022 at 01:03:44PM +0900, Junio C Hamano wrote:
Show 10 quoted lines
> > 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).
> 
> Ah, "trailer.sign.value" to use the same value does not exist, and
> the closest kludge we can use is the .cmd thing?  Then it is a shame
> but it should be easy to correct?

Yeah, I almost suggested trailer.sign.value at first, but on further thought, it would be kind of weird. When the user asks for a trailer to be included, it usually already has a value along with it. This could be thought of as a default value, which might work like:

  git config trailer.signed-off-by.default "Jeff King <peff@peff.net>"

That's pretty flexible, but it seems like what you really want is not some string, but to say "my usual committer ident". And so we force you to repeat what's in user.email, etc, or we have to invent some new token that means "my usual ident". So if we instead have a flag for "this is an ident", then it can just do the expected thing.

Show 8 quoted lines
> >   - 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.
> 
> We could reimplement --signoff to actually take attention to the
> "trailer.sign.*" thing, if we wanted to, and that makes it very easy
> to explain, I guess.

Yeah. My only reservation would be whether anybody would be surprised by the change in behavior. I have the feeling that hardly anybody uses trailer.* config, but I admit that's not based in any real data.

-Peff
Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 11 of 14 in “Skipping adding Signed-off-by even if it's not the last on git commit”
  1. David CaroDec 6, 2022
  2. Taylor BlauDec 7, 2022
  3. Junio C HamanoDec 7, 2022
  4. David CaroDec 7, 2022
  5. Taylor BlauDec 7, 2022
  6. Junio C HamanoDec 7, 2022
  7. Jeff KingDec 8, 2022
  8. Junio C HamanoDec 9, 2022
  9. Jeff KingDec 9, 2022
  10. Junio C HamanoDec 9, 2022
  11. Jeff KingDec 9, 2022
  12. Ævar Arnfjörð BjarmasonDec 7, 2022
  13. Junio C HamanoDec 7, 2022
  14. Konstantin RyabitsevDec 7, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.