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

Re: [PATCH] git-contacts: Add recognition of Reported-by

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 21, 2017, 16:03 UTC
Message-ID
<xmqqwp71hj5n.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<a8b47a45-0100-dbef-0bff-fdfdb9cbccb4@redhat.com>
Eric Blake <eblake@redhat.com> writes:
Show 7 quoted lines
> You mean, something like
>
> git config --add contacts.autocc Reported-by
> git config --add contacts.autocc Suggested-by
>
> where contacts.autocc would be a new multi-valued config option
> specifying additional Tag: patterns to scrape out of the commit message?

Yes, something along that line, and you are correct to point out that I should have mentioned the need for command-line override.

In fact, if you anticipate that the primary use of this contributed script is as "send-email --cccmd", then we probably are better off doing this without any configuration variables, but just add the mechanism for command-line override of the hardcoded default.

I also should have mentioned the need for a way to say "remove all hardcoded default and start from scratch".

> Also, putting it in 'git config' still means that it is a per-developer
> responsibility to choose which patterns to add to their list.  Is there
> any easy way to make a particular repository supply the same list for
> all developers who check it out, without them having to munge things?

That is a good point, but we should be very careful. "Let's add whatever configuration the project supplies to the user's repository upon cloning" is an absolute no-no, as a malicious project can ship something like [alias] "co" = "!rm -rf ." and unsuspecting victim to blindly add it to the configuration.

A standard practice we encourage is to ship a file that records the suggested set of configuration variables as part of the source tree and mention how to add these to their repository in README (which you are already using to talk about how to contribute to the project, etc.).

That would give them a chance to inspect what potential damage the project suggestion will make to their environment (hopefully, there is none, but the user must be given a chance to ensure that).

The extra lines you may need in your README may become something like
    Run this in your copy of the project:
    $ git config sendemail.cccmd "git contact --cc Suggested-by"
with such a scheme.
Previous: Eric BlakeNext: Jeff King
Message 4 of 8 in “git-contacts: Add recognition of Reported-by”
  1. git-contacts: Add recognition of Reported-byEric Blake, Jul 21, 2017
  2. Junio C HamanoJul 21, 2017
  3. Eric BlakeJul 21, 2017
  4. Junio C HamanoJul 21, 2017
  5. Jeff KingJul 24, 2017
  6. Junio C HamanoJul 24, 2017
  7. Jeff KingJul 24, 2017
  8. Junio C HamanoJul 27, 2017

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.