Re: [PATCH] Move --pretty options into Documentation/pretty-formats.txt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Riddoch <chris@xxxxxxxxxxxxxxxxxx> writes:

> This describes all the pretty-formats currently listed in the cmit_fmt
> enum in commit.h, and also briefly describes the presence and format
> of the 'Merge: ' line in some pretty formats.

Thanks.  Getting much warmer.

> @@ -0,0 +1,56 @@
> +--pretty[='<format>']::
> +
> +        Pretty-prints the details of a commit.  The default format is
> +        'medium'.  If the commit is a merge, and the pretty-format is
> +        not 'oneline', 'email' or 'raw', an additional line is
> +        inserted before the 'Author:' line.  This line begins with

> +        "Merge: " and the sha1s of each parent commit are printed,
> +        separated by spaces.  These sha1's are abbreviated to 8
> +        characters; use the --abbrev or --no-abbrev options to alter
> +        this behavior.

The default abbreviation depends on the command.  Porcelain-ish
commands default to abbreviate but plumbing commands tend to
show unabbreviated.

A few other things to note.

 - When --parents option is in effect, you will see the list of
   parent commits on "commit" line after the commit itself.

 - The list of parents shown on "Merge:" may be different from
   the true parents when the command's revision traversal is
   limited with paths parameters; they show simplified parents.
   This rule also applies to the parents on the "commit" line
   under --parents option.

 - The history simplification does not affect "parent" line of
   "--pretty=raw" format.  You can use this to find the
   simplified parents from "commit" line and the true parents
   from "parent" lines with --pretty=raw.

Here are some examples from git.git repository to illustrate
differences between various combinations.

    C=2a54323

    git diff-tree -s -m --pretty=$format $C
    git diff-tree -s -m --pretty=$format --abbrev $C
    git diff-tree -s -m --pretty=$format --abbrev --abbrev-commit $C

    git log --pretty=$format --parents -n 1 --abbrev-commit $C

    git log --pretty=$format --parents -n 1 $C
    git log --pretty=$format --parents -n 1 $C -- t/


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]