<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/Documentation/git-rev-parse.txt, branch v2.46.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.46.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.46.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2024-05-28T18:17:10Z</updated>
<entry>
<title>Merge branch 'jc/rev-parse-fatal-doc'</title>
<updated>2024-05-28T18:17:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-05-28T18:17:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3acecc04c7f2b90c481062b227b1b8f44af9132c'/>
<id>urn:sha1:3acecc04c7f2b90c481062b227b1b8f44af9132c</id>
<content type='text'>
Doc update.

* jc/rev-parse-fatal-doc:
  rev-parse: document how --is-* options work outside a repository
</content>
</entry>
<entry>
<title>rev-parse: document how --is-* options work outside a repository</title>
<updated>2024-05-01T19:56:09Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-05-01T17:22:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d424488901fffded2e3098eb4294b47e0391bc67'/>
<id>urn:sha1:d424488901fffded2e3098eb4294b47e0391bc67</id>
<content type='text'>
When "git rev-parse" is run with the "--is-inside-work-tree" option
and friends outside a Git repository, the command exits with a
non-zero status and says "fatal: not a repository".  While it is not
wrong per-se, in the sense that it is useless to learn if we are
inside or outside a working tree in the first place when we are not
even in a repository, it could be argued that they should emit
"false" and exit with status 0, as they cannot possibly be "true".

As the current behaviour has been with us for a decade or more
since it was introduced in Git 1.5.3 timeframe, it is too late to
change it.

And arguably, the current behaviour is easier to use if you want to
distinguish among three states, i.e.,

 (1) the cwd is not controlled by Git at all
 (2) the cwd is inside a working tree
 (3) the cwd is not inside a working tree (e.g., .git/hooks/)

with a single invocation of the command by doing

    if inout=$(git rev-parse --is-inside-work-tree)
    then
        case "$inout" in
        true)   : in a working tree ;;
        false)  : not in a working tree ;;
        esac
    else
        : not in a repository
    fi

So, let's document clearly that the command will die() when run
outside a repository in general, unless in some special cases like
when the command is in the --parseopt mode.

While at it, update the introductory text that makes it sound as if
the primary operating mode is the only operating mode of the
command, which was written long before we added "--parseopt" and
"--sq-quote" modes.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'eb/hash-transition'</title>
<updated>2024-03-28T21:13:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2024-03-28T21:13:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1002f28a527d33893f7dab068dbac7011f84af65'/>
<id>urn:sha1:1002f28a527d33893f7dab068dbac7011f84af65</id>
<content type='text'>
Work to support a repository that work with both SHA-1 and SHA-256
hash algorithms has started.

* eb/hash-transition: (30 commits)
  t1016-compatObjectFormat: add tests to verify the conversion between objects
  t1006: test oid compatibility with cat-file
  t1006: rename sha1 to oid
  test-lib: compute the compatibility hash so tests may use it
  builtin/ls-tree: let the oid determine the output algorithm
  object-file: handle compat objects in check_object_signature
  tree-walk: init_tree_desc take an oid to get the hash algorithm
  builtin/cat-file: let the oid determine the output algorithm
  rev-parse: add an --output-object-format parameter
  repository: implement extensions.compatObjectFormat
  object-file: update object_info_extended to reencode objects
  object-file-convert: convert commits that embed signed tags
  object-file-convert: convert commit objects when writing
  object-file-convert: don't leak when converting tag objects
  object-file-convert: convert tag objects when writing
  object-file-convert: add a function to convert trees between algorithms
  object: factor out parse_mode out of fast-import and tree-walk into in object.h
  cache: add a function to read an OID of a specific algorithm
  tag: sign both hashes
  commit: export add_header_signature to support handling signatures on tags
  ...
</content>
</entry>
<entry>
<title>doc: git-rev-parse: enforce command-line description syntax</title>
<updated>2024-02-20T22:41:37Z</updated>
<author>
<name>Jean-Noël Avila</name>
<email>jn.avila@free.fr</email>
</author>
<published>2024-02-20T22:32:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=de2852ab6fecad63e41982823436e66ffa3fb3a2'/>
<id>urn:sha1:de2852ab6fecad63e41982823436e66ffa3fb3a2</id>
<content type='text'>
git-rev-parse(1) manpage is completely off with respect to the
command-line description syntax with badly formatted placeholders and
malformed alternatives.

Signed-off-by: Jean-Noël Avila &lt;jn.avila@free.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/rev-parse: introduce `--show-ref-format` flag</title>
<updated>2024-01-02T17:24:48Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2023-12-29T07:27:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3c4a5318afb4978a037c83ccd9bbeb870b3f0543'/>
<id>urn:sha1:3c4a5318afb4978a037c83ccd9bbeb870b3f0543</id>
<content type='text'>
Introduce a new `--show-ref-format` to git-rev-parse(1) that causes it
to print the ref format used by a repository.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>documentation: use clearer prepositions</title>
<updated>2023-10-09T19:06:29Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-10-08T06:45:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9a9fd289cc81a3bb69eb2b4e11db27509e0eb515'/>
<id>urn:sha1:9a9fd289cc81a3bb69eb2b4e11db27509e0eb515</id>
<content type='text'>
Diff best viewed with --color-diff.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>documentation: add missing article</title>
<updated>2023-10-09T19:06:29Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-10-08T06:45:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0a4f051f9318c3dd9db69c4bebecdc6d160a5fc6'/>
<id>urn:sha1:0a4f051f9318c3dd9db69c4bebecdc6d160a5fc6</id>
<content type='text'>
Diff best viewed with --color-diff.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>documentation: employ consistent verb tense for a list</title>
<updated>2023-10-09T19:06:29Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-10-08T06:45:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7f7e6bbe06719aa4c6276d5ddf230ba8d6a4d57a'/>
<id>urn:sha1:7f7e6bbe06719aa4c6276d5ddf230ba8d6a4d57a</id>
<content type='text'>
Diff best viewed with --color-diff.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>documentation: wording improvements</title>
<updated>2023-10-09T19:04:21Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-10-08T06:45:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cf6cac20059123d6ec3f867bb3692df62db52cf9'/>
<id>urn:sha1:cf6cac20059123d6ec3f867bb3692df62db52cf9</id>
<content type='text'>
Diff best viewed with --color-diff.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>rev-parse: add an --output-object-format parameter</title>
<updated>2023-10-02T21:57:40Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2023-10-02T02:40:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d7446c89b8ed57f1fa0a5b2ea5e4b7e5fcb7d9cd'/>
<id>urn:sha1:d7446c89b8ed57f1fa0a5b2ea5e4b7e5fcb7d9cd</id>
<content type='text'>
The new --output-object-format parameter returns the oid in the
specified format.

This is a generally useful plumbing facility.  It is useful for writing
test cases and for directly querying the translation maps.

Signed-off-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
