.\" ** You probably do not want to edit this file directly ** .\" It was generated using the DocBook XSL Stylesheets (version 1.69.1). .\" Instead of manually editing it, you probably should edit the DocBook XML .\" source for it and then use the DocBook XSL Stylesheets to regenerate it. .TH "GIT\-REV\-LIST" "1" "09/19/2007" "Git 1.5.3.2" "Git Manual" .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .SH "NAME" git\-rev\-list \- Lists commit objects in reverse chronological order .SH "SYNOPSIS" .sp .nf \fIgit\-rev\-list\fR [ \-\-max\-count=number ] [ \-\-skip=number ] [ \-\-max\-age=timestamp ] [ \-\-min\-age=timestamp ] [ \-\-sparse ] [ \-\-no\-merges ] [ \-\-remove\-empty ] [ \-\-full\-history ] [ \-\-not ] [ \-\-all ] [ \-\-stdin ] [ \-\-topo\-order ] [ \-\-parents ] [ \-\-timestamp ] [ \-\-left\-right ] [ \-\-cherry\-pick ] [ \-\-encoding[=] ] [ \-\-(author|committer|grep)= ] [ \-\-regexp\-ignore\-case | \\\-i ] [ \-\-extended\-regexp | \\\-E ] [ \-\-date={local|relative|default|iso|rfc|short} ] [ [\-\-objects | \-\-objects\-edge] [ \-\-unpacked ] ] [ \-\-pretty | \-\-header ] [ \-\-bisect ] [ \-\-bisect\-vars ] [ \-\-merge ] [ \-\-reverse ] [ \-\-walk\-reflogs ] [ \-\-no\-walk ] [ \-\-do\-walk ] \&... [ \-\- \&... ] .fi .SH "DESCRIPTION" Lists commit objects in reverse chronological order starting at the given commit(s), taking ancestry relationship into account. This is useful to produce human\-readable log output. Commits which are stated with a preceding \fI^\fR cause listing to stop at that point. Their parents are implied. Thus the following command: .sp .nf .ft C $ git\-rev\-list foo bar ^baz .ft .fi means "list all the commits which are included in \fIfoo\fR and \fIbar\fR, but not in \fIbaz\fR". A special notation "\fI\fR..\fI\fR" can be used as a short\-hand for "^\fI\fR \fI\fR". For example, either of the following may be used interchangeably: .sp .nf .ft C $ git\-rev\-list origin..HEAD $ git\-rev\-list HEAD ^origin .ft .fi Another special notation is "\fI\fR\&...\fI\fR" which is useful for merges. The resulting set of commits is the symmetric difference between the two operands. The following two commands are equivalent: .sp .nf .ft C $ git\-rev\-list A B \-\-not $(git\-merge\-base \-\-all A B) $ git\-rev\-list A...B .ft .fi \fBgit\-rev\-list\fR(1) is a very essential git program, since it provides the ability to build and traverse commit ancestry graphs. For this reason, it has a lot of different options that enables it to be used by commands as different as \fBgit\-bisect\fR(1) and \fBgit\-repack\fR(1). .SH "OPTIONS" .SS "Commit Formatting" Using these options, \fBgit\-rev\-list\fR(1) will act similar to the more specialized family of commit log tools: \fBgit\-log\fR(1), \fBgit\-show\fR(1), and \fBgit\-whatchanged\fR(1) .TP \-\-pretty[=\fI\fR] Pretty\-print the contents of the commit logs in a given format, where \fI\fR can be one of \fIoneline\fR, \fIshort\fR, \fImedium\fR, \fIfull\fR, \fIfuller\fR, \fIemail\fR, \fIraw\fR and \fIformat:\fR. When omitted, the format defaults to \fImedium\fR. .TP \-\-abbrev\-commit Instead of showing the full 40\-byte hexadecimal commit object name, show only handful hexdigits prefix. Non default number of digits can be specified with "\-\-abbrev=" (which also modifies diff output, if it is displayed). This should make "\-\-pretty=oneline" a whole lot more readable for people using 80\-column terminals. .TP \-\-encoding[=] The commit objects record the encoding used for the log message in their encoding header; this option can be used to tell the command to re\-code the commit log message in the encoding preferred by the user. For non plumbing commands this defaults to UTF\-8. .TP \-\-relative\-date Synonym for \-\-date=relative. .TP \-\-date={relative,local,default,iso,rfc} Only takes effect for dates shown in human\-readable format, such as when using "\-\-pretty". \-\-date=relative shows dates relative to the current time, e.g. "2 hours ago". \-\-date=local shows timestamps in user's local timezone. \-\-date=iso (or \-\-date=iso8601) shows timestamps in ISO 8601 format. \-\-date=rfc (or \-\-date=rfc2822) shows timestamps in RFC 2822 format, often found in E\-mail messages. \-\-date=short shows only date but not time, in YYYY\-MM\-DD format. \-\-date=default shows timestamps in the original timezone (either committer's or author's). .TP \-\-header Print the contents of the commit in raw\-format; each record is separated with a NUL character. .TP \-\-parents Print the parents of the commit. .TP \-\-timestamp Print the raw commit timestamp. .TP \-\-left\-right Mark which side of a symmetric diff a commit is reachable from. Commits from the left side are prefixed with < and those from the right with >. If combined with \-\-boundary, those commits are prefixed with \-. For example, if you have this topology: .sp .nf .ft C y\-\-\-b\-\-\-b branch B / \\ / / . / / \\ o\-\-\-x\-\-\-a\-\-\-a branch A .ft .fi you would get an output line this: .sp .nf .ft C $ git rev\-list \-\-left\-right \-\-boundary \-\-pretty=oneline A...B >bbbbbbb... 3rd on b >bbbbbbb... 2nd on b \fR. .TP \-\-stdin In addition to the \fI\fR listed on the command line, read them from the standard input. .TP \-\-cherry\-pick Omit any commit that introduces the same change as another commit on the "other side" when the set of commits are limited with symmetric difference. For example, if you have two branches, A and B, a usual way to list all commits on only one side of them is with \-\-left\-right, like the example above in the description of that option. It however shows the commits that were cherry\-picked from the other branch (for example, "3rd on b" may be cherry\-picked from branch A). With this option, such pairs of commits are excluded from the output. .TP \-g, \-\-walk\-reflogs Instead of walking the commit ancestry chain, walk reflog entries from the most recent one to older ones. When this option is used you cannot specify commits to exclude (that is, \fI^commit\fR, \fIcommit1..commit2\fR, nor \fIcommit1\&...commit2\fR notations cannot be used). With \fI\-\-pretty\fR format other than oneline (for obvious reasons), this causes the output to have two extra lines of information taken from the reflog. By default, \fIcommit@{Nth}\fR notation is used in the output. When the starting commit is specified as instead. Under \fI\-\-pretty=oneline\fR, the commit message is prefixed with this information on the same line. Cannot be combined with \fI\-\-reverse\fR. .TP \-\-merge After a failed merge, show refs that touch files having a conflict and don't exist on all heads to merge. .TP \-\-boundary Output uninteresting commits at the boundary, which are usually not shown. .TP \-\-dense, \-\-sparse When optional paths are given, the default behaviour (\fI\-\-dense\fR) is to only output commits that changes at least one of them, and also ignore merges that do not touch the given paths. Use the \fI\-\-sparse\fR flag to makes the command output all eligible commits (still subject to count and age limitation), but apply merge simplification nevertheless. .TP \-\-bisect Limit output to the one commit object which is roughly halfway between the included and excluded commits. Thus, if .sp .nf .ft C $ git\-rev\-list \-\-bisect foo ^bar ^baz .ft .fi outputs \fImidpoint\fR, the output of the two commands .sp .nf .ft C $ git\-rev\-list foo ^midpoint $ git\-rev\-list midpoint ^bar ^baz .ft .fi would be of roughly the same length. Finding the change which introduces a regression is thus reduced to a binary search: repeatedly generate and test new 'midpoint's until the commit chain is of length one. .TP \-\-bisect\-vars This calculates the same as \-\-bisect, but outputs text ready to be eval'ed by the shell. These lines will assign the name of the midpoint revision to the variable bisect_rev, and the expected number of commits to be tested after bisect_rev is tested to bisect_nr, the expected number of commits to be tested if bisect_rev turns out to be good to bisect_good, the expected number of commits to be tested if bisect_rev turns out to be bad to bisect_bad, and the number of commits we are bisecting right now to bisect_all. .SS "Commit Ordering" By default, the commits are shown in reverse chronological order. .TP \-\-topo\-order This option makes them appear in topological order (i.e. descendant commits are shown before their parents). .TP \-\-date\-order This option is similar to \fI\-\-topo\-order\fR in the sense that no parent comes before all of its children, but otherwise things are still ordered in the commit timestamp order. .TP \-\-reverse Output the commits in reverse order. Cannot be combined with \fI\-\-walk\-reflogs\fR. .SS "Object Traversal" These options are mostly targeted for packing of git repositories. .TP \-\-objects Print the object IDs of any object referenced by the listed commits. \fIgit\-rev\-list \-\-objects foo ^bar\fR thus means "send me all object IDs which I need to download if I have the commit object \fIbar\fR, but not \fIfoo\fR". .TP \-\-objects\-edge Similar to \fI\-\-objects\fR, but also print the IDs of excluded commits prefixed with a "\-" character. This is used by \fBgit\-pack\-objects\fR(1) to build "thin" pack, which records objects in deltified form based on objects contained in these excluded commits to reduce network traffic. .TP \-\-unpacked Only useful with \fI\-\-objects\fR; print the object IDs that are not in packs. .TP \-\-no\-walk Only show the given revs, but do not traverse their ancestors. .TP \-\-do\-walk Overrides a previous \-\-no\-walk. .SH "PRETTY FORMATS" If the commit is a merge, and if the pretty\-format is not \fIoneline\fR, \fIemail\fR or \fIraw\fR, an additional line is inserted before the \fIAuthor:\fR line. This line begins with "Merge: " and the sha1s of ancestral commits are printed, separated by spaces. Note that the listed commits may not necessarily be the list of the \fBdirect\fR parent commits if you 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: .TP 3 \(bu \fIoneline\fR .sp .nf .fi This is designed to be as compact as possible. .TP \(bu \fIshort\fR .sp .nf commit <sha1> Author: <author> .fi .sp .nf <title line> .fi .TP \(bu \fImedium\fR .sp .nf commit <sha1> Author: <author> Date: <date> .fi .sp .nf <title line> .fi .sp .nf <full commit message> .fi .TP \(bu \fIfull\fR .sp .nf commit <sha1> Author: <author> Commit: <committer> .fi .sp .nf <title line> .fi .sp .nf <full commit message> .fi .TP \(bu \fIfuller\fR .sp .nf commit <sha1> Author: <author> AuthorDate: <date & time> Commit: <committer> CommitDate: <date & time> .fi .sp .nf <title line> .fi .sp .nf <full commit message> .fi .TP \(bu \fIemail\fR .sp .nf From <sha1> <date> From: <author> Date: <date & time> Subject: [PATCH] <title line> .fi .sp .nf <full commit message> .fi .TP \(bu \fIraw\fR The \fIraw\fR format shows the entire commit exactly as stored in the commit object. Notably, the SHA1s are displayed in full, regardless of whether \-\-abbrev or \-\-no\-abbrev are used, and \fIparents\fR information show the true parent commits, without taking grafts nor history simplification into account. .TP \(bu \fIformat:\fR The \fIformat:\fR format allows you to specify which information you want to show. It works a little bit like printf format, with the notable exception that you get a newline with \fI%n\fR instead of \fI\\n\fR. E.g, \fIformat:"The author of %h was %an, %ar%nThe title was >>%s<<%n"\fR would show something like this: .sp .nf .ft C The author of fe6e0ee was Junio C Hamano, 23 hours ago The title was >>t4119: test autocomputing \-p<n> for traditional diff input.<< .ft .fi The placeholders are: .RS .TP 3 \(bu \fI%H\fR: commit hash .TP \(bu \fI%h\fR: abbreviated commit hash .TP \(bu \fI%T\fR: tree hash .TP \(bu \fI%t\fR: abbreviated tree hash .TP \(bu \fI%P\fR: parent hashes .TP \(bu \fI%p\fR: abbreviated parent hashes .TP \(bu \fI%an\fR: author name .TP \(bu \fI%ae\fR: author email .TP \(bu \fI%ad\fR: author date .TP \(bu \fI%aD\fR: author date, RFC2822 style .TP \(bu \fI%ar\fR: author date, relative .TP \(bu \fI%at\fR: author date, UNIX timestamp .TP \(bu \fI%ai\fR: author date, ISO 8601 format .TP \(bu \fI%cn\fR: committer name .TP \(bu \fI%ce\fR: committer email .TP \(bu \fI%cd\fR: committer date .TP \(bu \fI%cD\fR: committer date, RFC2822 style .TP \(bu \fI%cr\fR: committer date, relative .TP \(bu \fI%ct\fR: committer date, UNIX timestamp .TP \(bu \fI%ci\fR: committer date, ISO 8601 format .TP \(bu \fI%e\fR: encoding .TP \(bu \fI%s\fR: subject .TP \(bu \fI%b\fR: body .TP \(bu \fI%Cred\fR: switch color to red .TP \(bu \fI%Cgreen\fR: switch color to green .TP \(bu \fI%Cblue\fR: switch color to blue .TP \(bu \fI%Creset\fR: reset color .TP \(bu \fI%m\fR: left, right or boundary mark .TP \(bu \fI%n\fR: newline .RE .SH "AUTHOR" Written by Linus Torvalds <torvalds@osdl.org> .SH "DOCUMENTATION" Documentation by David Greaves, Junio C Hamano, Jonas Fonseca and the git\-list <git@vger.kernel.org>. .SH "GIT" Part of the \fBgit\fR(7) suite