git-hyper-blame.1 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. '\" t
  2. .\" Title: git-hyper-blame
  3. .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
  5. .\" Date: 05/03/2019
  6. .\" Manual: Chromium depot_tools Manual
  7. .\" Source: depot_tools e58cce6c
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-HYPER\-BLAME" "1" "05/03/2019" "depot_tools e58cce6c" "Chromium depot_tools Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. git-hyper-blame \- Like git blame, but with the ability to ignore or bypass certain commits\&.
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit hyper\-blame\fR [\-i <rev> [\-i <rev> \&...]] [\-\-ignore\-file=<file>]
  36. [\-\-no\-default\-ignores] [<rev>] [\-\-] <file>
  37. .fi
  38. .sp
  39. .SH "DESCRIPTION"
  40. .sp
  41. git hyper\-blame is like git blame but it can ignore or "look through" a given set of commits, to find the real culprit\&.
  42. .sp
  43. This is useful if you have a commit that makes sweeping changes that are unlikely to be what you are looking for in a blame, such as mass reformatting or renaming\&. By adding these commits to the hyper\-blame ignore list, git hyper\-blame will look past these commits to find the previous commit that touched a given line\&.
  44. .sp
  45. Follows the normal blame syntax: annotates <file> with the revision that last modified each line\&. Optional <rev> specifies the revision of <file> to start from\&.
  46. .sp
  47. Automatically looks for a file called \&.git\-blame\-ignore\-revs in the repository root directory\&. This file has the same syntax as the \-\-ignore\-file argument, and any commits mentioned in this file are added to the ignore list\&.
  48. .SH "OPTIONS"
  49. .PP
  50. \-i <rev>
  51. .RS 4
  52. A revision to ignore\&. Can be specified as many times as needed\&.
  53. .RE
  54. .PP
  55. \-\-ignore\-file=<file>
  56. .RS 4
  57. A file containing a list of revisions to ignore\&. Can have comments beginning with
  58. #\&.
  59. .RE
  60. .PP
  61. \-\-no\-default\-ignores
  62. .RS 4
  63. Do not ignore commits from the
  64. \&.git\-blame\-ignore\-revs
  65. file\&.
  66. .RE
  67. .SH "EXAMPLE"
  68. .sp
  69. Let\(cqs run git blame on a file:
  70. .sp
  71. .sp
  72. .if n \{\
  73. .RS 4
  74. .\}
  75. .nf
  76. \fB$ git blame ipsum\&.txt\fR
  77. c6eb3bfa (lorem 2014\-08\-11 23:15:57 +0000 1) LOREM IPSUM DOLOR SIT AMET, CONSECTETUR
  78. 3ddda43c (auto\-uppercaser 2014\-07\-05 02:05:18 +0000 2) ADIPISCING ELIT, SED DO EIUSMOD TEMPOR
  79. 3ddda43c (auto\-uppercaser 2014\-07\-05 02:05:18 +0000 3) INCIDIDUNT UT LABORE ET DOLORE MAGNA
  80. 3ddda43c (auto\-uppercaser 2014\-07\-05 02:05:18 +0000 4) ALIQUA\&. UT ENIM AD MINIM VENIAM, QUIS
  81. c6eb3bfa (lorem 2014\-08\-11 23:15:57 +0000 5) NOSTRUD EXERCITATION ULLAMCO LABORIS
  82. 3ddda43c (auto\-uppercaser 2014\-07\-05 02:05:18 +0000 6) NISI UT ALIQUIP EX EA COMMODO CONSEQUAT\&.
  83. .fi
  84. .if n \{\
  85. .RE
  86. .\}
  87. .sp
  88. .sp
  89. Notice that almost the entire file has been blamed on a formatting change? You aren\(cqt interested in the uppercasing of the file\&. You want to know who wrote/modified those lines in the first place\&. Just tell hyper\-blame to ignore that commit:
  90. .sp
  91. .sp
  92. .if n \{\
  93. .RS 4
  94. .\}
  95. .nf
  96. \fB$ git hyper\-blame \-i 3ddda43c ipsum\&.txt\fR
  97. c6eb3bfa (lorem 2014\-08\-11 23:15:57 +0000 1) LOREM IPSUM DOLOR SIT AMET, CONSECTETUR
  98. 134200d1 (lorem 2014\-04\-10 08:54:46 +0000 2*) ADIPISCING ELIT, SED DO EIUSMOD TEMPOR
  99. a34a1d0d (ipsum 2014\-04\-11 11:25:04 +0000 3*) INCIDIDUNT UT LABORE ET DOLORE MAGNA
  100. 134200d1 (lorem 2014\-04\-10 08:54:46 +0000 4*) ALIQUA\&. UT ENIM AD MINIM VENIAM, QUIS
  101. c6eb3bfa (lorem 2014\-08\-11 23:15:57 +0000 5) NOSTRUD EXERCITATION ULLAMCO LABORIS
  102. 0f0d17bd (dolor 2014\-06\-02 11:31:48 +0000 6*) NISI UT ALIQUIP EX EA COMMODO CONSEQUAT\&.
  103. .fi
  104. .if n \{\
  105. .RE
  106. .\}
  107. .sp
  108. .sp
  109. hyper\-blame places a * next to any line where it has skipped over an ignored commit, so you know that the line in question has been changed (by an ignored commit) since the given person wrote it\&.
  110. .SH "CAVEATS"
  111. .sp
  112. When a line skips over an ignored commit, a guess is made as to which commit previously modified that line, but it is not always clear where the line came from\&. If the ignored commit makes lots of changes in close proximity, in particular adding/removing/reordering lines, then the wrong authors may be blamed for nearby edits\&.
  113. .sp
  114. For this reason, hyper\-blame works best when the ignored commits are be limited to minor changes such as formatting and renaming, not refactoring or other more invasive changes\&.
  115. .SH "SEE ALSO"
  116. .sp
  117. \fBgit-blame\fR(1)
  118. .SH "CHROMIUM DEPOT_TOOLS"
  119. .sp
  120. Part of the chromium \fBdepot_tools\fR(7) suite\&. These tools are meant to assist with the development of chromium and related projects\&. Download the tools from \m[blue]\fBhere\fR\m[]\&\s-2\u[1]\d\s+2\&.
  121. .SH "NOTES"
  122. .IP " 1." 4
  123. here
  124. .RS 4
  125. \%https://chromium.googlesource.com/chromium/tools/depot_tools.git
  126. .RE