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

Re: please strip MIME-Version and Content-T{ype,ransfer-Encoding} in git am --scissors

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 8, 2015, 19:28 UTC
Message-ID
<xmqqvbahqhw1.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20151008071728.GO3982@pengutronix.de>
Uwe Kleine-König  <u.kleine-koenig@pengutronix.de> writes:
Show 26 quoted lines
> Hello,
>
> when applying the mail below (without the '> ' prefix) using git am
> --scissors the result looks like:
>
> 	$ git show
> 	commit 26ef0606927cc1979faa4166d7f9f3584b5cdc61
> 	Author: Tony Lindgren <tony@atomide.com>
> 	Date:   Tue Oct 6 05:36:17 2015 -0700
>
> 	    memory: omap-gpmc: Fix unselectable debug option for GPMC
> 	    
> 	    MIME-Version: 1.0
> 	    Content-Type: text/plain; charset=UTF-8
> 	    Content-Transfer-Encoding: 8bit
> 	    
> 	    Commit 63aa945b1013 ("memory: omap-gpmc: Add Kconfig option for debug")
> 	    added a debug option for GPMC, but somehow managed to keep it unselectable.
> 	    
> 	[...]
>
> 	$ git version
> 	git version 2.6.0
>
> The obvious improvement is to strip all headers like git am does without
> --scissors.

Does this have anything to do with scissors, though? If you remove everything before "8< ---" in the body of Tony's message (i.e. keep the in-body headers starting with "From:" and ending with CTE) and try again, I would suspect that you will get the same result.

I also think that the "MIME-Version" thing is what gives this; mailinfo and am do not really use it, and consider that the in-body header ends there.

The right approach to tweak mailinfo to cope with this better would be to keep a bit more state inside mailinfo.c::handle_commit_msg() so that if we are (1) using in-body headers, (2) have already seen _some_ valid in-body header like "Subject:" and "From: ", and (3) have not seen a blank line, discard lines that we do not care about (e.g. "MIME-VERSION: 1.0").

> If someone wants a bounce of the original mail, just ask per PM.
I have no idea what you are talking about here...
Show 38 quoted lines
> On Wed, Oct 07, 2015 at 03:41:19AM -0700, Tony Lindgren wrote:
>> * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [151007 00:57]:
>> > On Wed, Oct 07, 2015 at 10:45:50AM +0300, Roger Quadros wrote:
>> > > 
>> > > How about this instead?
>> > > 
>> > > NOTE: Apart from matching the register setup with the bootloader you also need to
>> > > match the GPMC FCLK frequency used by the bootloader else the GPMC timings
>> > > won't be identical with the bootloader timings.
>> > Yeah, sounds better, thanks.
>> > 
>> > > Also you might need to build this patch on top of
>> > > http://article.gmane.org/gmane.linux.kernel/2054796
>> > I talked to Tony about this patch yesterday on irc, but I didn't find it
>> > in the archives yet when I sent my mail.
>> 
>> Yes sorry here's a repost with your and Roger's changes folded in and
>> edited a bit. Probably best to keep them together with this patch.
>> 
>> Does the following look OK to you guys?
>> 
>> Regards,
>> 
>> Tony
>> 
>> 8< ----------------
>> From: Tony Lindgren <tony@atomide.com>
>> Date: Tue, 6 Oct 2015 05:36:17 -0700
>> Subject: [PATCH] memory: omap-gpmc: Fix unselectable debug option for GPMC
>> MIME-Version: 1.0
>> Content-Type: text/plain; charset=UTF-8
>> Content-Transfer-Encoding: 8bit
>> 
>> Commit 63aa945b1013 ("memory: omap-gpmc: Add Kconfig option for debug")
>> added a debug option for GPMC, but somehow managed to keep it unselectable.
>> 
>> This probably happened because I had some uncommitted changes and the
>> ...
Previous: Uwe Kleine-KönigNext: Uwe Kleine-König
Message 2 of 6 in “please strip MIME-Version and Content-T{ype,ransfer-Encoding} in git am --scissors”
  1. Uwe Kleine-KönigOct 8, 2015
  2. Junio C HamanoOct 8, 2015
  3. Uwe Kleine-KönigOct 8, 2015
  4. Junio C HamanoOct 8, 2015
  5. Uwe Kleine-KönigOct 8, 2015
  6. mailinfo: ignore in-body header that we do not care aboutJunio C Hamano, Oct 9, 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.