2 * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 * Compute the differences between two blobs and write unified diff text
19 * to the provided output FILE. Two const char * diff header labels may
20 * be provided which will be used to identify each blob in the diff output.
21 * If a label is NULL, use the blob's SHA1 checksum instead.
23 const struct got_error *got_diff_blob(struct got_blob_object *,
24 struct got_blob_object *, const char *, const char *, FILE *);
27 * Compute the differences between two trees and write unified diff text
28 * to the provided output FILE. Two const char * diff header labels may
29 * be provided which will be used to identify each blob in the diff output.
30 * If a label is NULL, use the blob's SHA1 checksum instead.
32 const struct got_error *got_diff_tree(struct got_tree_object *,
33 struct got_tree_object *, const char *label1, const char *label2,
34 struct got_repository *, FILE *);
37 * Diff two objects, assuming both objects are blobs. Two const char * diff
38 * header labels may be provided which will be used to identify each blob in
39 * the diff output. If a label is NULL, use the blob's SHA1 checksum instead.
40 * Write unified diff text to the provided output FILE.
42 const struct got_error *got_diff_objects_as_blobs(struct got_object *,
43 struct got_object *, const char *, const char *, struct got_repository *,
47 * Diff two objects, assuming both objects are trees. Two const char * diff
48 * header labels may be provided which will be used to identify each blob in
49 * the trees. If a label is NULL, use the blob's SHA1 checksum instead.
50 * Write unified diff text to the provided output FILE.
52 const struct got_error *got_diff_objects_as_trees(struct got_object *,
53 struct got_object *, char *, char *, struct got_repository *, FILE *);
56 * Diff two objects, assuming both objects are commits.
57 * Write unified diff text to the provided output FILE.
59 const struct got_error *got_diff_objects_as_commits(struct got_object *,
60 struct got_object *, struct got_repository *, FILE *);