logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

git-name-rev.1 (4880B)


  1. '\" t
  2. .\" Title: git-name-rev
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
  5. .\" Date: 2025-03-14
  6. .\" Manual: Git Manual
  7. .\" Source: Git 2.49.0
  8. .\" Language: English
  9. .\"
  10. .TH "GIT\-NAME\-REV" "1" "2025-03-14" "Git 2\&.49\&.0" "Git 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-name-rev \- Find symbolic names for given revs
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. \fIgit name\-rev\fR [\-\-tags] [\-\-refs=<pattern>]
  36. ( \-\-all | \-\-annotate\-stdin | <commit\-ish>\&...\: )
  37. .fi
  38. .SH "DESCRIPTION"
  39. .sp
  40. Finds symbolic names suitable for human digestion for revisions given in any format parsable by \fIgit rev\-parse\fR\&.
  41. .SH "OPTIONS"
  42. .PP
  43. \-\-tags
  44. .RS 4
  45. Do not use branch names, but only tags to name the commits
  46. .RE
  47. .PP
  48. \-\-refs=<pattern>
  49. .RS 4
  50. Only use refs whose names match a given shell pattern\&. The pattern can be a branch name, a tag name, or a fully qualified ref name\&. If given multiple times, use refs whose names match any of the given shell patterns\&. Use
  51. \fB\-\-no\-refs\fR
  52. to clear any previous ref patterns given\&.
  53. .RE
  54. .PP
  55. \-\-exclude=<pattern>
  56. .RS 4
  57. Do not use any ref whose name matches a given shell pattern\&. The pattern can be one of branch name, tag name or fully qualified ref name\&. If given multiple times, a ref will be excluded when it matches any of the given patterns\&. When used together with \-\-refs, a ref will be used as a match only when it matches at least one \-\-refs pattern and does not match any \-\-exclude patterns\&. Use
  58. \fB\-\-no\-exclude\fR
  59. to clear the list of exclude patterns\&.
  60. .RE
  61. .PP
  62. \-\-all
  63. .RS 4
  64. List all commits reachable from all refs
  65. .RE
  66. .PP
  67. \-\-annotate\-stdin
  68. .RS 4
  69. Transform stdin by substituting all the 40\-character SHA\-1 hexes (say $hex) with "$hex ($rev_name)"\&. When used with \-\-name\-only, substitute with "$rev_name", omitting $hex altogether\&. This option was called
  70. \fB\-\-stdin\fR
  71. in older versions of Git\&.
  72. .sp
  73. For example:
  74. .sp
  75. .if n \{\
  76. .RS 4
  77. .\}
  78. .nf
  79. $ cat sample\&.txt
  80. An abbreviated revision 2ae0a9cb82 will not be substituted\&.
  81. The full name after substitution is 2ae0a9cb8298185a94e5998086f380a355dd8907,
  82. while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad
  83. $ git name\-rev \-\-annotate\-stdin <sample\&.txt
  84. An abbreviated revision 2ae0a9cb82 will not be substituted\&.
  85. The full name after substitution is 2ae0a9cb8298185a94e5998086f380a355dd8907 (master),
  86. while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad
  87. $ git name\-rev \-\-name\-only \-\-annotate\-stdin <sample\&.txt
  88. An abbreviated revision 2ae0a9cb82 will not be substituted\&.
  89. The full name after substitution is master,
  90. while its tree object is 70d105cc79e63b81cfdcb08a15297c23e60b07ad
  91. .fi
  92. .if n \{\
  93. .RE
  94. .\}
  95. .RE
  96. .PP
  97. \-\-name\-only
  98. .RS 4
  99. Instead of printing both the SHA\-1 and the name, print only the name\&. If given with \-\-tags the usual tag prefix of "tags/" is also omitted from the name, matching the output of
  100. \fBgit\-describe\fR
  101. more closely\&.
  102. .RE
  103. .PP
  104. \-\-no\-undefined
  105. .RS 4
  106. Die with error code != 0 when a reference is undefined, instead of printing
  107. \fBundefined\fR\&.
  108. .RE
  109. .PP
  110. \-\-always
  111. .RS 4
  112. Show uniquely abbreviated commit object as fallback\&.
  113. .RE
  114. .SH "EXAMPLES"
  115. .sp
  116. Given a commit, find out where it is relative to the local refs\&. Say somebody wrote you about that fantastic commit 33db5f4d9027a10e477ccf054b2c1ab94f74c85a\&. Of course, you look into the commit, but that only tells you what happened, but not the context\&.
  117. .sp
  118. Enter \fIgit name\-rev\fR:
  119. .sp
  120. .if n \{\
  121. .RS 4
  122. .\}
  123. .nf
  124. % git name\-rev 33db5f4d9027a10e477ccf054b2c1ab94f74c85a
  125. 33db5f4d9027a10e477ccf054b2c1ab94f74c85a tags/v0\&.99~940
  126. .fi
  127. .if n \{\
  128. .RE
  129. .\}
  130. .sp
  131. Now you are wiser, because you know that it happened 940 revisions before v0\&.99\&.
  132. .sp
  133. Another nice thing you can do is:
  134. .sp
  135. .if n \{\
  136. .RS 4
  137. .\}
  138. .nf
  139. % git log | git name\-rev \-\-annotate\-stdin
  140. .fi
  141. .if n \{\
  142. .RE
  143. .\}
  144. .SH "GIT"
  145. .sp
  146. Part of the \fBgit\fR(1) suite