sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

Rugged::Blob#diff

Directly generate a Rugged::Patch from the difference between +blob+ and +other+.

+other+ can either be another Rugged::Blob instance, a string,
or nil (treated as an empty blob).

The following options can be passed in the +options+ Hash:

:max_size ::
  An integer specifying the maximum byte size of a blob before a it will
  be treated as binary. The default value is 512MB.

:context_lines ::
  The number of unchanged lines that define the boundary of a hunk (and
  to display before and after the actual changes). The default is 3.

:interhunk_lines ::
  The maximum number of unchanged lines between hunk boundaries before the hunks
  will be merged into a one. The default is 0.

:reverse ::
  If true, the sides of the diff will be reversed.

:force_text ::
  If true, all files will be treated as text, disabling binary attributes & detection.

:ignore_whitespace ::
  If true, all whitespace will be ignored.

:ignore_whitespace_change ::
  If true, changes in amount of whitespace will be ignored.

:ignore_whitespace_eol ::
  If true, whitespace at end of line will be ignored.

:patience ::
  If true, the "patience diff" algorithm will be used (currently unimplemented).

:skip_binary_check ::
  If true, diff deltas will be generated without spending time on binary
  detection. This is useful to improve performance in cases where the actual
  file content difference is not needed.

:old_path ::
  An optional string to treat +blob+ as if it had this filename.

:new_path ::
  An optional string to treat +other+ as if it had this filename.

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/rugged-1.7.1/ext/rugged/rugged_blob.c

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Rugged--Blob-diff-for-pr


# Commit to git

git add app/server/ruby/vendor/rugged-1.7.1/ext/rugged/rugged_blob.cgit commit -m "better docs for Rugged::Blob#diff"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Rugged--Blob-diff-for-pr

hub pull-request


# Celebrate!