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

Re: stgit truncates binary files to zero length when applying patches

From
Karl Hasselström <kha@treskal.com>
Date
Nov 16, 2005, 11:54 UTC
Message-ID
<20051116115449.GA5933@diana.vm.bytemark.co.uk>
In-Reply-To
<b0943d9e0511160311k725526d8v@mail.gmail.com>
On 2005-11-16 11:11:56 +0000, Catalin Marinas wrote:
Show 6 quoted lines
> On 15/11/05, Karl Hasselström <kha@treskal.com> wrote:
>
> > When applying patches and not fast-forwarding, stgit truncates the
> > binary files to zero length:
>
> I've never tried binaries with StGIT before.

I don't blame you. Binary patches aren't something I normally create either. It's just that I find stgit patches a good way to logically structure a largeish change that I'm working on before committing it. (I could probably accoplish the same thing with one branch instead of each stgit patch, but then it would be quite a lot of work to manually push updates through all the branches.)

Show 8 quoted lines
> When pushing a patch, if a merge is needed (like in your case, the
> base of the foo patch has changed), StGIT first tries "git-diff-tree
> | git-apply" for speed reasons. If this fails, it falls back to a
> three-way merge.
>
> Unfortunately, git-apply doesn't fail for patches including binary
> files and simply creates an empty file. I think git-apply should be
> changed to fail to apply this kind of patches.

Yes, at least if stgit is going to continue to use it like this. Refusing to handle binary files is somewhat disappointing, but still OK; agreeing to handle them and then silently wiping them is a bit less OK. (But don't worry; it is a perfect world, after all, so of course I had backups. :-)

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
Previous: Catalin MarinasNext: Catalin Marinas
Message 3 of 35 in “stgit truncates binary files to zero length when applying patches”
  1. Karl HasselströmNov 15, 2005
  2. Catalin MarinasNov 16, 2005
  3. Karl HasselströmNov 16, 2005
  4. Catalin MarinasNov 16, 2005
  5. Karl HasselströmNov 16, 2005
  6. Junio C HamanoNov 16, 2005
  7. git-apply: fail if a patch cannot be applied.Junio C Hamano, Nov 16, 2005
  8. master has some toysJunio C Hamano, Nov 17, 2005
  9. Alex RiesenNov 17, 2005
  10. Junio C HamanoNov 17, 2005
  11. Alex RiesenNov 17, 2005
  12. Junio C HamanoNov 17, 2005
  13. John BenesNov 18, 2005
  14. Johannes SchindelinNov 18, 2005
  15. John BenesNov 18, 2005
  16. Junio C HamanoNov 18, 2005
  17. A Large Angry SCMNov 18, 2005
  18. Junio C HamanoNov 18, 2005
  19. Deal with binary diff output from (unknown version of) diffJunio C Hamano, Nov 18, 2005
  20. A Large Angry SCMNov 18, 2005
  21. John BenesNov 18, 2005
  22. Junio C HamanoNov 18, 2005
  23. John BenesNov 18, 2005
  24. A Large Angry SCMNov 18, 2005
  25. Johannes SchindelinNov 17, 2005
  26. Johannes SchindelinNov 17, 2005
  27. Junio C HamanoNov 17, 2005
  28. Alex RiesenNov 17, 2005
  29. Johannes SchindelinNov 17, 2005
  30. Alex RiesenNov 17, 2005
  31. Junio C HamanoNov 17, 2005
  32. Johannes SchindelinNov 17, 2005
  33. Junio C HamanoNov 18, 2005
  34. timo@dspsrv.comNov 18, 2005
  35. Alex RiesenNov 17, 2005

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.