X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=Documentation%2Fgit-rev-parse.txt;h=8b95df0c6e2a147cd89fdb20605896852085cbc5;hb=8f5ff31f8e74ac2f72c3c415beb2639bc36f7cb7;hp=099db294f4316fc39b451e2f54f9736bce9baf3b;hpb=4ae22d96fe9248dac4f26b1fc91154ba5e879799;p=git.git diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt index 099db294..8b95df0c 100644 --- a/Documentation/git-rev-parse.txt +++ b/Documentation/git-rev-parse.txt @@ -3,7 +3,7 @@ git-rev-parse(1) NAME ---- -git-rev-parse - Pick out and massage parameters. +git-rev-parse - Pick out and massage parameters SYNOPSIS @@ -68,10 +68,31 @@ OPTIONS Show all refs found in `$GIT_DIR/refs`. --show-prefix:: - When the command is invoked from a directory show the + When the command is invoked from a subdirectory, show the path of the current directory relative to the top-level directory. +--show-cdup:: + When the command is invoked from a subdirectory, show the + path of the top-level directory relative to the current + directory (typically a sequence of "../", or an empty string). + +--git-dir:: + Show `$GIT_DIR` if defined else show the path to the .git directory. + +--short, --short=number:: + Instead of outputting the full SHA1 values of object names try to + abbriviate them to a shorter unique name. When no length is specified + 7 is used. The minimum length is 4. + +--since=datestring, --after=datestring:: + Parses the date string, and outputs corresponding + --max-age= parameter for git-rev-list command. + +--until=datestring, --before=datestring:: + Parses the date string, and outputs corresponding + --min-age= parameter for git-rev-list command. + ...:: Flags and parameters to be parsed. @@ -124,6 +145,32 @@ which is passed to 'git-rev-list'. Two revision parameters concatenated with '..' is a short-hand for writing a range between them. I.e. 'r1..r2' is equivalent to saying '{caret}r1 r2' +Here is an illustration, by Jon Loeliger. Both node B and C are +a commit parents of commit node A. Parent commits are ordered +left-to-right. + + G H I J + \ / \ / + D E F + \ | / + \ | / + \|/ + B C + \ / + \ / + A + + A = = A^0 + B = A^ = A^1 = A~1 + C = A^2 = A^2 + D = A^^ = A^1^1 = A~2 + E = B^2 = A^^2 + F = B^3 = A^^3 + G = A^^^ = A^1^1^1 = A~3 + H = D^2 = B^^2 = A^^^2 = A~2^2 + I = F^ = B^3^ = A^^3^ + J = F^2 = B^3^2 = A^^3^2 + Author ------