diff options
author | Will Palmer <wmpalmer@gmail.com> | 2010-05-02 12:00:44 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-05-03 09:40:32 -0700 |
commit | 8028184eecf1051e4b39b308a3ad909eed1371c4 (patch) | |
tree | 4059b0e1400306fd2b5e0d1f0ced91a65ea7061b /Documentation | |
parent | 2d7671ef43946cdfce140e6e9c3ca1eeea361676 (diff) | |
download | git-8028184eecf1051e4b39b308a3ad909eed1371c4.tar.gz |
pretty: add aliases for pretty formats
previously the only ways to alias a --pretty format within git were
either to set the format as your default format (via the format.pretty
configuration variable), or by using a regular git alias. This left the
definition of more complicated formats to the realm of "builtin or
nothing", with user-defined formats usually being reserved for quick
one-offs.
Here we allow user-defined formats to enjoy more or less the same
benefits of builtins. By defining pretty.myalias, "myalias" can be
used in place of whatever would normally come after --pretty=. This
can be a format:, tformat:, raw (ie, defaulting to tformat), or the name
of another builtin or user-defined pretty format.
Signed-off-by: Will Palmer <wmpalmer@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/config.txt | 10 | ||||
-rw-r--r-- | Documentation/pretty-formats.txt | 7 |
2 files changed, 16 insertions, 1 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index 92f851e797..b41f39de7c 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1466,6 +1466,16 @@ pager.<cmd>:: it takes precedence over this option. To disable pagination for all commands, set `core.pager` or `GIT_PAGER` to `cat`. +pretty.<name>:: + Alias for a --pretty= format string, as specified in + linkgit:git-log[1]. Any aliases defined here can be used just + as the built-in pretty formats could. For example, + running `git config pretty.changelog "format:{asterisk} %H %s"` + would cause the invocation `git log --pretty=changelog` + to be equivalent to running `git log "--pretty=format:{asterisk} %H %s"`. + Note that an alias with the same name as a built-in format + will be silently ignored. + pull.octopus:: The default merge strategy to use when pulling multiple branches at once. diff --git a/Documentation/pretty-formats.txt b/Documentation/pretty-formats.txt index 1686a54d22..5e95df6ba3 100644 --- a/Documentation/pretty-formats.txt +++ b/Documentation/pretty-formats.txt @@ -11,7 +11,12 @@ have limited your view of history: for example, if you are only interested in changes related to a certain directory or file. -Here are some additional details for each format: +There are several built-in formats, and you can define +additional formats by setting a pretty.<name> +config option to either another format name, or a +'format:' string, as described below (see +linkgit:git-config[1]). Here are the details of the +built-in formats: * 'oneline' |