Skip to content

Releases: bluekeyes/go-gitdiff

v0.9.0

Choose a tag to compare

@bluekeyes bluekeyes released this 18 Jul 21:59
703f876

API Breaks

  • Remove the BinaryFragment.Data field and replace it with BinaryFragment.RawData, which contains the decoded but still compressed data from the fragment. Clients should use the io.Reader returned by the new BinaryFragment.Data() method to access the uncompressed data. (#76)
  • Apply() and BinaryApplier.ApplyFragment() enforce a default maximum binary fragment size of 100 MiB. Clients may adjust or disable this limit by passing the WithMaxBinaryFragmentBytes option to their apply calls. (#77)

Improvements

  • Short source files are reported as conflicts instead of EOF errors during applies (#63)
  • Clients can limit the size of binary fragments during applies using the WithMaxBinaryFragmentBytes option (#77)
  • BinaryFragment.String() returns the same content lines as were originally parsed (assuming normalized whitespace) instead of an equivalent encoding that parsed to the same value but was not the same text (#76)

Fixes

  • Fix a panic or memory exhaustion issue when applying text fragments with very large old positions (#75)
  • Fix unbounded decompression leading to memory exhaustion when parsing binary fragments (#76)
  • Fix unbounded writes to the client-provided io.Writer when applying binary fragments (#77)

v0.8.1

Choose a tag to compare

@bluekeyes bluekeyes released this 08 Jan 03:38
fffa3cc

Fixes

  • Parse binary file headers that include file paths (#55)
  • Fix binary file headers when formatting a patch as a string (#56)

v0.8.0

Choose a tag to compare

@bluekeyes bluekeyes released this 20 Aug 03:16
8584cd5

Improvements

  • Add the File.String() method to convert a parsed file back to a patch representation (#48)

Changes

  • Set the module's Go version to 1.21 to due to usage of generics and the slices package in test code

v0.7.4

Choose a tag to compare

@bluekeyes bluekeyes released this 19 Jul 03:44
0a4e55f

Fixes

  • Return the input as the preamble, instead of an empty string, when a patch has no files (#46)

v0.7.3

Choose a tag to compare

@bluekeyes bluekeyes released this 06 May 03:29
a00d2cc

Improvements

  • Accept invalid (according to RFC 5322) email addresses in From: lines of mail-formatted patches (#44)
  • More closely follow Git's logic when parsing identities with ParsePatchIdentity (#44)
    • Extract email addresses even when they do not appear in angle brackets
    • Consider content that appears after the email address as part of the name
    • Unquote escaped characters in quoted strings and RFC 5322 comments
    • Normalize runs of white space in names to single space characters

v0.7.2

Choose a tag to compare

@bluekeyes bluekeyes released this 07 Mar 05:37
3f2ea5c

Improvements

  • Accept more inputs in ParsePatchIdentity (#42)
    • Allow identity strings with empty email address (must still include <> markers)
    • When an identity contains only an email address, also use it to set the Name field

v0.7.1

Choose a tag to compare

@bluekeyes bluekeyes released this 17 Mar 05:05
981bc4b

Fixes

  • Fix error parsing mode lines with trailing whitespace (#38)

v0.7.0

Choose a tag to compare

@bluekeyes bluekeyes released this 01 Oct 22:43

API Breaks

  • Remove the Applier type and replace it with TextApplier and BinaryApplier. This does not impact clients that only use the top-level Apply function (#32).

Improvements

  • Add an option to control which content is removed from subject lines when parsing the headers of mail-formatted patches (#36)
  • Simplify internal logic for patch header parsing (#34)
  • Run tests and lint checks with Go 1.19 (#35)

v0.6.1

Choose a tag to compare

@bluekeyes bluekeyes released this 18 Mar 20:57
52645c6

Fixes

  • Fix out-of-bounds panic in timestamp parsing (#28)
  • Fix panic when parsing certain invalid text fragments (#29)
  • Return an error when parsing text fragments that contain only context lines (#29)
  • Use ioutil to retain compatibility with Go versions prior to 1.16 (#31)

v0.6.0

Choose a tag to compare

@bluekeyes bluekeyes released this 20 Aug 00:59
53bcdf7

API Breaks

  • Improve the behavior of the LineReaderAt interface when the final line does not have a newline character. This change is only relevant for clients that define LineReaderAt implementations and should not affect most users of the library. If you use a custom LineReaderAt implementation, please review the documentation and update your implementation to avoid errors (#27).

Fixes

  • Fix apply errors (unexpected EOF) with files that are multiples of 1024 bytes and have no final newline (#27).