This repository was archived by the owner on Sep 11, 2020. It is now read-only.
Fix fatal: corrupt patch error in unified diff format#932
Merged
mcuadros merged 1 commit intosrc-d:masterfrom Sep 10, 2018
werf:fix-negative-range-info
Merged
Fix fatal: corrupt patch error in unified diff format#932mcuadros merged 1 commit intosrc-d:masterfrom werf:fix-negative-range-info
fatal: corrupt patch error in unified diff format#932mcuadros merged 1 commit intosrc-d:masterfrom
werf:fix-negative-range-info
Conversation
Contributor
|
Can you provide a test? Thanks |
distorhead
added a commit
to werf/werf
that referenced
this pull request
Sep 6, 2018
Go-git experiment failed for now. There is blocking issue to continue use go-git: * Corrupt patch generation for files without newline-at-the-end: src-d/go-git#936 And some non-blocking, but harmful: * Memory usage is too big on big repos: src-d/go-git#832. * Corrupt patch generation (solved in fork): src-d/go-git#932. Libgit2 is too complex to install or statically build into dapp. Also libgit2 has memory leaks. The decision is to use raw git command in a clean and efficient way. Implemented Diff operation.
distorhead
added a commit
to werf/werf
that referenced
this pull request
Sep 6, 2018
Go-git experiment failed for now. There is blocking issue to continue use go-git: * Corrupt patch generation for files without newline-at-the-end: src-d/go-git#936 And some non-blocking, but harmful: * Memory usage is too big on big repos: src-d/go-git#832 * Corrupt patch generation (solved in fork): src-d/go-git#932 Libgit2 is too complex to install or statically build into dapp. Also libgit2 has memory leaks. The decision is to use raw git command in a clean and efficient way. Implemented Diff operation.
Contributor
|
@ajnavarro PTAL |
Contributor
|
@mcuadros the change looks good to me, but I will appreciate a test for it. |
Signed-off-by: Antonio Jesus Navarro Perez <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There may be negative number in the range of unified diff. Negative number occurs when patch changes for example first or second line of file. Bug related to ContextLines number.
Demonstration repo and program to generate wrong patch available here:
https://github.com/flant/go-git-test/
Resulting patch:
+-1,2causesgit applyto complain: