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

RE: [PATCH 1/2] mailinfo: Add support for keep_cr

From
MWMatthew Wilcox <mawilcox@microsoft.com>
Date
Jan 12, 2017, 19:06 UTC
Message-ID
<BY2PR21MB0036E89DDFC5EFC8F17CD77DCB790@BY2PR21MB0036.namprd21.prod.outlook.com>
In-Reply-To
<8f2be1e9-9199-44af-9d57-41763cb4d666@google.com>
From: Jonathan Tan [mailto:jonathantanmy@google.com]
> On 01/12/2017 01:20 AM, Matthew Wilcox wrote:
> A test exercising the new functionality would be nice.
Roger.
> Also, maybe a more descriptive title like "mailinfo: also respect
> keep_cr after base64 decode" (50 characters) is better.
No problem.
Show 10 quoted lines
> > @@ -143,6 +144,7 @@ static void am_state_init(struct am_state *state,
> const char *dir)
> >
> >  	memset(state, 0, sizeof(*state));
> >
> > +	state->keep_cr = -1;
> 
> Maybe query the git config here (instead of later) so that we never have
> to worry about state->keep_cr being neither 0 nor 1? This function
> already queries the git config anyway.
I wondered why the existing code didn't do that, but I wanted to make a minimal change rather than clean up an older mistake.  I'm happy to do it that way.
Show 16 quoted lines
> > diff --git a/mailinfo.h b/mailinfo.h
> > index 04a25351d..9fddcf684 100644
> > --- a/mailinfo.h
> > +++ b/mailinfo.h
> > @@ -12,6 +12,7 @@ struct mailinfo {
> >  	struct strbuf email;
> >  	int keep_subject;
> >  	int keep_non_patch_brackets_in_subject;
> > +	int keep_cr;
> >  	int add_message_id;
> >  	int use_scissors;
> >  	int use_inbody_headers;
> 
> I personally would write "unsigned keep_cr : 1" to further emphasize
> that this can only be 0 or 1, but I don't know if it's better to keep
> with the style existing in the file (that is, using int).
Probably best to stick to the existing file ... someone can always do a cleanup patch later, and having this match the others will make that easier, not harder.
Thanks for the review.
Previous: Jonathan Tan
Message 7 of 7 in “mailinfo: Add support for keep_cr”
  1. 1/2 mailinfo: Add support for keep_crMatthew Wilcox, Jan 12, 2017
  2. 2/2 mailinfo: Understand forwarded patchesMatthew Wilcox, Jan 12, 2017
  3. Jonathan TanJan 12, 2017
  4. Matthew WilcoxJan 12, 2017
  5. Junio C HamanoJan 12, 2017
  6. Jonathan TanJan 12, 2017
  7. Matthew WilcoxJan 12, 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.