Community
Participate
Working Groups
Eclipse EGit 1.3.0.201202130524 Currently, when creating a patch with binary file, the patch contains only "Binary files differ" line. It would be nice if creating and applying binary patches would be supported.
I almost lost data due to this. The wizard must at least warn the user that the patch is going to be incomplete.
This is still an issue in at least version 3.41. I have a history item with a doc file, and create patch only shows "Binary files differ" where the diff display would normally be, regardless of the patch format.
Created attachment 259537 [details] Git patch file containing the fix Added support for binary patches in JGit. JUnit test is included. Several minor fixes were also made to properly handle non ASCII characters (like UTF-8) in text patches. Note that the patch attached to this bug as a fix has binary content used in the JUnit test. Therefore this patch should be applied with native git (because JGit/EGit does not understand binary patch content till this fix is applied :).
could you please push your fix to Gerrit for code review following https://wiki.eclipse.org/EGit/Contributor_Guide#Contributing_Patches
JGit is licensed under EDL (Eclipse Distribution License), we can only accept contributions under that license. The license header in each source file must match the following template (see any source file in JGit): /* * Copyright (C) <year>, <company or individual> * and other copyright owners as documented in the project's IP log. * * This program and the accompanying materials are made available * under the terms of the Eclipse Distribution License v1.0 which * accompanies this distribution, is reproduced below, and is * available at http://www.eclipse.org/org/documents/edl-v10.php * * All rights reserved. * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * - Neither the name of the Eclipse Foundation, Inc. nor the * names of its contributors may be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
Created attachment 259562 [details] This patch has license fixed This patch should be applied after the first one, it has license agreements fixed.
New Gerrit change created: https://git.eclipse.org/r/65902
New Gerrit change created: https://git.eclipse.org/r/65901
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/177592
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/177593
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/177594
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/177595
Yuriy's change from 2016 is abandoned, but even it were not, it could not be taken: * it's not license clean; the Base85 codec is a direct copy/translation of the C git code and is thus GPL2 licensed and must not be included in JGit. * it's tainted by unrelated changes to encoding problems that are better handled via bug 571585 and via https://git.eclipse.org/r/c/jgit/jgit/+/177596 . There is yet another attempt at this (also from 2016 and also abandoned, by Nadav Cohen) in https://git.eclipse.org/r/c/jgit/jgit/+/78350 , but that only handles literal binary patches, not delta patches, and does everything in memory. This new series is a fresh attempt at all this.
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/177592 was merged to [master]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=501fc0dadde1b68a6c7bccd870e18cdf03d0e62c
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/177595 was merged to [master]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=10ac4499115965ff10e547a0632c89873a06cf91
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/177594 was merged to [master]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=0fe794a433d54504de066ae119b5835ab69c1c54
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/177593 was merged to [master]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=2eb54afe6a5cb5dd2a108285ad1676b7798d5a15
Sorry, not fixed in EGit yet. Missing bits: * Creating binary patches * Checking that applying them via EGit UI works.