]> git.ipfire.org Git - thirdparty/git.git/blame - archive.h
rebase: allow overriding the maximal length of the generated labels
[thirdparty/git.git] / archive.h
CommitLineData
4df096a5
FBH
1#ifndef ARCHIVE_H
2#define ARCHIVE_H
3
dabab1d6 4#include "object-name.h"
f3e743a0 5#include "pathspec.h"
b7b189cd 6#include "string-list.h"
f3e743a0 7
b612ee20 8struct repository;
96099726 9struct pretty_print_context;
b612ee20 10
4df096a5 11struct archiver_args {
b612ee20 12 struct repository *repo;
1c3e4129 13 char *refname;
2947a793 14 const char *prefix;
4df096a5 15 const char *base;
d53fe818 16 size_t baselen;
4df096a5 17 struct tree *tree;
bbf05cf7 18 const struct object_id *commit_oid;
8460b2fc 19 const struct commit *commit;
fd2da4b1 20 const char *mtime_option;
dddbad72 21 timestamp_t time;
f3e743a0 22 struct pathspec pathspec;
e0ffb248 23 unsigned int verbose : 1;
ba053ea9 24 unsigned int worktree_attributes : 1;
9cb513b7 25 unsigned int convert : 1;
3a176c6c 26 int compression_level;
2947a793 27 struct string_list extra_files;
96099726 28 struct pretty_print_context *pretty_ctx;
4df096a5
FBH
29};
30
b612ee20
NTND
31/* main api */
32
55454427 33int write_archive(int argc, const char **argv, const char *prefix,
ad6dad09
DL
34 struct repository *repo,
35 const char *name_hint, int remote);
b612ee20
NTND
36
37const char *archive_format_from_filename(const char *filename);
38
39/* archive backend stuff */
40
13e0f88d 41#define ARCHIVER_WANT_COMPRESSION_LEVELS 1
7b97730b 42#define ARCHIVER_REMOTE 2
cde8ea9c 43#define ARCHIVER_HIGH_COMPRESSION_LEVELS 4
13e0f88d
JK
44struct archiver {
45 const char *name;
4d7c9898 46 int (*write_archive)(const struct archiver *, struct archiver_args *);
13e0f88d 47 unsigned flags;
96b9e515 48 char *filter_command;
13e0f88d 49};
55454427 50void register_archiver(struct archiver *);
4df096a5 51
55454427
DL
52void init_tar_archiver(void);
53void init_zip_archiver(void);
54void init_archivers(void);
562e25ab 55
9cb513b7 56typedef int (*write_archive_entry_fn_t)(struct archiver_args *args,
015ff4f8 57 const struct object_id *oid,
9cb513b7 58 const char *path, size_t pathlen,
200589ab
RS
59 unsigned int mode,
60 void *buffer, unsigned long size);
4df096a5 61
55454427 62int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry);
562e25ab 63
4df096a5 64#endif /* ARCHIVE_H */