blob: b9122bc5f497ea2030aa4d5348c44da1a3bd8995 [file] [log] [blame]
Linus Torvalds70827b12006-04-21 10:27:34 -07001#ifndef BUILTIN_H
2#define BUILTIN_H
3
Junio C Hamanod0c24492006-09-15 22:47:21 -07004#include "git-compat-util.h"
Miklos Vajna0b9a9692008-06-27 18:21:59 +02005#include "strbuf.h"
Miklos Vajna7b9c0a62008-07-01 04:37:49 +02006#include "cache.h"
7#include "commit.h"
Linus Torvalds70827b12006-04-21 10:27:34 -07008
Ramkumar Ramachandra18761662010-09-08 23:29:53 +05309#define DEFAULT_MERGE_LOG_LEN 20
10
Ramsay Allan Jones822a7d52006-07-30 22:42:25 +010011extern const char git_usage_string[];
Teemu Likonenb7d96812008-06-06 00:15:36 +030012extern const char git_more_info_string[];
Linus Torvalds70827b12006-04-21 10:27:34 -070013
Nguyễn Thái Ngọc Duyaf0b4a32013-05-27 18:18:47 +070014#define PRUNE_PACKED_DRY_RUN 01
15#define PRUNE_PACKED_VERBOSE 02
16
J. Bruce Fields2eb53e62006-10-22 19:01:23 -040017extern void prune_packed_objects(int);
Junio C Hamanocbda1212011-11-04 17:35:42 -070018
19struct fmt_merge_msg_opts {
Junio C Hamano9bcbb1c2012-12-28 15:29:31 -080020 unsigned add_title:1,
21 credit_people:1;
Junio C Hamanocbda1212011-11-04 17:35:42 -070022 int shortlog_len;
23};
24
Ramkumar Ramachandra18761662010-09-08 23:29:53 +053025extern int fmt_merge_msg(struct strbuf *in, struct strbuf *out,
Junio C Hamanocbda1212011-11-04 17:35:42 -070026 struct fmt_merge_msg_opts *);
Thomas Rast6956f852010-03-12 18:04:32 +010027
brian m. carlsonacad70d2016-09-05 20:07:58 +000028extern int textconv_object(const char *path, unsigned mode, const struct object_id *oid, int oid_valid, char **buf, unsigned long *buf_size);
Clément Poulaine5fba602010-06-15 17:50:28 +020029
Sebastian Schuberthc6127fa2014-01-02 17:17:11 +010030extern int is_builtin(const char *s);
31
Junio C Hamanof754fa92006-08-04 01:51:04 -070032extern int cmd_add(int argc, const char **argv, const char *prefix);
Paul Tan73c27792015-08-04 21:51:24 +080033extern int cmd_am(int argc, const char **argv, const char *prefix);
Ryan Andersonf789e342006-10-09 03:32:05 -070034extern int cmd_annotate(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070035extern int cmd_apply(int argc, const char **argv, const char *prefix);
Franck Bui-Huu4df096a2006-09-07 15:12:02 +020036extern int cmd_archive(int argc, const char **argv, const char *prefix);
Christian Couder1bf072e2009-03-26 05:55:54 +010037extern int cmd_bisect__helper(int argc, const char **argv, const char *prefix);
Junio C Hamanoacca6872006-11-08 18:47:54 -080038extern int cmd_blame(int argc, const char **argv, const char *prefix);
Lars Hjemlic31820c2006-10-23 23:27:45 +020039extern int cmd_branch(int argc, const char **argv, const char *prefix);
Johannes Schindelin2e0afaf2007-02-22 01:59:14 +010040extern int cmd_bundle(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070041extern int cmd_cat_file(int argc, const char **argv, const char *prefix);
Daniel Barkalow782c2d62008-02-07 11:40:23 -050042extern int cmd_checkout(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070043extern int cmd_checkout_index(int argc, const char **argv, const char *prefix);
Junio C Hamanod0bfd022007-04-12 01:07:32 -070044extern int cmd_check_attr(int argc, const char **argv, const char *prefix);
Adam Spiers368aa522013-01-06 16:58:13 +000045extern int cmd_check_ignore(int argc, const char **argv, const char *prefix);
Eric Sunshine226ad342013-07-12 20:53:10 -040046extern int cmd_check_mailmap(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070047extern int cmd_check_ref_format(int argc, const char **argv, const char *prefix);
Rene Scharfee8276332006-10-24 01:01:57 +020048extern int cmd_cherry(int argc, const char **argv, const char *prefix);
Johannes Schindelin9509af62007-03-01 05:26:30 +010049extern int cmd_cherry_pick(int argc, const char **argv, const char *prefix);
Daniel Barkalow8434c2f2008-04-27 13:39:30 -040050extern int cmd_clone(int argc, const char **argv, const char *prefix);
Shawn Bohrer113f10f2007-11-11 19:48:47 -060051extern int cmd_clean(int argc, const char **argv, const char *prefix);
Nguyễn Thái Ngọc Duy7e29b822012-04-21 11:44:32 +070052extern int cmd_column(int argc, const char **argv, const char *prefix);
Kristian Høgsbergf5bbc322007-11-08 11:59:00 -050053extern int cmd_commit(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070054extern int cmd_commit_tree(int argc, const char **argv, const char *prefix);
René Scharfe6390c902011-02-12 14:24:10 +010055extern int cmd_config(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070056extern int cmd_count_objects(int argc, const char **argv, const char *prefix);
Javier Roucher Iglesiase30b2fe2012-06-24 13:39:59 +020057extern int cmd_credential(int argc, const char **argv, const char *prefix);
Shawn O. Pearce9a0eaf82007-01-10 06:36:36 -050058extern int cmd_describe(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070059extern int cmd_diff_files(int argc, const char **argv, const char *prefix);
60extern int cmd_diff_index(int argc, const char **argv, const char *prefix);
61extern int cmd_diff(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070062extern int cmd_diff_tree(int argc, const char **argv, const char *prefix);
Johannes Schindelinf2dc8492007-12-02 14:14:13 +000063extern int cmd_fast_export(int argc, const char **argv, const char *prefix);
Daniel Barkalowb888d612007-09-10 23:03:25 -040064extern int cmd_fetch(int argc, const char **argv, const char *prefix);
Daniel Barkalow2d4177c2007-09-10 23:03:00 -040065extern int cmd_fetch_pack(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070066extern int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix);
Junio C Hamano9f613dd2006-09-15 13:30:02 -070067extern int cmd_for_each_ref(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070068extern int cmd_format_patch(int argc, const char **argv, const char *prefix);
Mark Woodingb4dfefe2007-01-29 15:48:06 +000069extern int cmd_fsck(int argc, const char **argv, const char *prefix);
James Bowes6757ada2007-03-13 21:58:22 -040070extern int cmd_gc(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070071extern int cmd_get_tar_commit_id(int argc, const char **argv, const char *prefix);
72extern int cmd_grep(int argc, const char **argv, const char *prefix);
Linus Torvaldsb28a1ce2010-01-21 19:50:11 -080073extern int cmd_hash_object(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070074extern int cmd_help(int argc, const char **argv, const char *prefix);
Linus Torvalds3bb72562010-01-22 07:55:19 -080075extern int cmd_index_pack(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070076extern int cmd_init_db(int argc, const char **argv, const char *prefix);
Christian Couder6634f052014-10-13 20:16:29 +020077extern int cmd_interpret_trailers(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070078extern int cmd_log(int argc, const char **argv, const char *prefix);
Linus Torvaldscf39f542007-02-08 09:51:56 -080079extern int cmd_log_reflog(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070080extern int cmd_ls_files(int argc, const char **argv, const char *prefix);
81extern int cmd_ls_tree(int argc, const char **argv, const char *prefix);
Daniel Barkalow8951d7c2007-11-04 15:51:17 -050082extern int cmd_ls_remote(int argc, const char **argv, const char *prefix);
Linus Torvaldsa633fca2006-07-28 22:44:25 -070083extern int cmd_mailinfo(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070084extern int cmd_mailsplit(int argc, const char **argv, const char *prefix);
Miklos Vajna1c7b76b2008-07-07 19:24:20 +020085extern int cmd_merge(int argc, const char **argv, const char *prefix);
Junio C Hamano71dfbf22007-01-09 00:50:02 -080086extern int cmd_merge_base(int argc, const char **argv, const char *prefix);
Linus Torvalds0ecace72010-01-22 07:29:21 -080087extern int cmd_merge_index(int argc, const char **argv, const char *prefix);
Thomas Harninga00a42a2007-11-22 15:19:40 -050088extern int cmd_merge_ours(int argc, const char **argv, const char *prefix);
Johannes Schindelinba1f5f32006-12-06 16:26:06 +010089extern int cmd_merge_file(int argc, const char **argv, const char *prefix);
Daniel Barkalowe1b3a2c2008-02-07 11:40:05 -050090extern int cmd_merge_recursive(int argc, const char **argv, const char *prefix);
Linus Torvalds907a7cb2010-01-21 18:25:20 -080091extern int cmd_merge_tree(int argc, const char **argv, const char *prefix);
Linus Torvalds112dd512010-01-22 07:34:44 -080092extern int cmd_mktag(int argc, const char **argv, const char *prefix);
Junio C Hamano633e3552009-05-10 10:28:18 -070093extern int cmd_mktree(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070094extern int cmd_mv(int argc, const char **argv, const char *prefix);
95extern int cmd_name_rev(int argc, const char **argv, const char *prefix);
Johan Herlandcd067d32010-02-13 22:28:20 +010096extern int cmd_notes(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -070097extern int cmd_pack_objects(int argc, const char **argv, const char *prefix);
Linus Torvalds377d0272010-01-22 07:42:14 -080098extern int cmd_pack_redundant(int argc, const char **argv, const char *prefix);
Linus Torvaldsdedc0ec2010-01-21 20:31:25 -080099extern int cmd_patch_id(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -0700100extern int cmd_prune(int argc, const char **argv, const char *prefix);
101extern int cmd_prune_packed(int argc, const char **argv, const char *prefix);
Paul Tan1e1ea692015-06-14 16:41:51 +0800102extern int cmd_pull(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -0700103extern int cmd_push(int argc, const char **argv, const char *prefix);
104extern int cmd_read_tree(int argc, const char **argv, const char *prefix);
Junio C Hamanobe5908a2008-09-09 01:27:08 -0700105extern int cmd_receive_pack(int argc, const char **argv, const char *prefix);
Junio C Hamano4264dc12006-12-19 00:23:12 -0800106extern int cmd_reflog(int argc, const char **argv, const char *prefix);
Johannes Schindelin211c8962008-02-29 01:45:45 +0000107extern int cmd_remote(int argc, const char **argv, const char *prefix);
Ilari Liusvaara7f3eceb2010-10-12 19:39:43 +0300108extern int cmd_remote_ext(int argc, const char **argv, const char *prefix);
Ilari Liusvaara3a9ed4b2010-10-12 19:39:42 +0300109extern int cmd_remote_fd(int argc, const char **argv, const char *prefix);
Stefan Bellera1bbc6c2013-09-15 17:33:20 +0200110extern int cmd_repack(int argc, const char **argv, const char *prefix);
Johannes Schindelin658f3652006-12-20 17:39:41 +0100111extern int cmd_rerere(int argc, const char **argv, const char *prefix);
Carlos Rica0e5a7fa2007-09-11 05:19:34 +0200112extern int cmd_reset(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -0700113extern int cmd_rev_list(int argc, const char **argv, const char *prefix);
114extern int cmd_rev_parse(int argc, const char **argv, const char *prefix);
Johannes Schindelin9509af62007-03-01 05:26:30 +0100115extern int cmd_revert(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -0700116extern int cmd_rm(int argc, const char **argv, const char *prefix);
Daniel Barkalow96249c02007-10-29 22:03:39 -0400117extern int cmd_send_pack(int argc, const char **argv, const char *prefix);
Johannes Schindelinb8ec5922006-10-22 13:23:31 +0200118extern int cmd_shortlog(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -0700119extern int cmd_show(int argc, const char **argv, const char *prefix);
Junio C Hamano9f613dd2006-09-15 13:30:02 -0700120extern int cmd_show_branch(int argc, const char **argv, const char *prefix);
Kristian Høgsbergf5bbc322007-11-08 11:59:00 -0500121extern int cmd_status(int argc, const char **argv, const char *prefix);
Linus Torvaldsa633fca2006-07-28 22:44:25 -0700122extern int cmd_stripspace(int argc, const char **argv, const char *prefix);
Stefan Beller74703a12015-09-02 14:42:24 -0700123extern int cmd_submodule__helper(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -0700124extern int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);
Carlos Rica62e09ce2007-07-20 01:42:28 +0200125extern int cmd_tag(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -0700126extern int cmd_tar_tree(int argc, const char **argv, const char *prefix);
Linus Torvaldsb5325812010-01-22 07:38:03 -0800127extern int cmd_unpack_file(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -0700128extern int cmd_unpack_objects(int argc, const char **argv, const char *prefix);
129extern int cmd_update_index(int argc, const char **argv, const char *prefix);
130extern int cmd_update_ref(int argc, const char **argv, const char *prefix);
René Scharfe53a11162009-08-29 11:04:52 +0200131extern int cmd_update_server_info(int argc, const char **argv, const char *prefix);
Franck Bui-Huu39345a22006-09-07 15:12:05 +0200132extern int cmd_upload_archive(int argc, const char **argv, const char *prefix);
Jeff King1bc01ef2011-11-19 02:40:04 -0500133extern int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix);
Linus Torvalds55b67452010-01-21 20:21:55 -0800134extern int cmd_var(int argc, const char **argv, const char *prefix);
Michael J Gruberd07b00b2014-06-23 09:05:49 +0200135extern int cmd_verify_commit(int argc, const char **argv, const char *prefix);
Carlos Rica2ae68fc2007-07-27 06:07:34 +0200136extern int cmd_verify_tag(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -0700137extern int cmd_version(int argc, const char **argv, const char *prefix);
138extern int cmd_whatchanged(int argc, const char **argv, const char *prefix);
Nguyễn Thái Ngọc Duydf0b6cf2015-06-29 19:51:18 +0700139extern int cmd_worktree(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -0700140extern int cmd_write_tree(int argc, const char **argv, const char *prefix);
Rene Scharfe2e3ed672006-08-10 17:02:38 +0200141extern int cmd_verify_pack(int argc, const char **argv, const char *prefix);
Linus Torvalds358ddb62006-09-15 11:19:32 -0700142extern int cmd_show_ref(int argc, const char **argv, const char *prefix);
Linus Torvaldse1e22e32006-09-11 16:37:32 -0700143extern int cmd_pack_refs(int argc, const char **argv, const char *prefix);
Christian Couder54b0c1e2009-02-02 06:12:44 +0100144extern int cmd_replace(int argc, const char **argv, const char *prefix);
Junio C Hamanof754fa92006-08-04 01:51:04 -0700145
Linus Torvalds70827b12006-04-21 10:27:34 -0700146#endif