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

Re: [TopGit PATCH] tg-create.sh: Support for multiple {to,cc,bcc} options

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Aug 9, 2008, 07:23 UTC
Message-ID
<36ca99e90808090023r545bbef4ie6fbe6e5561f3a55@mail.gmail.com>
In-Reply-To
<7vbq039dfa.fsf@gitster.siamese.dyndns.org>
On Sat, Aug 9, 2008 at 03:37, Junio C Hamano <gitster@pobox.com> wrote:
Show 7 quoted lines
> Petr Baudis <pasky@suse.cz> writes:
>
>>> +    prefix="$(echo "$2" | sed -e 's/\//\\\\\//g')"
>>
>> Maybe use s### ? ;-)
>
> Personally I like '|' instead.  It's much less visually distracting than #.
  ^^^^^^^^^^ says it all ;-)
Show 8 quoted lines
>
>>> +
>>> +    git config --get-all topgit.$1 2>/dev/null |
>>> +            sed -e "s/^/$prefix /g"
>>> +}
>>
>> Won't this return an error code and terminate the script in case no
>> option is defined?

I tested it with none defined options: no error, no distracting empty lines, no error messages. so it worked here.

Show 16 quoted lines
>>> -    ! header="$(git config topgit.to)" || echo "To: $header"
>>> -    ! header="$(git config topgit.cc)" || echo "Cc: $header"
>>> -    ! header="$(git config topgit.bcc)" || echo "Bcc: $header"
>>> +    get_multi_config to  "To:"
>>> +    get_multi_config cc  "Cc:"
>>> +    get_multi_config bcc "Bcc:"
>>>      ! subject_prefix="$(git config topgit.subjectprefix)" || subject_prefix="$subject_prefix "
>>>      echo "Subject: [${subject_prefix}PATCH] $name"
>>>      echo
>>
>> One trouble here is that I've seen mailers mess up when there is
>> multiple occurences of these headers, so it would be probably safer to
>> concatenate them all to single line, comma-separated.
>
> It is not just "I've seen mailers"; RFC2822 wants you to have at most one
> (see the table on Page 20).

But do we generate a valid mail with tg patch, or just a patch file with some special looking lines? Anyway, I thought about the comma separated solution too, but git send-mail handles these multi lines well. So I take the easy road.

Bert
Previous: Junio C HamanoNext: Petr Baudis
Message 4 of 6 in “tg-create.sh: Support for multiple {to,cc,bcc} options”
  1. tg-create.sh: Support for multiple {to,cc,bcc} optionsBert Wesarg, Aug 7, 2008
  2. Petr BaudisAug 9, 2008
  3. Junio C HamanoAug 9, 2008
  4. Bert WesargAug 9, 2008
  5. Petr BaudisAug 9, 2008
  6. Bert WesargAug 9, 2008

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.