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

Re: git rm / format-patch / am fails on my file: patch does not apply

From
KTKen Tanzer <ken.tanzer@gmail.com>
Date
Nov 13, 2013, 00:26 UTC
Message-ID
<CAD3a31UVkNaPTCWCAbv0NwCOTE5_2A+P7-e28VRnk9Aopa6hcQ@mail.gmail.com>
In-Reply-To
<xmqqhabilpzx.fsf@gitster.dls.corp.google.com>
> I am not very much surprised if such a file misbehaves, because the
> "format-patch | am" pipeline is designed to be used on patches that
> can be transferred in plain-text e-mail safely.  Long lines should
> probably be OK, but mixed CRLF, CR and LF may be problematic.

I'm not sure I understand this comment. format-patch seems to work fine on binary files. So if it can handle any random collection of bytes, why not text files with (admittedly funky) CRs and LFs?

Cheers, Ken

On Mon, Nov 11, 2013 at 11:04 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 29 quoted lines
> Ken Tanzer <ken.tanzer@gmail.com> writes:
>
>> ASCII text, with very long lines, with CRLF, CR, LF line terminators
>
> I am not very much surprised if such a file misbehaves, because the
> "format-patch | am" pipeline is designed to be used on patches that
> can be transferred in plain-text e-mail safely.  Long lines should
> probably be OK, but mixed CRLF, CR and LF may be problematic.
>
> Having said that...
>
>> I've confirmed with the following test case on three machines, so it
>> seems reproducible:
>>
>> mkdir temp_test_case
>> cd temp_test_case
>> git init
>> # my file.  Sorry--couldn't find a saner link!
>> wget -O jquery-ui-1.8.custom.min.js
>> http://sourceforge.net/p/agency/code/ci/9358ea4dbe8e1540ec0b8bebfc7770f1bf8be0ec/tree/jquery-ui-1.8.custom.min.js?format=raw
>> git add jquery-ui-1.8.custom.min.js
>> git commit -m 'Adding jquery-ui'
>> git rm jquery-ui-1.8.custom.min.js
>> git commit -m 'Removing jquery-ui'
>> git format-patch HEAD~1
>> git reset --hard HEAD~1
>> git am 0001*
>
> ... this does not break at all for me.
-- 
AGENCY Software
A data system that puts you in control
100% Free Software
http://agency-software.org/
ken.tanzer@agency-software.org
(253) 245-3801

Subscribe to the mailing list to
learn more about AGENCY or
follow the discussion.
Previous: Stefan BellerNext: Junio C Hamano
Message 7 of 10 in “git rm / format-patch / am fails on my file: patch does not apply”
  1. Ken TanzerNov 11, 2013
  2. Junio C HamanoNov 11, 2013
  3. Stefan BellerNov 11, 2013
  4. Junio C HamanoNov 11, 2013
  5. Stefan BellerNov 11, 2013
  6. Stefan BellerNov 11, 2013
  7. Ken TanzerNov 13, 2013
  8. Junio C HamanoNov 13, 2013
  9. Philip OakleyNov 13, 2013
  10. Ken TanzerNov 14, 2013

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.