Code

7685bd0e3c1e57190cdae97198f6d7d520369009
[git.git] / Documentation / git-pickaxe.txt
1 git-pickaxe(1)
2 ==============
4 NAME
5 ----
6 git-pickaxe - Show what revision and author last modified each line of a file
8 SYNOPSIS
9 --------
10 'git-pickaxe' [-c] [-l] [-t] [-f] [-n] [-p] [-L n,m] [-S <revs-file>] [<rev>] [--] <file>
12 DESCRIPTION
13 -----------
15 Annotates each line in the given file with information from the revision which
16 last modified the line. Optionally, start annotating from the given revision.
18 Also it can limit the range of lines annotated.
20 This report doesn't tell you anything about lines which have been deleted or
21 replaced; you need to use a tool such as gitlink:git-diff[1] or the "pickaxe"
22 interface briefly mentioned in the following paragraph.
24 Apart from supporting file annotation, git also supports searching the
25 development history for when a code snippet occured in a change. This makes it
26 possible to track when a code snippet was added to a file, moved or copied
27 between files, and eventually deleted or replaced. It works by searching for
28 a text string in the diff. A small example:
30 -----------------------------------------------------------------------------
31 $ git log --pretty=oneline -S'blame_usage'
32 5040f17eba15504bad66b14a645bddd9b015ebb7 blame -S <ancestry-file>
33 ea4c7f9bf69e781dd0cd88d2bccb2bf5cc15c9a7 git-blame: Make the output
34 -----------------------------------------------------------------------------
36 OPTIONS
37 -------
38 -c, --compatibility::
39         Use the same output mode as gitlink:git-annotate[1] (Default: off).
41 -L n,m::
42         Annotate only the specified line range (lines count from 1).
44 -l, --long::
45         Show long rev (Default: off).
47 -t, --time::
48         Show raw timestamp (Default: off).
50 -S, --rev-file <revs-file>::
51         Use revs from revs-file instead of calling gitlink:git-rev-list[1].
53 -f, --show-name::
54         Show filename in the original commit.  By default
55         filename is shown if there is any line that came from a
56         file with different name, due to rename detection.
58 -n, --show-number::
59         Show line number in the original commit (Default: off).
61 -p, --porcelain::
62         Show in a format designed for machine consumption.
64 -h, --help::
65         Show help message.
68 THE PORCELAIN FORMAT
69 --------------------
71 In this format, each line is output after a header; the
72 header at the minumum has the first line which has:
74 - 40-byte SHA-1 of the commit the line is attributed to;
75 - the line number of the line in the original file;
76 - the line number of the line in the final file;
77 - on a line that starts a group of line from a different
78   commit than the previous one, the number of lines in this
79   group.  On subsequent lines this field is absent.
81 This header line is followed by the following information
82 at least once for each commit:
84 - author name ("author"), email ("author-mail"), time
85   ("author-time"), and timezone ("author-tz"); similarly
86   for committer.
87 - filename in the commit the line is attributed to.
88 - the first line of the commit log message ("summary").
90 The contents of the actual line is output after the above
91 header, prefixed by a TAB. This is to allow adding more
92 header elements later.
94 SEE ALSO
95 --------
96 gitlink:git-blame[1]
98 AUTHOR
99 ------
100 Written by Junio C Hamano <junkio@cox.net>
102 GIT
103 ---
104 Part of the gitlink:git[7] suite