.\"Generated by db2man.xsl. Don't modify this, modify the source. .de Sh \" Subsection .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Ip \" List item .br .ie \\n(.$>=3 .ne \\$3 .el .ne 3 .IP "\\$1" \\$2 .. .TH "GIT-REV-PARSE" 1 "" "" "" .SH NAME git-rev-parse \- Pick out and massage parameters. .SH "SYNOPSIS" git\-rev\-parse [ \-\-option ] ... .SH "DESCRIPTION" Many git Porcelainish commands take mixture of flags (i\&.e\&. parameters that begin with a dash \-) and parameters meant for underlying git\-rev\-list command they use internally and flags and parameters for other commands they use as the downstream of git\-rev\-list\&. This command is used to distinguish between them\&. .SH "OPTIONS" .TP \-\-revs\-only Do not output flags and parameters not meant for git\-rev\-list command\&. .TP \-\-no\-revs Do not output flags and parameters meant for git\-rev\-list command\&. .TP \-\-flags Do not output non\-flag parameters\&. .TP \-\-no\-flags Do not output flag parameters\&. .TP \-\-default If there is no parameter given by the user, use instead\&. .TP \-\-verify The parameter given must be usable as a single, valid object name\&. Otherwise barf and abort\&. .TP \-\-sq Usually the output is made one line per flag and parameter\&. This option makes output a single line, properly quoted for consumption by shell\&. Useful when you expect your parameter to contain whitespaces and newlines (e\&.g\&. when using pickaxe \-S with git\-diff\-*)\&. .TP \-\-not When showing object names, prefix them with ^ and strip ^ prefix from the object names that already have one\&. .TP \-\-symbolic Usually the object names are output in SHA1 form (with possible ^ prefix); this option makes them output in a form as close to the original input as possible\&. .TP \-\-all Show all refs found in $GIT_DIR/refs\&. .TP \-\-show\-prefix When the command is invoked from a subdirectory, show the path of the current directory relative to the top\-level directory\&. .TP \-\-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)\&. .TP \-\-since=datestring, \-\-after=datestring Parses the date string, and outputs corresponding \-\-max\-age= parameter for git\-rev\-list command\&. .TP \-\-until=datestring, \-\-before=datestring Parses the date string, and outputs corresponding \-\-min\-age= parameter for git\-rev\-list command\&. .TP ... Flags and parameters to be parsed\&. .SH "SPECIFYING REVISIONS" A revision parameter typically, but not necessarily, names a commit object\&. They use what is called an extended SHA1 syntax\&. .TP 3 \(bu The full SHA1 object name (40\-byte hexadecimal string), or a substring of such that is unique within the repository\&. E\&.g\&. dae86e1950b1277e545cee180551750029cfe735 and dae86e both name the same commit object if there are no other object in your repository whose object name starts with dae86e\&. .TP \(bu A symbolic ref name\&. E\&.g\&. master typically means the commit object referenced by $GIT_DIR/refs/heads/master\&. If you happen to have both heads/master and tags/master, you can explicitly say heads/master to tell git which one you mean\&. .TP \(bu A suffix ^ to a revision parameter means the first parent of that commit object\&. ^ means the th parent (i\&.e\&. rev^ is equivalent to rev^1)\&. As a special rule, rev^0 means the commit itself and is used when rev is the object name of a tag object that refers to a commit object\&. .TP \(bu A suffix ~ to a revision parameter means the commit object that is the th generation grand\-parent of the named commit object, following only the first parent\&. I\&.e\&. rev~3 is equivalent to rev^^^ which is equivalent to rev^1^1^1\&. .TP \(bu A suffix ^ followed by an object type name enclosed in brace pair (e\&.g\&. v0\&.99\&.8^{commit}) means the object could be a tag, and dereference the tag recursively until an object of that type is found or the object cannot be dereferenced anymore (in which case, barf)\&. rev^0 introduced earlier is a short\-hand for rev^{commit}\&. .TP \(bu A suffix ^ followed by an empty brace pair (e\&.g\&. v0\&.99\&.8^{}) means the object could be a tag, and dereference the tag recursively until a non\-tag object is found\&. .LP git\-rev\-parse also accepts a prefix ^ to revision parameter, 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 ^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\&. .nf G H I J \\ / \\ / D E F \\ | / \\ | / \\|/ B C \\ / \\ / A .fi .nf 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 .fi .SH "AUTHOR" Written by Linus Torvalds and Junio C Hamano .SH "DOCUMENTATION" Documentation by Junio C Hamano and the git\-list \&. .SH "GIT" Part of the \fBgit\fR(7) suite