diff options
author | Vincent Ambo <mail@tazj.in> | 2021-09-21T10·03+0300 |
---|---|---|
committer | Vincent Ambo <mail@tazj.in> | 2021-09-21T11·29+0300 |
commit | 43b1791ec601732ac31195df96781a848360a9ac (patch) | |
tree | daae8d638343295d2f1f7da955e556ef4c958864 /third_party/git/builtin/fmt-merge-msg.c | |
parent | 2d8e7dc9d9c38127ec4ebd13aee8e8f586a43318 (diff) |
chore(3p/git): Unvendor git and track patches instead r/2903
This was vendored a long time ago under the expectation that keeping it in sync with cgit would be easier this way, but it has proven not to be a big issue. On the other hand, a vendored copy of git is an annoying maintenance burden. It is much easier to rebase the single (dottime) patch that we have. This removes the vendored copy of git and instead passes the git source code to cgit via `pkgs.srcOnly`, which includes the applied patch so that cgit can continue rendering dottime. Change-Id: If31f62dea7ce688fd1b9050204e9378019775f2b
Diffstat (limited to 'third_party/git/builtin/fmt-merge-msg.c')
-rw-r--r-- | third_party/git/builtin/fmt-merge-msg.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/third_party/git/builtin/fmt-merge-msg.c b/third_party/git/builtin/fmt-merge-msg.c deleted file mode 100644 index 48a8699de728..000000000000 --- a/third_party/git/builtin/fmt-merge-msg.c +++ /dev/null @@ -1,65 +0,0 @@ -#include "builtin.h" -#include "config.h" -#include "fmt-merge-msg.h" -#include "parse-options.h" - -static const char * const fmt_merge_msg_usage[] = { - N_("git fmt-merge-msg [-m <message>] [--log[=<n>] | --no-log] [--file <file>]"), - NULL -}; - -int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix) -{ - const char *inpath = NULL; - const char *message = NULL; - int shortlog_len = -1; - struct option options[] = { - { OPTION_INTEGER, 0, "log", &shortlog_len, N_("n"), - N_("populate log with at most <n> entries from shortlog"), - PARSE_OPT_OPTARG, NULL, DEFAULT_MERGE_LOG_LEN }, - { OPTION_INTEGER, 0, "summary", &shortlog_len, N_("n"), - N_("alias for --log (deprecated)"), - PARSE_OPT_OPTARG | PARSE_OPT_HIDDEN, NULL, - DEFAULT_MERGE_LOG_LEN }, - OPT_STRING('m', "message", &message, N_("text"), - N_("use <text> as start of message")), - OPT_FILENAME('F', "file", &inpath, N_("file to read from")), - OPT_END() - }; - - FILE *in = stdin; - struct strbuf input = STRBUF_INIT, output = STRBUF_INIT; - int ret; - struct fmt_merge_msg_opts opts; - - git_config(fmt_merge_msg_config, NULL); - argc = parse_options(argc, argv, prefix, options, fmt_merge_msg_usage, - 0); - if (argc > 0) - usage_with_options(fmt_merge_msg_usage, options); - if (shortlog_len < 0) - shortlog_len = (merge_log_config > 0) ? merge_log_config : 0; - - if (inpath && strcmp(inpath, "-")) { - in = fopen(inpath, "r"); - if (!in) - die_errno("cannot open '%s'", inpath); - } - - if (strbuf_read(&input, fileno(in), 0) < 0) - die_errno("could not read input file"); - - if (message) - strbuf_addstr(&output, message); - - memset(&opts, 0, sizeof(opts)); - opts.add_title = !message; - opts.credit_people = 1; - opts.shortlog_len = shortlog_len; - - ret = fmt_merge_msg(&input, &output, &opts); - if (ret) - return ret; - write_in_full(STDOUT_FILENO, output.buf, output.len); - return 0; -} |