{"thread":{"id":"13498","subject":"[PATCH] Documentation: rev-parse: add a few \"--verify\" and \"--default\" examples","startedAt":"2008-05-13T04:51:41Z","lastAt":"2008-05-13T04:51:41Z","messageCount":1,"participants":["Christian Couder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"76829","messageId":"20080513065141.69ff4975.chriscool@tuxfamily.org","threadId":"13498","inReplyTo":null,"subject":"[PATCH] Documentation: rev-parse: add a few \"--verify\" and \"--default\" examples","fromName":"Christian Couder","fromEmail":"chriscool@tuxfamily.org","sentAt":"2008-05-13T04:51:41Z","receivedAt":"2008-05-13T04:51:41Z","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-rev-parse.txt |   25 +++++++++++++++++++++++++\n 1 files changed, 25 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt\nindex b6b2fe9..1d10893 100644\n--- a/Documentation/git-rev-parse.txt\n+++ b/Documentation/git-rev-parse.txt\n@@ -378,6 +378,31 @@ C?        option C with an optional argument\"\n eval `echo \"$OPTS_SPEC\" | git-rev-parse --parseopt -- \"$@\" || echo exit $?`\n ------------\n \n+EXAMPLES\n+--------\n+\n+* Print the SHA1 object name of the current commit:\n++\n+------------\n+$ git rev-parse --verify HEAD\n+------------\n+\n+* Print the commit SHA1 from the revision in the $REV shell variable:\n++\n+------------\n+$ git rev-parse --verify $REV\n+------------\n++\n+This will error out if $REV is empty or not a valid revision.\n+\n+* Same as above:\n++\n+------------\n+$ git rev-parse --default master --verify $REV\n+------------\n++\n+but if $REV is empty, the commit SHA1 from master will be printed.\n+\n \n Author\n ------\n-- \n1.5.5.1.347.g28d6\n"}]}