Print submodule revision next to submodule link
Update git to v1.7.5.4

Some changes to diff options:

- no_merges has become the more general max_parents
- path restriction now uses struct pathspec

Signed-off-by: John Keeping <john@keeping.me.uk>
Update git to v1.7.6.5

struct pathspec is now used in more places.

Signed-off-by: John Keeping <john@keeping.me.uk>
Update git to v1.7.7.7

This release changes the archive interface so that we now need to pass
argv into write_archive().

Signed-off-by: John Keeping <john@keeping.me.uk>
Update git to v1.7.8.6

No changes required.

Signed-off-by: John Keeping <john@keeping.me.uk>
Update git to v1.7.9.7

resolve_ref() is renamed to resolve_ref_unsafe().  CGit's usage is safe.

Signed-off-by: John Keeping <john@keeping.me.uk>
Update git to v1.7.12.4

No changes needed.

Signed-off-by: John Keeping <john@keeping.me.uk>
Fix several whitespace errors

* Remove whitespace at the end of lines.
* Replace space indentation by tabs.
* Add whitespace before/after several operators ("+", "-", "*", ...)
* Add whitespace to assignments ("foo = bar;").
* Fix whitespace in parameter lists ("foobar(foo, bar, 42)").

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
White space around control verbs.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
ui-snapshot.c: Fill argv[0] with dummy.

parse_archive_args does not pass PARSE_OPT_KEEP_ARGV0 to parse_args,
which means the first argument will be discarded, as though it were a
function being called from the command-line. Thus, we fill argv[0] with
a dummy argument to prevent this from happening.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
ui-blob.c: Use a context structure in walk_tree()

Do not misuse global variables to save the context. Instead, use the
context pointer which was designed to share information between a
read_tree_fn and the caller.

This also prevents from potential misuse of the global pointers
match_path and matched_sha1 after the referenced values have been
overwritten on the stack.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
ui-plain.c: Do not access match variable in print_*()

Move all code setting the match variable to walk_tree().

This allows for easily moving this variable into a context structure
without having to pass the context to print_*().

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
ui-plain.c: Use a context structure in walk_tree()

Do not misuse global variables to save the context. Instead, use the
context pointer which was designed to share information between a
read_tree_fn and the caller.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
ui-tree.c: Pass current revision to print_object()

No longer access the global curr_rev variable in print_object().

This will make it easier to squash the curr_rev variable into a context
structure without having to pass the context to the print_object()
function.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
ui-tree.c: Declare the state variable globally

This allows for removing the header variable in a following patch. We
can use the state variable to check whether the tail needs to be printed
instead.

Note that the state variable will be moved into a context structure
later.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
ui-tree.c: Drop the header variable

Instead, use the value of the state variable to determine whether the
footer needs to be drawn.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
ui-tree.c: Use a context structure in walk_tree()

Use the context pointer to pass context information instead of misusing
global variables, as we already did in "ui-blob.c" and in "ui-plain.c".

In addition to the fixes to walk_tree(), pass the same structure to
ls_tree() and ls_item() which is read_tree_recursive()-based as well.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
cgit.c: Remove parameter from guess_defbranch()

We use resolve_ref() since commit 8d7c2ec2, so this is no longer needed.

Signed-off-by: Lukas Fleischer <cgit@cryptocrack.de>
Makefile: improve dependency generation

Makefile target generation would always be included for any makefile
target that was not clean.  Only care to include the '.deps' directory
when building cgit, rather than generating and including dependencies
when calling other makefile targets.

Heavily borrowed from git's Makefile, but without definitions to test
for the compiler's header dependency feature.  Previous Makefile
implementation never checked for this compiler feature anyway.

  - Removed makecmdgoal 'clean' check
  - Grouped like .PHONY target definitions
  - Place build dependency targets under .SUFFIXES
  - Re-arranged location of library inclusion definitions

Signed-off-by: Jamie Couture <jamie.couture@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>