diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-05-03 15:13:31 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-05-03 15:13:31 -0700 |
commit | f4ed0af6e2762bc43de474d1fcaa2863b00268eb (patch) | |
tree | 0553a911a76184db89924518e79b978b65dccc23 /builtin/commit.c | |
parent | 9a7b0bca366d8d9b3b26f1bb1a75885780c0f0e4 (diff) | |
parent | d96e3c150f2b4508f2e7d23ce9183d5b807c2155 (diff) | |
download | git-f4ed0af6e2762bc43de474d1fcaa2863b00268eb.tar.gz |
Merge branch 'nd/columns'
A couple of commands learn --column option to produce columnar output.
By Nguyễn Thái Ngọc Duy (9) and Zbigniew Jędrzejewski-Szmek (1)
* nd/columns:
tag: add --column
column: support piping stdout to external git-column process
status: add --column
branch: add --column
help: reuse print_columns() for help -a
column: add dense layout support
t9002: work around shells that are unable to set COLUMNS to 1
column: add columnar layout
Stop starting pager recursively
Add column layout skeleton and git-column
Diffstat (limited to 'builtin/commit.c')
-rw-r--r-- | builtin/commit.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 01780293aa..a876a73e6b 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -27,6 +27,7 @@ #include "quote.h" #include "submodule.h" #include "gpg-interface.h" +#include "column.h" static const char * const builtin_commit_usage[] = { "git commit [options] [--] <filepattern>...", @@ -88,6 +89,7 @@ static int quiet, verbose, no_verify, allow_empty, dry_run, renew_authorship; static int no_post_rewrite, allow_empty_message; static char *untracked_files_arg, *force_date, *ignore_submodule_arg; static char *sign_commit; +static unsigned int colopts; /* * The default commit message cleanup mode will remove the lines @@ -1173,6 +1175,8 @@ static int git_status_config(const char *k, const char *v, void *cb) { struct wt_status *s = cb; + if (!prefixcmp(k, "column.")) + return git_column_config(k, v, "status", &colopts); if (!strcmp(k, "status.submodulesummary")) { int is_bool; s->submodule_summary = git_config_bool_or_int(k, v, &is_bool); @@ -1238,6 +1242,7 @@ int cmd_status(int argc, const char **argv, const char *prefix) { OPTION_STRING, 0, "ignore-submodules", &ignore_submodule_arg, "when", "ignore changes to submodules, optional when: all, dirty, untracked. (Default: all)", PARSE_OPT_OPTARG, NULL, (intptr_t)"all" }, + OPT_COLUMN(0, "column", &colopts, "list untracked files in columns"), OPT_END(), }; @@ -1251,6 +1256,8 @@ int cmd_status(int argc, const char **argv, const char *prefix) argc = parse_options(argc, argv, prefix, builtin_status_options, builtin_status_usage, 0); + finalize_colopts(&colopts, -1); + s.colopts = colopts; if (null_termination && status_format == STATUS_FORMAT_LONG) status_format = STATUS_FORMAT_PORCELAIN; |