~ubuntu-branches/debian/sid/git/sid

« back to all changes in this revision

Viewing changes to Documentation/git-rev-parse.txt

  • Committer: Package Import Robot
  • Author(s): Jonathan Nieder
  • Date: 2013-06-12 07:50:53 UTC
  • mfrom: (1.2.19) (2.1.31 experimental)
  • Revision ID: package-import@ubuntu.com-20130612075053-uue9xe0dq0rvm44y
Tags: 1:1.8.3.1-1
* merge branch debian-experimental
* new upstream point release (see RelNotes/1.8.3.1.txt).
* debian/watch: use xz-compressed tarballs from kernel.org.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
DESCRIPTION
15
15
-----------
16
16
 
17
 
Many git porcelainish commands take mixture of flags
 
17
Many Git porcelainish commands take mixture of flags
18
18
(i.e. parameters that begin with a dash '-') and parameters
19
19
meant for the underlying 'git rev-list' command they use internally
20
20
and flags and parameters for the other commands they use
60
60
        instead.
61
61
 
62
62
--verify::
63
 
        The parameter given must be usable as a single, valid
64
 
        object name.  Otherwise barf and abort.
 
63
        Verify that exactly one parameter is provided, and that it
 
64
        can be turned into a raw 20-byte SHA-1 that can be used to
 
65
        access the object database. If so, emit it to the standard
 
66
        output; otherwise, error out.
 
67
+
 
68
If you want to make sure that the output actually names an object in
 
69
your object database and/or can be used as a specific type of object
 
70
you require, you can add "^{type}" peeling operator to the parmeter.
 
71
For example, `git rev-parse "$VAR^{commit}"` will make sure `$VAR`
 
72
names an existing object that is a commit-ish (i.e. a commit, or an
 
73
annotated tag that points at a commit).  To make sure that `$VAR`
 
74
names an existing object of any type, `git rev-parse "$VAR^{object}"`
 
75
can be used.
65
76
 
66
77
-q::
67
78
--quiet::
84
95
        one.
85
96
 
86
97
--symbolic::
87
 
        Usually the object names are output in SHA1 form (with
 
98
        Usually the object names are output in SHA-1 form (with
88
99
        possible '{caret}' prefix); this option makes them output in a
89
100
        form as close to the original input as possible.
90
101
 
101
112
        The option core.warnAmbiguousRefs is used to select the strict
102
113
        abbreviation mode.
103
114
 
 
115
--disambiguate=<prefix>::
 
116
        Show every object whose name begins with the given prefix.
 
117
        The <prefix> must be at least 4 hexadecimal digits long to
 
118
        avoid listing each and every object in the repository by
 
119
        mistake.
 
120
 
104
121
--all::
105
122
        Show all refs found in `refs/`.
106
123
 
137
154
 
138
155
--git-dir::
139
156
        Show `$GIT_DIR` if defined. Otherwise show the path to
140
 
        the .git directory, relative to the current directory.
 
157
        the .git directory. The path shown, when relative, is
 
158
        relative to the current working directory.
141
159
+
142
160
If `$GIT_DIR` is not defined and the current directory
143
 
is not detected to lie in a git repository or work tree
 
161
is not detected to lie in a Git repository or work tree
144
162
print a message to stderr and exit with nonzero status.
145
163
 
146
164
--is-inside-git-dir::
162
180
 
163
181
--short::
164
182
--short=number::
165
 
        Instead of outputting the full SHA1 values of object names try to
 
183
        Instead of outputting the full SHA-1 values of object names try to
166
184
        abbreviate them to a shorter unique name. When no length is specified
167
185
        7 is used. The minimum length is 4.
168
186
 
180
198
        Flags and parameters to be parsed.
181
199
 
182
200
--resolve-git-dir <path>::
183
 
        Check if <path> is a valid git-dir or a git-file pointing to a valid
184
 
        git-dir. If <path> is a valid git-dir the resolved path to git-dir will
185
 
        be printed.
 
201
        Check if <path> is a valid repository or a gitfile that
 
202
        points at a valid repository, and print the location of the
 
203
        repository.  If <path> is a gitfile then the resolved path
 
204
        to the real repository is printed.
 
205
 
186
206
 
187
207
include::revisions.txt[]
188
208
 
299
319
* Print the commit object name from the revision in the $REV shell variable:
300
320
+
301
321
------------
302
 
$ git rev-parse --verify $REV
 
322
$ git rev-parse --verify $REV^{commit}
303
323
------------
304
324
+
305
325
This will error out if $REV is empty or not a valid revision.
306
326
 
307
 
* Same as above:
 
327
* Similar to above:
308
328
+
309
329
------------
310
330
$ git rev-parse --default master --verify $REV