Blame


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