{"thread":{"id":"5598","subject":"[PATCH] Add man page for git-show-ref","startedAt":"2006-09-18T12:32:41Z","lastAt":"2006-09-20T04:14:54Z","messageCount":2,"participants":["Jonas Fonseca","Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"27129","messageId":"20060918123241.GA8238@diku.dk","threadId":"5598","inReplyTo":null,"subject":"[PATCH] Add man page for git-show-ref","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2006-09-18T12:32:41Z","receivedAt":"2006-09-18T12:32:41Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"Signed-off-by: Jonas Fonseca <fonseca@diku.dk>\n---\n Documentation/git-show-ref.txt |  136 ++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 136 insertions(+), 0 deletions(-)\n\nMostly paraphrasing Linus' commit message ...\n\ndiff --git a/Documentation/git-show-ref.txt b/Documentation/git-show-ref.txt\nnew file mode 100644\nindex 0000000..529ea17\n--- /dev/null\n+++ b/Documentation/git-show-ref.txt\n@@ -0,0 +1,136 @@\n+git-show-ref(1)\n+===============\n+\n+NAME\n+----\n+git-show-ref - List references in a local repository\n+\n+SYNOPSIS\n+--------\n+[verse]\n+'git-show-ref' [-q|--quiet] [--verify] [-h|--head] [-d|--dereference]\n+\t     [--tags] [--heads] [--] <pattern>...\n+\n+DESCRIPTION\n+-----------\n+\n+Displays references available in a local repository along with the associated\n+commit IDs. Results can be filtered using a pattern and tags can be\n+dereferenced into object IDs. Additionally, it can be used to test whether a\n+particular ref exists.\n+\n+Use of this utility is encouraged in favor of directly accessing files under\n+in the `.git` directory.\n+\n+OPTIONS\n+-------\n+\n+-h, --head::\n+\n+\tShow the HEAD reference.\n+\n+--tags, --heads::\n+\n+\tLimit to only \"refs/heads\" and \"refs/tags\", respectively.  These\n+\toptions are not mutually exclusive; when given both, references stored\n+\tin \"refs/heads\" and \"refs/tags\" are displayed.\n+\n+-d, --dereference::\n+\n+\tDereference tags into object IDs. They will be shown with \"^{}\"\n+\tappended.\n+\n+--verify::\n+\n+\tEnable stricter reference checking by requiring an exact ref path.\n+\tAside from returning an error code of 1, it will also print an error\n+\tmessage if '--quiet' was not specified.\n+\n+-q, --quiet::\n+\n+\tDo not print any results to stdout. When combined with '--verify' this\n+\tcan be used to silently check if a reference exists.\n+\n+<pattern>::\n+\n+\tShow references matching one or more patterns.\n+\n+OUTPUT\n+------\n+\n+The output is in the format: '<SHA-1 ID>' '<space>' '<reference name>'.\n+\n+-----------------------------------------------------------------------------\n+$ git show-ref --head --dereference\n+832e76a9899f560a90ffd62ae2ce83bbeff58f54 HEAD\n+832e76a9899f560a90ffd62ae2ce83bbeff58f54 refs/heads/master\n+832e76a9899f560a90ffd62ae2ce83bbeff58f54 refs/heads/origin\n+3521017556c5de4159da4615a39fa4d5d2c279b5 refs/tags/v0.99.9c\n+6ddc0964034342519a87fe013781abf31c6db6ad refs/tags/v0.99.9c^{}\n+055e4ae3ae6eb344cbabf2a5256a49ea66040131 refs/tags/v1.0rc4\n+423325a2d24638ddcc82ce47be5e40be550f4507 refs/tags/v1.0rc4^{}\n+...\n+-----------------------------------------------------------------------------\n+\n+EXAMPLE\n+-------\n+\n+To show all references called \"master\", whether tags or heads or anything\n+else, and regardless of how deep in the reference naming hierarchy they are,\n+use:\n+\n+-----------------------------------------------------------------------------\n+\tgit show-ref master\n+-----------------------------------------------------------------------------\n+\n+This will show \"refs/heads/master\" but also \"refs/remote/other-repo/master\",\n+if such references exists.\n+\n+When using the '--verify' flag, the command requires an exact path:\n+\n+-----------------------------------------------------------------------------\n+\tgit show-ref --verify refs/heads/master\n+-----------------------------------------------------------------------------\n+\n+will only match the exact branch called \"master\".\n+\n+If nothing matches, gitlink:git-show-ref[1] will return an error code of 1,\n+and in the case of verification, it will show an error message.\n+\n+For scripting, you can ask it to be quiet with the \"--quiet\" flag, which\n+allows you to do things like\n+\n+-----------------------------------------------------------------------------\n+\tgit-show-ref --quiet --verify -- \"refs/heads/$headname\" ||\n+\t\techo \"$headname is not a valid branch\"\n+-----------------------------------------------------------------------------\n+\n+to check whether a particular branch exists or not (notice how we don't\n+actually want to show any results, and we want to use the full refname for it\n+in order to not trigger the problem with ambiguous partial matches).\n+\n+To show only tags, or only proper branch heads, use \"--tags\" and/or \"--heads\"\n+respectively (using both means that it shows tags and heads, but not other\n+random references under the refs/ subdirectory).\n+\n+To do automatic tag object dereferencing, use the \"-d\" or \"--dereference\"\n+flag, so you can do\n+\n+-----------------------------------------------------------------------------\n+\tgit show-ref --tags --dereference\n+-----------------------------------------------------------------------------\n+\n+to get a listing of all tags together with what they dereference.\n+\n+SEE ALSO\n+--------\n+gitlink:git-ls-remote[1], gitlink:git-peek-remote[1]\n+\n+AUTHORS\n+-------\n+Written by Linus Torvalds <torvalds@osdl.org>.\n+Man page by Jonas Fonseca <fonseca@diku.dk>.\n+\n+GIT\n+---\n+Part of the gitlink:git[7] suite\n-- \n1.4.2.1.gca4e\n\n-- \nJonas Fonseca\n"},{"id":"27211","messageId":"20060920061454.8fc28c1f.chriscool@tuxfamily.org","threadId":"5598","inReplyTo":"20060918123241.GA8238@diku.dk","subject":"[PATCH] Document git-show-ref [-s|--hash] option.","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2006-09-20T04:14:54Z","receivedAt":"2006-09-20T04:14:54Z","isPatch":true,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"Signed-off-by: Christian Couder <chriscool@tuxfamily.org>\n---\n Documentation/git-show-ref.txt |   18 +++++++++++++++++-\n 1 files changed, 17 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-show-ref.txt b/Documentation/git-show-ref.txt\nindex 529ea17..b724d83 100644\n--- a/Documentation/git-show-ref.txt\n+++ b/Documentation/git-show-ref.txt\n@@ -9,7 +9,7 @@ SYNOPSIS\n --------\n [verse]\n 'git-show-ref' [-q|--quiet] [--verify] [-h|--head] [-d|--dereference]\n-\t     [--tags] [--heads] [--] <pattern>...\n+\t     [-s|--hash] [--tags] [--heads] [--] <pattern>...\n \n DESCRIPTION\n -----------\n@@ -40,6 +40,12 @@ OPTIONS\n \tDereference tags into object IDs. They will be shown with \"^{}\"\n \tappended.\n \n+-s, --hash::\n+\n+\tOnly show the SHA1 hash, not the reference name. When also using\n+\t--dereference the dereferenced tag will still be shown after the SHA1,\n+\tthis maybe a bug.\n+\n --verify::\n \n \tEnable stricter reference checking by requiring an exact ref path.\n@@ -72,6 +78,16 @@ The output is in the format: '<SHA-1 ID>\n ...\n -----------------------------------------------------------------------------\n \n+When using --hash (and not --dereference) the output format is: '<SHA-1 ID>'\n+\n+-----------------------------------------------------------------------------\n+$ git show-ref --heads --hash\n+2e3ba0114a1f52b47df29743d6915d056be13278\n+185008ae97960c8d551adcd9e23565194651b5d1\n+03adf42c988195b50e1a1935ba5fcbc39b2b029b\n+...\n+-----------------------------------------------------------------------------\n+\n EXAMPLE\n -------\n \n-- \n1.4.2.1.g4251-dirty\n"}]}