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

Re: [PATCH 3/3] doc: give examples for send-email cc-cmd operation

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 20, 2015, 19:59 UTC
Message-ID
<xmqqoaj6y50b.fsf@gitster.dls.corp.google.com>
In-Reply-To
<1437416790-5792-5-git-send-email-philipoakley@iee.org>
Philip Oakley <philipoakley@iee.org> writes:
Show 6 quoted lines
> +git-send-email invokes the cc-cmd like this:
> +
> +	$cc-cmd $patchfilename
> +
> +Thus the patch itself can be processed to locate appropriate email address
> +information if required.

That's not even a valid command line (cc-cmd cannot be a shell variable name), so why bother writing it that way? Rather

    The program that is specified by `cc-cmd` is invoked by `git
    send-email` with the name of the patch file as an argument;
    the program can read from it and customize its output based on
    what the patch file contains.
    
or something like that, perhaps.
> +
> +A simple solution for a basic address list is to create a 'cc-cmd' file
> +(executable) which provides a list of addressees:

There is no "problem" stated here that requires your "solution". In fact, what problem are you solving?

Show 5 quoted lines
> +	#!/bin/sh
> +	echo <<\EOF
> +	person1@example.com
> +	person2@example.com
> +	EOF

That is one simple and denegerate use case; if the program does not need any information from the patch file, it surely has an option not to look at it. But it is not an interesting usage.

If you want to add a single example to illustrate how cc-cmd (or to-cmd, or anything that goes thru recipients_cmd()), you should have an example that reads the input and then adds a few hardcoded one.

	#!/bin/sh
	# always send it to the logger service
        echo "patchlog@example.com"
	# tell the bug tracker as necessary
	if fixes=$(sed -ne 's/^Fixes bug#\([0-9]*\)/\1/p' "$1")
        then
		echo "bugs+$fixes@example.com"
	fi
or something silly like that.
And this ...
Show 5 quoted lines
> +Simply, using `cat cc-cmd` as the --cc-cmd (with cc-cmd as the text file
> +of email addresses), does not work as expected as the invocation becomes:
> +
> +	$cat cc-cmd $patchfilename
> +

... and the rest of the patch is unnecessary noise to a reader who read that the single argument to the program is the name of the patchfile, I think. You were trying to avoid the same confusion caused by the sketchy documentaiton, and you already "solved" that problem by telling the reader what the command takes as its input.

> +    --cc-cmd='cat cc-cmd #'

This heavily depends on the current implementation that happens to pass the command line string to a shell.

Previous: Eric SunshineNext: Philip Oakley
Message 13 of 18 in “Update send-email cc-cmd documentation”
  1. 0/3 Update send-email cc-cmd documentationPhilip Oakley, Jul 20, 2015
  2. 1/3 doc: convert send-email option headings to nounsPhilip Oakley, Jul 20, 2015
  3. 2/3 doc: send-email; expand on the meaning of 'auto-cc'Philip Oakley, Jul 20, 2015
  4. Eric SunshineJul 20, 2015
  5. 2/3 doc: send-email; expand oon the meaning of 'auto-cc'Philip Oakley, Jul 20, 2015
  6. Philip OakleyJul 20, 2015
  7. 3/3 doc: give examples for send-email cc-cmd operationPhilip Oakley, Jul 20, 2015
  8. Eric SunshineJul 20, 2015
  9. Eric SunshineJul 20, 2015
  10. Eric SunshineJul 20, 2015
  11. Philip OakleyJul 20, 2015
  12. Eric SunshineJul 20, 2015
  13. Junio C HamanoJul 20, 2015
  14. Philip OakleyJul 20, 2015
  15. Junio C HamanoJul 20, 2015
  16. Junio C HamanoJul 20, 2015
  17. Philip OakleyJul 21, 2015
  18. Junio C HamanoJul 22, 2015

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.