summaryrefslogtreecommitdiffstats
path: root/git_part.h
blob: e16b02ec269b0c13319169bdb6f8c72a532d28ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef VOLGIT_GIT_PART_H
#define VOLGIT_GIT_PART_H VOLGIT_GIT_PART_H
#include <stdio.h>
#include <git2.h>
#include <system_part.h>

struct Index_File
{
	FILE *out;
	
	/*these are used in treelike output*/
	_Bool branches[MAX_CUTOFF];
	/*
	 offsets between different branches, if the dir name is long this prevents
	 skewed branches below
	 */
	int offset[MAX_CUTOFF];
	int indentation;
};

struct Index_File *get_index_file(int dir_fd,const char *name);
void release_index_file(struct Index_File *index);

int print_diff_line(const git_diff_delta *delta,const git_diff_hunk *hunk,const git_diff_line *line,FILE *out);
void print_diff(FILE *out,git_tree *parent_tree,git_tree *current_tree,git_repository *repo);
void print_headers_and_commit_message(FILE *where,git_commit *current_commit,const git_oid *current,_Bool has_diff);
void print_commits(int dir_fd,const git_reference *branch, git_repository *repo);
void print_commit(git_commit *current_commit,git_commit *parent_commit,FILE *log_file,int diff_directory_fd,git_repository *repo);
void print_files_top(int dir_fd,git_commit *top_commit,git_repository *repo);
void print_files(struct Index_File *index_file,int dir_fd,git_tree *tree,git_repository *repo);
int print_entry(struct Index_File *index_file,const git_tree_entry *entry,int base_dir_fd,git_repository *repo);
static inline void print_tree_entry(struct Index_File *index_file,const char *name,git_object *obj,int base_dir_fd,git_repository *repo);
static inline void print_blob_entry(struct Index_File *index_file,const char *name,git_object *obj,int base_dir_fd,git_repository *repo);

void print_branches(git_repository *repo);

void print_indentation_for_treelike_output(struct Index_File *out);

void increment_indentation(struct Index_File *index,const char *name);
void decrement_indentation(struct Index_File *index);
void indentation_set_is_not_final(struct Index_File *index,_Bool is_final);
void print_files_in_another_index(int base_dir_fd,const char *entry_oid,const char *name,git_tree *tree,git_repository *repo);

#endif