blob: ad1d1468c9936d206701d379003177e7457c884e [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-name-rev(1)
2===============
3
4NAME
5----
Junio C Hamano01078922006-03-10 00:31:476git-name-rev - Find symbolic names for given revs
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamanoa9b8d242007-05-19 04:51:5511[verse]
Junio C Hamanofce7c7e2008-07-02 03:06:3812'git name-rev' [--tags] [--refs=<pattern>]
Junio C Hamano89d4e0f2007-02-18 00:34:5913 ( --all | --stdin | <committish>... )
Junio C Hamano1a4e8412005-12-27 08:17:2314
15DESCRIPTION
16-----------
17Finds symbolic names suitable for human digestion for revisions given in any
Junio C Hamano1aa40d22010-01-21 17:46:4318format parsable by 'git rev-parse'.
Junio C Hamano1a4e8412005-12-27 08:17:2319
20
21OPTIONS
22-------
23
24--tags::
25Do not use branch names, but only tags to name the commits
26
Junio C Hamano89d4e0f2007-02-18 00:34:5927--refs=<pattern>::
28Only use refs whose names match a given shell pattern.
29
Junio C Hamano1a4e8412005-12-27 08:17:2330--all::
31List all commits reachable from all refs
32
33--stdin::
Junio C Hamano9ae1a062006-07-10 08:12:3434Read from stdin, append "(<rev_name>)" to all sha1's of nameable
Junio C Hamano1a4e8412005-12-27 08:17:2335commits, and pass to stdout
36
Junio C Hamano5e284b42007-05-22 07:23:3737--name-only::
38Instead of printing both the SHA-1 and the name, print only
39the name. If given with --tags the usual tag prefix of
Junio C Hamanoa6387422007-08-25 03:54:2740"tags/" is also omitted from the name, matching the output
Junio C Hamanoaf1987f2008-08-03 07:58:1941of `git-describe` more closely.
Junio C Hamano5e284b42007-05-22 07:23:3742
Junio C Hamanoeb415992008-06-08 22:49:4743--no-undefined::
44Die with error code != 0 when a reference is undefined,
45instead of printing `undefined`.
46
47--always::
48Show uniquely abbreviated commit object as fallback.
49
Junio C Hamano1a4e8412005-12-27 08:17:2350EXAMPLE
51-------
52
53Given a commit, find out where it is relative to the local refs. Say somebody
Junio C Hamano7ccb9fd2006-07-15 01:38:4054wrote you about that fantastic commit 33db5f4d9027a10e477ccf054b2c1ab94f74c85a.
Junio C Hamano1a4e8412005-12-27 08:17:2355Of course, you look into the commit, but that only tells you what happened, but
56not the context.
57
Junio C Hamano1aa40d22010-01-21 17:46:4358Enter 'git name-rev':
Junio C Hamano1a4e8412005-12-27 08:17:2359
60------------
61% git name-rev 33db5f4d9027a10e477ccf054b2c1ab94f74c85a
Junio C Hamanofcb740a2008-08-31 06:32:056233db5f4d9027a10e477ccf054b2c1ab94f74c85a tags/v0.99~940
Junio C Hamano1a4e8412005-12-27 08:17:2363------------
64
65Now you are wiser, because you know that it happened 940 revisions before v0.99.
66
67Another nice thing you can do is:
68
69------------
70% git log | git name-rev --stdin
71------------
72
Junio C Hamano1a4e8412005-12-27 08:17:2373GIT
74---
Junio C Hamanof7c042d2008-06-06 22:50:5375Part of the linkgit:git[1] suite