<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/git-rev-parse.txt, branch v2.25.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.25.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.25.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-11-20T01:19:58Z</updated>
<entry>
<title>rev-parse: make --show-toplevel without a worktree an error</title>
<updated>2019-11-20T01:19:58Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-11-19T08:05:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2d92ab32fd624349d308334befbf07adf9f179b9'/>
<id>urn:sha1:2d92ab32fd624349d308334befbf07adf9f179b9</id>
<content type='text'>
Ever since it was introduced in 7cceca5ccc (Add 'git rev-parse
--show-toplevel' option., 2010-01-12), the --show-toplevel option has
treated a missing working tree as a quiet success: it neither prints a
toplevel path, but nor does it report any kind of error.

While a caller could distinguish this case by looking for an empty
response, the behavior is rather confusing. We're better off complaining
that there is no working tree, as other internal commands would do in
similar cases (e.g., "git status" or any builtin with NEED_WORK_TREE set
would just die()). So let's do the same here.

While we're at it, let's clarify the documentation and add some tests,
both for the new behavior and for the more mundane case (which was not
covered).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rev-parse: add a --show-object-format option</title>
<updated>2019-10-28T02:34:57Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-10-28T00:58:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2eabd383134b7dedbda0e8367ef3df63c67a0445'/>
<id>urn:sha1:2eabd383134b7dedbda0e8367ef3df63c67a0445</id>
<content type='text'>
Add an option to print the object format used for input, output, or
storage. This allows shell scripts to discover the hash algorithm in
use.

Since the transition plan allows for multiple input algorithms, document
that we may provide multiple results for input, and the format that the
results may take. While we don't support this now, documenting it early
means that script authors can future-proof their scripts for when we do.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Use proper syntax for replaceables in command docs</title>
<updated>2018-05-25T08:16:47Z</updated>
<author>
<name>Robert P. J. Day</name>
<email>rpjday@crashcourse.ca</email>
</author>
<published>2018-05-24T20:11:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=de613050efec781e8380a0267879a25b2d489513'/>
<id>urn:sha1:de613050efec781e8380a0267879a25b2d489513</id>
<content type='text'>
The standard for command documentation synopses appears to be:

  [...] means optional
  &lt;...&gt; means replaceable
  [&lt;...&gt;] means both optional and replaceable

So fix a number of doc pages that use incorrect variations of the
above.

Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/rev-parse-show-superproject-root'</title>
<updated>2017-10-28T01:18:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-10-28T01:18:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=986ffdc83ea3f975aacf2c2f3b6c6ac569b13780'/>
<id>urn:sha1:986ffdc83ea3f975aacf2c2f3b6c6ac569b13780</id>
<content type='text'>
Doc markup fix.

* sb/rev-parse-show-superproject-root:
  docs: fix formatting of rev-parse's --show-superproject-working-tree
</content>
</entry>
<entry>
<title>docs: fix formatting of rev-parse's --show-superproject-working-tree</title>
<updated>2017-10-27T01:31:46Z</updated>
<author>
<name>Sebastian Schuberth</name>
<email>sschuberth@gmail.com</email>
</author>
<published>2017-10-26T11:53:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e38c681fb7b9d9571cbcb441125759ffc4977ee2'/>
<id>urn:sha1:e38c681fb7b9d9571cbcb441125759ffc4977ee2</id>
<content type='text'>
Signed-off-by: Sebastian Schuberth &lt;sschuberth@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rev-parse: rev-parse: add --is-shallow-repository</title>
<updated>2017-09-19T03:16:28Z</updated>
<author>
<name>Øystein Walle</name>
<email>oystwa@gmail.com</email>
</author>
<published>2017-09-18T17:04:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=417abfde3534ad51a1a47e00ed799e40e3f7b4ae'/>
<id>urn:sha1:417abfde3534ad51a1a47e00ed799e40e3f7b4ae</id>
<content type='text'>
Running `git fetch --unshallow` on a repo that is not in fact shallow
produces a fatal error message. Add a helper to rev-parse that scripters
can use to determine whether a repo is shallow or not.

Signed-off-by: Øystein Walle &lt;oystwa@gmail.com&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>doc: rewrite description for rev-parse --short</title>
<updated>2017-06-01T01:37:42Z</updated>
<author>
<name>Andreas Heiduk</name>
<email>asheiduk@gmail.com</email>
</author>
<published>2017-05-31T21:39:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=fb87327aeed9c0079266e74b80d46b0119142601'/>
<id>urn:sha1:fb87327aeed9c0079266e74b80d46b0119142601</id>
<content type='text'>
`git rev-parse --short` is not a generic modifier but just a variant
of `--verify` and considers the given length only as a suggestion to
ensure uniqueness.

Signed-off-by: Andreas Heiduk &lt;asheiduk@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rev-parse: add --show-superproject-working-tree</title>
<updated>2017-03-08T23:52:03Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2017-03-08T23:07:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bf0231c66140be5194ac76a4a9f79e949c588293'/>
<id>urn:sha1:bf0231c66140be5194ac76a4a9f79e949c588293</id>
<content type='text'>
In some situations it is useful to know if the given repository
is a submodule of another repository.

Add the flag --show-superproject-working-tree to git-rev-parse
to make it easy to find out if there is a superproject. When no
superproject exists, the output will be empty.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rev-parse: add '--absolute-git-dir' option</title>
<updated>2017-02-04T06:18:41Z</updated>
<author>
<name>SZEDER Gábor</name>
<email>szeder.dev@gmail.com</email>
</author>
<published>2017-02-03T02:48:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a2f5a8762693d5af6dbbca714d882a21d7ba0b75'/>
<id>urn:sha1:a2f5a8762693d5af6dbbca714d882a21d7ba0b75</id>
<content type='text'>
The output of 'git rev-parse --git-dir' can be either a relative or an
absolute path, depending on whether the current working directory is
at the top of the worktree or the .git directory or not, or how the
path to the repository is specified via the '--git-dir=&lt;path&gt;' option
or the $GIT_DIR environment variable.  And if that output is a
relative path, then it is relative to the directory where any 'git
-C &lt;path&gt;' options might have led us.

This doesn't matter at all for regular scripts, because the git
wrapper automatically takes care of changing directories according to
the '-C &lt;path&gt;' options, and the scripts can then simply follow any
path returned by 'git rev-parse --git-dir', even if it's a relative
path.

Our Bash completion script, however, is unique in that it must run
directly in the user's interactive shell environment.  This means that
it's not executed through the git wrapper and would have to take care
of any '-C &lt;path&gt; options on its own, and it can't just change
directories as it pleases.  Consequently, adding support for taking
any '-C &lt;path&gt;' options on the command line into account during
completion turned out to be considerably more difficult, error prone
and required more subshells and git processes when it had to cope with
a relative path to the .git directory.

Help this rather special use case and teach 'git rev-parse' a new
'--absolute-git-dir' option which always outputs a canonicalized
absolute path to the .git directory, regardless of whether the path is
discovered automatically or is specified via $GIT_DIR or 'git
--git-dir=&lt;path&gt;'.

Signed-off-by: SZEDER Gábor &lt;szeder.dev@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rev-parse doc: pass "--" to rev-parse in the --prefix example</title>
<updated>2017-01-10T21:22:19Z</updated>
<author>
<name>Richard Hansen</name>
<email>hansenr@google.com</email>
</author>
<published>2017-01-10T20:41:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=11873b438faa13ff1416741bb48dbdaa8a6cc083'/>
<id>urn:sha1:11873b438faa13ff1416741bb48dbdaa8a6cc083</id>
<content type='text'>
The "--" argument avoids "ambiguous argument: unknown revision or
path not in the working tree" errors when a pathname argument refers
to a non-existent file.

The "--" passed explicitly to set was removed because rev-parse
outputs the "--" argument that it is given.

Signed-off-by: Richard Hansen &lt;hansenr@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
