Ravenports generated: 21 Feb 2018 14:11
[ravenports.git] / bucket_B4 / cgit
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               cgit
4 VERSION=                1.1
5 KEYWORDS=               www devel
6 VARIANTS=               standard
7 SDESC[standard]=        Fast web interface for git
8 HOMEPAGE=               https://git.zx2c4.com/cgit/about/
9 CONTACT=                nobody
10
11 DOWNLOAD_GROUPS=        main fixedgit
12 SITES[main]=            http://git.zx2c4.com/cgit/snapshot/
13 SITES[fixedgit]=        https://www.kernel.org/pub/software/scm/git/
14 DISTFILE[1]=            cgit-1.1.tar.xz:main
15 DISTFILE[2]=            git-2.16.0.tar.xz:fixedgit
16 DF_INDEX=               1 2
17 SPKGS[standard]=        single
18
19 OPTIONS_AVAILABLE=      none
20 OPTIONS_STANDARD=       none
21
22 USES=                   cpe gmake iconv python:build shebangfix ssl zlib
23
24 LICENSE=                GPLv2:single
25 LICENSE_SCHEME=         solo
26 LICENSE_FILE=           GPLv2:{{WRKSRC}}/COPYING
27
28 CPE_VENDOR=             lars_hjemli
29 FPC_EQUIVALENT=         devel/cgit
30 SHEBANG_FILES=          filters/email-gravatar.py
31                         filters/html-converters/md2html
32                         filters/html-converters/rst2html
33                         filters/syntax-highlighting.py
34
35 MAKE_ARGS=              CGIT_SCRIPT_PATH={{PREFIX}}/www/cgit
36                         CGIT_CONFIG={{PREFIX}}/etc/cgitrc
37                         prefix={{PREFIX}}
38                         NO_GETTEXT=1
39                         NO_LUA=1
40                         NO_R_TO_GCC_LINKER=1
41                         V=1
42                         NEEDS_LIBICONV=1
43
44 INSTALL_REQ_TOOLCHAIN=  yes
45
46 CFLAGS=                 -I{{OPENSSLINC}}
47 LDFLAGS=                -L{{OPENSSLLIB}}
48
49 post-patch:
50         ${REINPLACE_CMD} -e 's/^\(GIT_VER =\).*$$/\1 2.16.0/' \
51                 ${WRKSRC}/Makefile
52         ${REINPLACE_CMD} \
53                 -e "s|\(ALL_CFLAGS =\)|\1 ${CFLAGS}|g" \
54                 -e "s|\(ALL_LDFLAGS =\)|\1 ${LDFLAGS}|g" \
55                 ${WRKSRC}/git/Makefile
56         # ${REINPLACE_CMD} -e 's|ALL_LDFLAGS|LDFLAGS|g' ${WRKSRC}/cgit.mk
57
58 post-install:
59         ${STRIP_CMD} ${STAGEDIR}${PREFIX}/www/cgit/cgit.cgi
60
61 post-extract:
62         ${RMDIR} ${WRKSRC}/git
63         ${MV} ${WRKDIR}/git-2.16.0 ${WRKSRC}/git
64
65 [FILE:102:descriptions/desc.single]
66 cgit is a fast web interface for the Git SCM, using a built-in cache to
67 decrease server I/O pressure.
68
69
70 [FILE:190:distinfo]
71 0889af29be15fc981481caa09579f982b9740fe9fd2860ab87dff286f4635890        86268 cgit-1.1.tar.xz
72 0d10764e66b3d650dee0d99a1c77afa4aaae5e739c0973fcc1c5b9e6516e30f8      4961856 git-2.16.0.tar.xz
73
74
75 [FILE:399:manifests/plist.single]
76 lib/cgit/filters/
77  about-formatting.sh
78  commit-links.sh
79  email-gravatar.lua
80  email-gravatar.py
81  email-libravatar.lua
82  gentoo-ldap-authentication.lua
83 lib/cgit/filters/html-converters/
84  man2html
85  md2html
86  rst2html
87  txt2html
88 lib/cgit/filters/
89  owner-example.lua
90  simple-authentication.lua
91  syntax-highlighting.py
92  syntax-highlighting.sh
93 www/cgit/
94  cgit.cgi
95  cgit.css
96  cgit.png
97  favicon.ico
98  robots.txt
99
100
101 [FILE:4543:patches/patch-git-2.12.0]
102 From 5c80837ea913179a6a983076c4adbab42e6a31dc Mon Sep 17 00:00:00 2001
103 From: Christian Hesse <mail@eworm.de>
104 Date: Wed, 1 Mar 2017 11:37:59 +0100
105 Subject: git: update to v2.12.0
106
107 Update to git version v2.12.0: With commit 8aee769f (pathspec: copy and free
108 owned memory) member 'match' of 'struct pathspec_item' is no longer
109 'const char*' but just 'char*'.
110 ---
111  cgit.h      | 4 ++--
112  shared.c    | 4 ++--
113  ui-blob.c   | 2 +-
114  ui-blob.h   | 2 +-
115  ui-commit.c | 2 +-
116  ui-commit.h | 2 +-
117  ui-diff.c   | 4 ++--
118  ui-diff.h   | 2 +-
119  10 files changed, 13 insertions(+), 13 deletions(-)
120
121 diff --git a/cgit.h b/cgit.h
122 index fbc6c6a..3eb04de 100644
123 --- cgit.h
124 +++ cgit.h
125 @@ -355,10 +355,10 @@ extern int cgit_diff_files(const struct object_id *old_oid,
126  
127  extern void cgit_diff_tree(const struct object_id *old_oid,
128                            const struct object_id *new_oid,
129 -                          filepair_fn fn, const char *prefix, int ignorews);
130 +                          filepair_fn fn, char *prefix, int ignorews);
131  
132  extern void cgit_diff_commit(struct commit *commit, filepair_fn fn,
133 -                            const char *prefix);
134 +                            char *prefix);
135  
136  __attribute__((format (printf,1,2)))
137  extern char *fmt(const char *format,...);
138 diff --git a/shared.c b/shared.c
139 index c63f1e3..4602123 100644
140 --- shared.c
141 +++ shared.c
142 @@ -336,7 +336,7 @@ int cgit_diff_files(const struct object_id *old_oid,
143  
144  void cgit_diff_tree(const struct object_id *old_oid,
145                     const struct object_id *new_oid,
146 -                   filepair_fn fn, const char *prefix, int ignorews)
147 +                   filepair_fn fn, char *prefix, int ignorews)
148  {
149         struct diff_options opt;
150         struct pathspec_item item;
151 @@ -367,7 +367,7 @@ void cgit_diff_tree(const struct object_id *old_oid,
152         diff_flush(&opt);
153  }
154  
155 -void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix)
156 +void cgit_diff_commit(struct commit *commit, filepair_fn fn, char *prefix)
157  {
158         const struct object_id *old_oid = NULL;
159  
160 diff --git a/ui-blob.c b/ui-blob.c
161 index 5f30de7..c759520 100644
162 --- ui-blob.c
163 +++ ui-blob.c
164 @@ -33,7 +33,7 @@ static int walk_tree(const unsigned char *sha1, struct strbuf *base,
165         return 0;
166  }
167  
168 -int cgit_ref_path_exists(const char *path, const char *ref, int file_only)
169 +int cgit_ref_path_exists(char *path, const char *ref, int file_only)
170  {
171         struct object_id oid;
172         unsigned long size;
173 diff --git a/ui-blob.h b/ui-blob.h
174 index 16847b2..d4be56a 100644
175 --- ui-blob.h
176 +++ ui-blob.h
177 @@ -1,7 +1,7 @@
178  #ifndef UI_BLOB_H
179  #define UI_BLOB_H
180  
181 -extern int cgit_ref_path_exists(const char *path, const char *ref, int file_only);
182 +extern int cgit_ref_path_exists(char *path, const char *ref, int file_only);
183  extern int cgit_print_file(char *path, const char *head, int file_only);
184  extern void cgit_print_blob(const char *hex, char *path, const char *head, int file_only);
185  
186 diff --git a/ui-commit.c b/ui-commit.c
187 index db69d54..47b9025 100644
188 --- ui-commit.c
189 +++ ui-commit.c
190 @@ -13,7 +13,7 @@
191  #include "ui-diff.h"
192  #include "ui-log.h"
193  
194 -void cgit_print_commit(char *hex, const char *prefix)
195 +void cgit_print_commit(char *hex, char *prefix)
196  {
197         struct commit *commit, *parent;
198         struct commitinfo *info, *parent_info;
199 diff --git a/ui-commit.h b/ui-commit.h
200 index 8198b4b..3d19eeb 100644
201 --- ui-commit.h
202 +++ ui-commit.h
203 @@ -1,6 +1,6 @@
204  #ifndef UI_COMMIT_H
205  #define UI_COMMIT_H
206  
207 -extern void cgit_print_commit(char *hex, const char *prefix);
208 +extern void cgit_print_commit(char *hex, char *prefix);
209  
210  #endif /* UI_COMMIT_H */
211 diff --git a/ui-diff.c b/ui-diff.c
212 index 173d351..e8e9897 100644
213 --- ui-diff.c
214 +++ ui-diff.c
215 @@ -189,7 +189,7 @@ static void inspect_filepair(struct diff_filepair *pair)
216  
217  static void cgit_print_diffstat(const struct object_id *old_oid,
218                                 const struct object_id *new_oid,
219 -                               const char *prefix)
220 +                               char *prefix)
221  {
222         int i;
223  
224 @@ -382,7 +382,7 @@ void cgit_print_diff_ctrls(void)
225  }
226  
227  void cgit_print_diff(const char *new_rev, const char *old_rev,
228 -                    const char *prefix, int show_ctrls, int raw)
229 +                    char *prefix, int show_ctrls, int raw)
230  {
231         struct commit *commit, *commit2;
232         const unsigned char *old_tree_sha1, *new_tree_sha1;
233 diff --git a/ui-diff.h b/ui-diff.h
234 index 39264a1..4d5a83c 100644
235 --- ui-diff.h
236 +++ ui-diff.h
237 @@ -4,7 +4,7 @@
238  extern void cgit_print_diff_ctrls(void);
239  
240  extern void cgit_print_diff(const char *new_hex, const char *old_hex,
241 -                           const char *prefix, int show_ctrls, int raw);
242 +                           char *prefix, int show_ctrls, int raw);
243  
244  extern struct diff_filespec *cgit_get_current_old_file(void);
245  extern struct diff_filespec *cgit_get_current_new_file(void);
246 -- 
247 cgit v1.1-7-g6221
248
249
250
251 [FILE:2196:patches/patch-git-2.13.1]
252 From af3025cf50642452a2000327bb8e845fd2191423 Mon Sep 17 00:00:00 2001
253 From: Christian Hesse <mail@eworm.de>
254 Date: Tue, 6 Jun 2017 17:16:32 +0200
255 Subject: git: update to v2.13.1
256
257 Update to git version v2.13.1: With commit 8aee769f (pathspec: copy and free
258 owned memory) the definition of struct pathspec_item has changed with the
259 expectation that pathspecs will be managed dynamically. We work around this
260 a bit by setting up a static structure, but let's allocate the match string
261 to avoid needing to cast away const.
262
263 Updated a patch from John Keeping <john@keeping.me.uk> for git v2.12.1.
264 ---
265  git       | 2 +-
266  shared.c  | 4 +++-
267  ui-blob.c | 9 ++++++---
268  3 files changed, 10 insertions(+), 5 deletions(-)
269
270 diff --git a/shared.c b/shared.c
271 index c63f1e3..13a65a9 100644
272 --- shared.c
273 +++ shared.c
274 @@ -352,7 +352,7 @@ void cgit_diff_tree(const struct object_id *old_oid,
275         opt.format_callback = cgit_diff_tree_cb;
276         opt.format_callback_data = fn;
277         if (prefix) {
278 -               item.match = prefix;
279 +               item.match = xstrdup(prefix);
280                 item.len = strlen(prefix);
281                 opt.pathspec.nr = 1;
282                 opt.pathspec.items = &item;
283 @@ -365,6 +365,8 @@ void cgit_diff_tree(const struct object_id *old_oid,
284                 diff_root_tree_sha1(new_oid->hash, "", &opt);
285         diffcore_std(&opt);
286         diff_flush(&opt);
287 +
288 +       free(item.match);
289  }
290  
291  void cgit_diff_commit(struct commit *commit, filepair_fn fn, const char *prefix)
292 diff --git a/ui-blob.c b/ui-blob.c
293 index 5f30de7..793817f 100644
294 --- ui-blob.c
295 +++ ui-blob.c
296 @@ -38,7 +38,7 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only)
297         struct object_id oid;
298         unsigned long size;
299         struct pathspec_item path_items = {
300 -               .match = path,
301 +               .match = xstrdup(path),
302                 .len = strlen(path)
303         };
304         struct pathspec paths = {
305 @@ -53,10 +53,13 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only)
306         };
307  
308         if (get_oid(ref, &oid))
309 -               return 0;
310 +               goto done;
311         if (sha1_object_info(oid.hash, &size) != OBJ_COMMIT)
312 -               return 0;
313 +               goto done;
314         read_tree_recursive(lookup_commit_reference(oid.hash)->tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
315 +
316 +done:
317 +       free(path_items.match);
318         return walk_tree_ctx.found_path;
319  }
320  
321 -- 
322 cgit v1.1-9-ge9c1d
323
324
325
326 [FILE:13568:patches/patch-git-2.14]
327 From 86a6d358f7a6c2432fde86b9e3c5011a656f20e4 Mon Sep 17 00:00:00 2001
328 From: Jeff Smith <whydoubt@gmail.com>
329 Date: Wed, 9 Aug 2017 19:02:56 -0500
330 Subject: git: update to v2.14
331
332 Numerous changes were made to git functions to use an object_id
333 structure rather than sending sha1 hashes as raw unsigned character
334 arrays.  The functions that affect cgit are: parse_object,
335 lookup_commit_reference, lookup_tag, lookup_tree, parse_tree_indirect,
336 diff_root_tree_sha1, diff_tree_sha1, and format_display_notes.
337
338 Commit b2141fc (config: don't include config.h by default) made it
339 necessary to that config.h be explicitly included when needed.
340
341 Commit 07a3d41 (grep: remove regflags from the public grep_opt API)
342 removed one way of specifying the ignore-case grep option.
343
344 Signed-off-by: Jeff Smith <whydoubt@gmail.com>
345 ---
346  Makefile      |  2 +-
347  git           |  2 +-
348  scan-tree.c   |  5 +++--
349  shared.c      |  6 +++---
350  ui-blob.c     |  6 +++---
351  ui-clone.c    |  2 +-
352  ui-commit.c   |  6 +++---
353  ui-diff.c     | 18 +++++++++---------
354  ui-log.c      | 10 +++++-----
355  ui-patch.c    |  4 ++--
356  ui-plain.c    |  2 +-
357  ui-snapshot.c |  2 +-
358  ui-tag.c      |  4 ++--
359  ui-tree.c     | 18 +++++++++---------
360  14 files changed, 44 insertions(+), 43 deletions(-)
361
362 diff --git a/scan-tree.c b/scan-tree.c
363 index 08f3f1d..6a2f65a 100644
364 --- scan-tree.c
365 +++ scan-tree.c
366 @@ -10,6 +10,7 @@
367  #include "scan-tree.h"
368  #include "configfile.h"
369  #include "html.h"
370 +#include <config.h>
371  
372  /* return 1 if path contains a objects/ directory and a HEAD file */
373  static int is_git_dir(const char *path)
374 @@ -48,7 +49,7 @@ out:
375  static struct cgit_repo *repo;
376  static repo_config_fn config_fn;
377  
378 -static void repo_config(const char *name, const char *value)
379 +static void scan_tree_repo_config(const char *name, const char *value)
380  {
381         config_fn(repo, name, value);
382  }
383 @@ -178,7 +179,7 @@ static void add_repo(const char *base, struct strbuf *path, repo_config_fn fn)
384  
385         strbuf_addstr(path, "cgitrc");
386         if (!stat(path->buf, &st))
387 -               parse_configfile(path->buf, &repo_config);
388 +               parse_configfile(path->buf, &scan_tree_repo_config);
389  
390         strbuf_release(&rel);
391  }
392 diff --git a/shared.c b/shared.c
393 index 13a65a9..df3f611 100644
394 --- shared.c
395 +++ shared.c
396 @@ -160,7 +160,7 @@ static struct refinfo *cgit_mk_refinfo(const char *refname, const struct object_
397  
398         ref = xmalloc(sizeof (struct refinfo));
399         ref->refname = xstrdup(refname);
400 -       ref->object = parse_object(oid->hash);
401 +       ref->object = parse_object(oid);
402         switch (ref->object->type) {
403         case OBJ_TAG:
404                 ref->tag = cgit_parse_tag((struct tag *)ref->object);
405 @@ -360,9 +360,9 @@ void cgit_diff_tree(const struct object_id *old_oid,
406         diff_setup_done(&opt);
407  
408         if (old_oid && !is_null_oid(old_oid))
409 -               diff_tree_sha1(old_oid->hash, new_oid->hash, "", &opt);
410 +               diff_tree_oid(old_oid, new_oid, "", &opt);
411         else
412 -               diff_root_tree_sha1(new_oid->hash, "", &opt);
413 +               diff_root_tree_oid(new_oid, "", &opt);
414         diffcore_std(&opt);
415         diff_flush(&opt);
416  
417 diff --git a/ui-blob.c b/ui-blob.c
418 index 793817f..761e886 100644
419 --- ui-blob.c
420 +++ ui-blob.c
421 @@ -56,7 +56,7 @@ int cgit_ref_path_exists(const char *path, const char *ref, int file_only)
422                 goto done;
423         if (sha1_object_info(oid.hash, &size) != OBJ_COMMIT)
424                 goto done;
425 -       read_tree_recursive(lookup_commit_reference(oid.hash)->tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
426 +       read_tree_recursive(lookup_commit_reference(&oid)->tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
427  
428  done:
429         free(path_items.match);
430 @@ -89,7 +89,7 @@ int cgit_print_file(char *path, const char *head, int file_only)
431                 return -1;
432         type = sha1_object_info(oid.hash, &size);
433         if (type == OBJ_COMMIT) {
434 -               commit = lookup_commit_reference(oid.hash);
435 +               commit = lookup_commit_reference(&oid);
436                 read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
437                 if (!walk_tree_ctx.found_path)
438                         return -1;
439 @@ -145,7 +145,7 @@ void cgit_print_blob(const char *hex, char *path, const char *head, int file_onl
440         type = sha1_object_info(oid.hash, &size);
441  
442         if ((!hex) && type == OBJ_COMMIT && path) {
443 -               commit = lookup_commit_reference(oid.hash);
444 +               commit = lookup_commit_reference(&oid);
445                 read_tree_recursive(commit->tree, "", 0, 0, &paths, walk_tree, &walk_tree_ctx);
446                 type = sha1_object_info(oid.hash, &size);
447         }
448 diff --git a/ui-clone.c b/ui-clone.c
449 index 5f6606a..0d11672 100644
450 --- ui-clone.c
451 +++ ui-clone.c
452 @@ -17,7 +17,7 @@ static int print_ref_info(const char *refname, const struct object_id *oid,
453  {
454         struct object *obj;
455  
456 -       if (!(obj = parse_object(oid->hash)))
457 +       if (!(obj = parse_object(oid)))
458                 return 0;
459  
460         htmlf("%s\t%s\n", oid_to_hex(oid), refname);
461 diff --git a/ui-commit.c b/ui-commit.c
462 index db69d54..586fea0 100644
463 --- ui-commit.c
464 +++ ui-commit.c
465 @@ -31,7 +31,7 @@ void cgit_print_commit(char *hex, const char *prefix)
466                                 "Bad object id: %s", hex);
467                 return;
468         }
469 -       commit = lookup_commit_reference(oid.hash);
470 +       commit = lookup_commit_reference(&oid);
471         if (!commit) {
472                 cgit_print_error_page(404, "Not found",
473                                 "Bad commit reference: %s", hex);
474 @@ -39,7 +39,7 @@ void cgit_print_commit(char *hex, const char *prefix)
475         }
476         info = cgit_parse_commit(commit);
477  
478 -       format_display_notes(oid.hash, &notes, PAGE_ENCODING, 0);
479 +       format_display_notes(&oid, &notes, PAGE_ENCODING, 0);
480  
481         load_ref_decorations(DECORATE_FULL_REFS);
482  
483 @@ -87,7 +87,7 @@ void cgit_print_commit(char *hex, const char *prefix)
484         free(tmp);
485         html("</td></tr>\n");
486         for (p = commit->parents; p; p = p->next) {
487 -               parent = lookup_commit_reference(p->item->object.oid.hash);
488 +               parent = lookup_commit_reference(&p->item->object.oid);
489                 if (!parent) {
490                         html("<tr><td colspan='3'>");
491                         cgit_print_error("Error reading parent commit");
492 diff --git a/ui-diff.c b/ui-diff.c
493 index 173d351..c7fb49b 100644
494 --- ui-diff.c
495 +++ ui-diff.c
496 @@ -385,7 +385,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
497                      const char *prefix, int show_ctrls, int raw)
498  {
499         struct commit *commit, *commit2;
500 -       const unsigned char *old_tree_sha1, *new_tree_sha1;
501 +       const struct object_id *old_tree_oid, *new_tree_oid;
502         diff_type difftype;
503  
504         /*
505 @@ -407,13 +407,13 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
506                         "Bad object name: %s", new_rev);
507                 return;
508         }
509 -       commit = lookup_commit_reference(new_rev_oid->hash);
510 +       commit = lookup_commit_reference(new_rev_oid);
511         if (!commit || parse_commit(commit)) {
512                 cgit_print_error_page(404, "Not found",
513                         "Bad commit: %s", oid_to_hex(new_rev_oid));
514                 return;
515         }
516 -       new_tree_sha1 = commit->tree->object.oid.hash;
517 +       new_tree_oid = &commit->tree->object.oid;
518  
519         if (old_rev) {
520                 if (get_oid(old_rev, old_rev_oid)) {
521 @@ -428,15 +428,15 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
522         }
523  
524         if (!is_null_oid(old_rev_oid)) {
525 -               commit2 = lookup_commit_reference(old_rev_oid->hash);
526 +               commit2 = lookup_commit_reference(old_rev_oid);
527                 if (!commit2 || parse_commit(commit2)) {
528                         cgit_print_error_page(404, "Not found",
529                                 "Bad commit: %s", oid_to_hex(old_rev_oid));
530                         return;
531                 }
532 -               old_tree_sha1 = commit2->tree->object.oid.hash;
533 +               old_tree_oid = &commit2->tree->object.oid;
534         } else {
535 -               old_tree_sha1 = NULL;
536 +               old_tree_oid = NULL;
537         }
538  
539         if (raw) {
540 @@ -449,11 +449,11 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
541  
542                 ctx.page.mimetype = "text/plain";
543                 cgit_print_http_headers();
544 -               if (old_tree_sha1) {
545 -                       diff_tree_sha1(old_tree_sha1, new_tree_sha1, "",
546 +               if (old_tree_oid) {
547 +                       diff_tree_oid(old_tree_oid, new_tree_oid, "",
548                                        &diffopt);
549                 } else {
550 -                       diff_root_tree_sha1(new_tree_sha1, "", &diffopt);
551 +                       diff_root_tree_oid(new_tree_oid, "", &diffopt);
552                 }
553                 diffcore_std(&diffopt);
554                 diff_flush(&diffopt);
555 diff --git a/ui-log.c b/ui-log.c
556 index 3220fd9..2d2bb31 100644
557 --- ui-log.c
558 +++ ui-log.c
559 @@ -150,9 +150,9 @@ static int show_commit(struct commit *commit, struct rev_info *revs)
560         rem_lines = 0;
561  
562         DIFF_OPT_SET(&revs->diffopt, RECURSIVE);
563 -       diff_tree_sha1(parent->tree->object.oid.hash,
564 -                      commit->tree->object.oid.hash,
565 -                      "", &revs->diffopt);
566 +       diff_tree_oid(&parent->tree->object.oid,
567 +                     &commit->tree->object.oid,
568 +                     "", &revs->diffopt);
569         diffcore_std(&revs->diffopt);
570  
571         found = !diff_queue_is_empty();
572 @@ -273,7 +273,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
573                                 strbuf_addstr(&msgbuf, info->msg);
574                                 strbuf_addch(&msgbuf, '\n');
575                         }
576 -                       format_display_notes(commit->object.oid.hash,
577 +                       format_display_notes(&commit->object.oid,
578                                              &msgbuf, PAGE_ENCODING, 0);
579                         strbuf_addch(&msgbuf, '\n');
580                         strbuf_ltrim(&msgbuf);
581 @@ -436,7 +436,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
582         setup_revisions(rev_argv.argc, rev_argv.argv, &rev, NULL);
583         load_ref_decorations(DECORATE_FULL_REFS);
584         rev.show_decorations = 1;
585 -       rev.grep_filter.regflags |= REG_ICASE;
586 +       rev.grep_filter.ignore_case = 1;
587  
588         rev.diffopt.detect_rename = 1;
589         rev.diffopt.rename_limit = ctx.cfg.renamelimit;
590 diff --git a/ui-patch.c b/ui-patch.c
591 index 047e2f9..69aa4a8 100644
592 --- ui-patch.c
593 +++ ui-patch.c
594 @@ -33,7 +33,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
595                                 "Bad object id: %s", new_rev);
596                 return;
597         }
598 -       commit = lookup_commit_reference(new_rev_oid.hash);
599 +       commit = lookup_commit_reference(&new_rev_oid);
600         if (!commit) {
601                 cgit_print_error_page(404, "Not found",
602                                 "Bad commit reference: %s", new_rev);
603 @@ -46,7 +46,7 @@ void cgit_print_patch(const char *new_rev, const char *old_rev,
604                                         "Bad object id: %s", old_rev);
605                         return;
606                 }
607 -               if (!lookup_commit_reference(old_rev_oid.hash)) {
608 +               if (!lookup_commit_reference(&old_rev_oid)) {
609                         cgit_print_error_page(404, "Not found",
610                                         "Bad commit reference: %s", old_rev);
611                         return;
612 diff --git a/ui-plain.c b/ui-plain.c
613 index 8d541e3..e45d553 100644
614 --- ui-plain.c
615 +++ ui-plain.c
616 @@ -185,7 +185,7 @@ void cgit_print_plain(void)
617                 cgit_print_error_page(404, "Not found", "Not found");
618                 return;
619         }
620 -       commit = lookup_commit_reference(oid.hash);
621 +       commit = lookup_commit_reference(&oid);
622         if (!commit || parse_commit(commit)) {
623                 cgit_print_error_page(404, "Not found", "Not found");
624                 return;
625 diff --git a/ui-snapshot.c b/ui-snapshot.c
626 index 9b8cddd..b2d95f7 100644
627 --- ui-snapshot.c
628 +++ ui-snapshot.c
629 @@ -116,7 +116,7 @@ static int make_snapshot(const struct cgit_snapshot_format *format,
630                                 "Bad object id: %s", hex);
631                 return 1;
632         }
633 -       if (!lookup_commit_reference(oid.hash)) {
634 +       if (!lookup_commit_reference(&oid)) {
635                 cgit_print_error_page(400, "Bad request",
636                                 "Not a commit reference: %s", hex);
637                 return 1;
638 diff --git a/ui-tag.c b/ui-tag.c
639 index afd7d61..909cde0 100644
640 --- ui-tag.c
641 +++ ui-tag.c
642 @@ -54,7 +54,7 @@ void cgit_print_tag(char *revname)
643                         "Bad tag reference: %s", revname);
644                 goto cleanup;
645         }
646 -       obj = parse_object(oid.hash);
647 +       obj = parse_object(&oid);
648         if (!obj) {
649                 cgit_print_error_page(500, "Internal server error",
650                         "Bad object id: %s", oid_to_hex(&oid));
651 @@ -64,7 +64,7 @@ void cgit_print_tag(char *revname)
652                 struct tag *tag;
653                 struct taginfo *info;
654  
655 -               tag = lookup_tag(oid.hash);
656 +               tag = lookup_tag(&oid);
657                 if (!tag || parse_tag(tag) || !(info = cgit_parse_tag(tag))) {
658                         cgit_print_error_page(500, "Internal server error",
659                                 "Bad tag object: %s", revname);
660 diff --git a/ui-tree.c b/ui-tree.c
661 index b310242..ca24a03 100644
662 --- ui-tree.c
663 +++ ui-tree.c
664 @@ -157,7 +157,7 @@ static void print_object(const unsigned char *sha1, char *path, const char *base
665  
666  struct single_tree_ctx {
667         struct strbuf *path;
668 -       unsigned char sha1[GIT_SHA1_RAWSZ];
669 +       struct object_id oid;
670         char *name;
671         size_t count;
672  };
673 @@ -177,7 +177,7 @@ static int single_tree_cb(const unsigned char *sha1, struct strbuf *base,
674         }
675  
676         ctx->name = xstrdup(pathname);
677 -       hashcpy(ctx->sha1, sha1);
678 +       hashcpy(ctx->oid.hash, sha1);
679         strbuf_addf(ctx->path, "/%s", pathname);
680         return 0;
681  }
682 @@ -195,13 +195,13 @@ static void write_tree_link(const unsigned char *sha1, char *name,
683                 .nr = 0
684         };
685  
686 -       hashcpy(tree_ctx.sha1, sha1);
687 +       hashcpy(tree_ctx.oid.hash, sha1);
688  
689         while (tree_ctx.count == 1) {
690                 cgit_tree_link(name, NULL, "ls-dir", ctx.qry.head, rev,
691                                fullpath->buf);
692  
693 -               tree = lookup_tree(tree_ctx.sha1);
694 +               tree = lookup_tree(&tree_ctx.oid);
695                 if (!tree)
696                         return;
697  
698 @@ -300,17 +300,17 @@ static void ls_tail(void)
699         cgit_print_layout_end();
700  }
701  
702 -static void ls_tree(const unsigned char *sha1, char *path, struct walk_tree_context *walk_tree_ctx)
703 +static void ls_tree(const struct object_id *oid, char *path, struct walk_tree_context *walk_tree_ctx)
704  {
705         struct tree *tree;
706         struct pathspec paths = {
707                 .nr = 0
708         };
709  
710 -       tree = parse_tree_indirect(sha1);
711 +       tree = parse_tree_indirect(oid);
712         if (!tree) {
713                 cgit_print_error_page(404, "Not found",
714 -                       "Not a tree object: %s", sha1_to_hex(sha1));
715 +                       "Not a tree object: %s", sha1_to_hex(oid->hash));
716                 return;
717         }
718  
719 @@ -380,7 +380,7 @@ void cgit_print_tree(const char *rev, char *path)
720                         "Invalid revision name: %s", rev);
721                 return;
722         }
723 -       commit = lookup_commit_reference(oid.hash);
724 +       commit = lookup_commit_reference(&oid);
725         if (!commit || parse_commit(commit)) {
726                 cgit_print_error_page(404, "Not found",
727                         "Invalid commit reference: %s", rev);
728 @@ -390,7 +390,7 @@ void cgit_print_tree(const char *rev, char *path)
729         walk_tree_ctx.curr_rev = xstrdup(rev);
730  
731         if (path == NULL) {
732 -               ls_tree(commit->tree->object.oid.hash, NULL, &walk_tree_ctx);
733 +               ls_tree(&commit->tree->object.oid, NULL, &walk_tree_ctx);
734                 goto cleanup;
735         }
736  
737 -- 
738 cgit v1.1-9-ge9c1d
739
740
741
742 [FILE:3650:patches/patch-git-2.16]
743 From 1dd53e3a2ffec730ec27ebe15b3d63e0b417a544 Mon Sep 17 00:00:00 2001
744 From: Christian Hesse <mail@eworm.de>
745 Date: Thu, 18 Jan 2018 09:19:31 +0100
746 Subject: git: update to v2.16.0
747
748 Update to git version v2.16.0:
749
750 * refs: convert resolve_ref_unsafe to struct object_id
751   (49e61479be913f67e66bb3fdf8de9475c41b58bd)
752 * diff: remove DIFF_OPT_SET macro
753   (23dcf77f48feb49c54bad09210f093a799816334)
754 * log: add option to choose which refs to decorate
755   (65516f586b69307f977cd67cc45513a296cabc25)
756 * diff: convert flags to be stored in bitfields
757   (02f2f56bc377c287c411947d0e1482aac888f8db)
758
759 Signed-off-by: Christian Hesse <mail@eworm.de>
760 ---
761  Makefile    | 2 +-
762  cgit.c      | 2 +-
763  git         | 2 +-
764  shared.c    | 2 +-
765  ui-blame.c  | 2 +-
766  ui-commit.c | 2 +-
767  ui-diff.c   | 2 +-
768  ui-log.c    | 7 +++----
769  8 files changed, 10 insertions(+), 11 deletions(-)
770
771 diff --git a/cgit.c b/cgit.c
772 index 972a67e..a3702c2 100644
773 --- cgit.c
774 +++ cgit.c
775 @@ -478,7 +478,7 @@ static char *guess_defbranch(void)
776         const char *ref, *refname;
777         struct object_id oid;
778  
779 -       ref = resolve_ref_unsafe("HEAD", 0, oid.hash, NULL);
780 +       ref = resolve_ref_unsafe("HEAD", 0, &oid, NULL);
781         if (!ref || !skip_prefix(ref, "refs/heads/", &refname))
782                 return "master";
783         return xstrdup(refname);
784 diff --git a/shared.c b/shared.c
785 index df3f611..21ac8f4 100644
786 --- shared.c
787 +++ shared.c
788 @@ -346,7 +346,7 @@ void cgit_diff_tree(const struct object_id *old_oid,
789         opt.output_format = DIFF_FORMAT_CALLBACK;
790         opt.detect_rename = 1;
791         opt.rename_limit = ctx.cfg.renamelimit;
792 -       DIFF_OPT_SET(&opt, RECURSIVE);
793 +       opt.flags.recursive = 1;
794         if (ignorews)
795                 DIFF_XDL_SET(&opt, IGNORE_WHITESPACE);
796         opt.format_callback = cgit_diff_tree_cb;
797 diff --git a/ui-commit.c b/ui-commit.c
798 index 586fea0..abf58f6 100644
799 --- ui-commit.c
800 +++ ui-commit.c
801 @@ -41,7 +41,7 @@ void cgit_print_commit(char *hex, const char *prefix)
802  
803         format_display_notes(&oid, &notes, PAGE_ENCODING, 0);
804  
805 -       load_ref_decorations(DECORATE_FULL_REFS);
806 +       load_ref_decorations(NULL, DECORATE_FULL_REFS);
807  
808         cgit_print_layout_start();
809         cgit_print_diff_ctrls();
810 diff --git a/ui-diff.c b/ui-diff.c
811 index c7fb49b..a10ce8a 100644
812 --- ui-diff.c
813 +++ ui-diff.c
814 @@ -444,7 +444,7 @@ void cgit_print_diff(const char *new_rev, const char *old_rev,
815  
816                 diff_setup(&diffopt);
817                 diffopt.output_format = DIFF_FORMAT_PATCH;
818 -               DIFF_OPT_SET(&diffopt, RECURSIVE);
819 +               diffopt.flags.recursive = 1;
820                 diff_setup_done(&diffopt);
821  
822                 ctx.page.mimetype = "text/plain";
823 diff --git a/ui-log.c b/ui-log.c
824 index 2d2bb31..8e36fba 100644
825 --- ui-log.c
826 +++ ui-log.c
827 @@ -119,8 +119,7 @@ static int show_commit(struct commit *commit, struct rev_info *revs)
828         struct commit_list *parents = commit->parents;
829         struct commit *parent;
830         int found = 0, saved_fmt;
831 -       unsigned saved_flags = revs->diffopt.flags;
832 -
833 +       struct diff_flags saved_flags = revs->diffopt.flags;
834  
835         /* Always show if we're not in "follow" mode with a single file. */
836         if (!ctx.qry.follow)
837 @@ -149,7 +148,7 @@ static int show_commit(struct commit *commit, struct rev_info *revs)
838         add_lines = 0;
839         rem_lines = 0;
840  
841 -       DIFF_OPT_SET(&revs->diffopt, RECURSIVE);
842 +       revs->diffopt.flags.recursive = 1;
843         diff_tree_oid(&parent->tree->object.oid,
844                       &commit->tree->object.oid,
845                       "", &revs->diffopt);
846 @@ -434,7 +433,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
847         rev.ignore_missing = 1;
848         rev.simplify_history = 1;
849         setup_revisions(rev_argv.argc, rev_argv.argv, &rev, NULL);
850 -       load_ref_decorations(DECORATE_FULL_REFS);
851 +       load_ref_decorations(NULL, DECORATE_FULL_REFS);
852         rev.show_decorations = 1;
853         rev.grep_filter.ignore_case = 1;
854  
855 -- 
856 cgit v1.1-35-ge94e
857
858
859
860 [FILE:421:patches/patch-ui-snapshot.c]
861 --- ui-snapshot.c.orig  2016-12-01 13:52:53 UTC
862 +++ ui-snapshot.c
863 @@ -37,7 +37,7 @@ static int write_archive_type(const char
864         /* argv_array guarantees a trailing NULL entry. */
865         memcpy(nargv, argv.argv, sizeof(char *) * (argv.argc + 1));
866  
867 -       result = write_archive(argv.argc, nargv, NULL, 1, NULL, 0);
868 +       result = write_archive(argv.argc, nargv, NULL, NULL, 0);
869         argv_array_clear(&argv);
870         free(nargv);
871         return result;
872