git-upstream-diff.1 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. '\" t
  2. .\" Title: git-upstream-diff
  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\-UPSTREAM\-DIFF" "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-upstream-diff \- Print a diff of the current branch, compared to its upstream\&.
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit upstream\-diff\fR [\-\-wordwise] [\-\-branch branch] [<extra args for git\-diff>*]
  36. .fi
  37. .sp
  38. .SH "DESCRIPTION"
  39. .sp
  40. Shows a diff between a branch and its upstream\&. If the \-\-branch option is omitted or "HEAD", the tool shows the diff for the current branch\&. Any additional arguments are passed through to the underlying git\-diff command\&. This is \fIroughly\fR the same as:
  41. .sp
  42. .if n \{\
  43. .RS 4
  44. .\}
  45. .nf
  46. git diff \-\-patience \-C \-C branch@{upstream} \fB(1)\fR \fB(2)\fR
  47. .fi
  48. .if n \{\
  49. .RE
  50. .\}
  51. .sp
  52. .sp
  53. \fB1. \fR\-C \-C
  54. detects file copies/renames
  55. .br
  56. \fB2. \fR\-\-patience
  57. uses the patience\-diff algorithm, which tends to produce nicer diffs in many cases\&.
  58. .br
  59. .sp
  60. The difference is that branch@{upstream} is actually the tagged merge base of your branch (See \fBgit-rebase-update\fR(1))\&. This means that if your upstream branch was rebased, but you haven\(cqt yet rebased the current branch on top of it, you\(cqll still see an accurate diff compared to just diffing against @{upstream}\&.
  61. .sp
  62. The \-\-wordwise option also allows git\-diff to do word\-by\-word comparison in a semi\-intelligent way\&. However, sometimes it can produce surprising results, so it is disabled by default\&.
  63. .sp
  64. Since any additional options are passed through to git\-diff unchanged, you can use this as a general replacement for git diff for things like:
  65. .sp
  66. .if n \{\
  67. .RS 4
  68. .\}
  69. .nf
  70. $ # See what changed in a file on the current branch
  71. $ git upstream\-diff some/file\&.py
  72. \&.\&.\&.
  73. $ # Omit deleted files from the diff
  74. $ git upstream\-diff \-\-diff\-filter d
  75. \&.\&.\&.
  76. $ # etc\&.
  77. .fi
  78. .if n \{\
  79. .RE
  80. .\}
  81. .sp
  82. .SH "OPTIONS"
  83. .PP
  84. \-\-wordwise
  85. .RS 4
  86. Print a colorized word\-wise diff instead of a line\-wise diff\&.
  87. .RE
  88. .PP
  89. \-\-branch branch
  90. .RS 4
  91. Show a diff between the specified branch and its upstream, instead of using the current branch\&.
  92. .RE
  93. .PP
  94. <extra args for git\-diff>
  95. .RS 4
  96. Extra arguments are included in the invocation of
  97. \fBgit-diff\fR(1)\&. These can be anything that
  98. git\-diff
  99. normally takes\&.
  100. .PP
  101. \-\-stat
  102. .RS 4
  103. This is particularly useful to show
  104. \fIwhich\fR
  105. files have been changed in comparison to the upstream branch\&.
  106. .RE
  107. .PP
  108. \-\-staged
  109. .RS 4
  110. Diff against the staged (cached) changes, instead of against the working directory\&. This is
  111. \fIsubstantially\fR
  112. faster on large repos, but doesn\(cqt take into account unstaged changes (i\&.e\&. changes in your working copy which you haven\(cqt staged with
  113. git add)\&.
  114. .RE
  115. .PP
  116. \-\- <filename patterns>*
  117. .RS 4
  118. Restrict the diff to only show the diff for given files compared to the upstream\&.
  119. .RE
  120. .RE
  121. .SH "CONFIGURATION VARIABLES"
  122. .SS "depot\-tools\&.upstream\-diff\&.default\-args"
  123. .sp
  124. A list\-configuration variable\&. Each instance of this config variable will be prepended to all invocations of git upstream\-diff, as if you had passed them on the command line\&.
  125. .SH "SUGGESTED ALIASES"
  126. .sp
  127. Some common short\-hand aliases\&. Feel free to add these to your \fI~/\&.gitconfig\fR file\&.
  128. .sp
  129. .if n \{\
  130. .RS 4
  131. .\}
  132. .nf
  133. [alias]
  134. git udiff = upstream\-diff
  135. .fi
  136. .if n \{\
  137. .RE
  138. .\}
  139. .sp
  140. .SH "SEE ALSO"
  141. .sp
  142. \fBgit-rebase-update\fR(1)
  143. .SH "CHROMIUM DEPOT_TOOLS"
  144. .sp
  145. 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\&.
  146. .SH "NOTES"
  147. .IP " 1." 4
  148. here
  149. .RS 4
  150. \%https://chromium.googlesource.com/chromium/tools/depot_tools.git
  151. .RE