{"thread":{"id":"2028","subject":"Confused as to the correct syntax","startedAt":"2005-10-05T22:50:07Z","lastAt":"2005-10-06T00:06:22Z","messageCount":6,"participants":["Alan Chandler","Junio C Hamano","Jonas Fonseca"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"9737","messageId":"200510052350.07217.alan@chandlerfamily.org.uk","threadId":"2028","inReplyTo":null,"subject":"Confused as to the correct syntax","fromName":"Alan Chandler","fromEmail":"alan@chandlerfamily.org.uk","sentAt":"2005-10-05T22:50:07Z","receivedAt":"2005-10-05T22:50:07Z","isPatch":false,"sender":{"key":"alan@chandlerfamily.org.uk","avatar":"https://gravatar.com/avatar/1862247e5ea8eac114c842f9dc3a5db6253754e24ef7171757cf97eedce48b8c?d=mp&s=160"},"body":"The man page for git-rev-parse talks about the way to specify commits back \nfrom a named commit object.  The following text in this man page tries to \nexplain it, but it has confused me more\n\n\"A  suffix  ~<n>  to  a  revision parameter means the commit object that is \nthe <n>th generation grand-parent of the named commit object, following only \nthe first parent. I.e. rev~3 is equivalent to rev^ which is equivalent to \nrev11^1.\"\n\n\nWhy is rev~3 equivalent to rev^,  surely it is equivalent to rev^^^\n\nWhy is rev~3 equivalent to rev11^1, should that not be rev^1^1^1\n\nI don't understand the syntax here - so was looking it up in the man page. Is \nthere an error in the page or have I misunderstood something.\n\n\n-- \nAlan Chandler\nhttp://www.chandlerfamily.org.uk\nOpen Source. It's the difference between trust and antitrust.\n"},{"id":"9738","messageId":"7v7jcrh7wu.fsf@assigned-by-dhcp.cox.net","threadId":"2028","inReplyTo":"200510052350.07217.alan@chandlerfamily.org.uk","subject":"Re: Confused as to the correct syntax","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-10-05T23:16:01Z","receivedAt":"2005-10-05T23:16:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alan Chandler <alan@chandlerfamily.org.uk> writes:\n\n> \"A  suffix  ~<n>  to  a  revision parameter means the commit object that is \n> the <n>th generation grand-parent of the named commit object, following only \n> the first parent. I.e. rev~3 is equivalent to rev^ which is equivalent to \n> rev11^1.\"\n>\n> Why is rev~3 equivalent to rev^,  surely it is equivalent to rev^^^\n>\n> Why is rev~3 equivalent to rev11^1, should that not be rev^1^1^1\n\nSorry, for not knowing how to do that properly in Asciidoc ;-).\n\nThe source to the man page and HTML page reads like this:\n\n* A suffix '~<n>' to a revision parameter means the commit\n  object that is the <n>th generation grand-parent of the named\n  commit object, following only the first parent.  I.e. rev~3 is\n  equivalent to rev^^^ which is equivalent to rev^1^1^1.\n"},{"id":"9740","messageId":"200510060033.51010.alan@chandlerfamily.org.uk","threadId":"2028","inReplyTo":"7v7jcrh7wu.fsf@assigned-by-dhcp.cox.net","subject":"Re: Confused as to the correct syntax","fromName":"Alan Chandler","fromEmail":"alan@chandlerfamily.org.uk","sentAt":"2005-10-05T23:33:50Z","receivedAt":"2005-10-05T23:33:50Z","isPatch":false,"sender":{"key":"alan@chandlerfamily.org.uk","avatar":"https://gravatar.com/avatar/1862247e5ea8eac114c842f9dc3a5db6253754e24ef7171757cf97eedce48b8c?d=mp&s=160"},"body":"On Thursday 06 Oct 2005 00:16, Junio C Hamano wrote:\n> Alan Chandler <alan@chandlerfamily.org.uk> writes:\n> > \"A  suffix  ~<n>  to  a  revision parameter means the commit object that\n> > is the <n>th generation grand-parent of the named commit object,\n> > following only the first parent. I.e. rev~3 is equivalent to rev^ which\n> > is equivalent to rev11^1.\"\n> >\n> > Why is rev~3 equivalent to rev^,  surely it is equivalent to rev^^^\n> >\n> > Why is rev~3 equivalent to rev11^1, should that not be rev^1^1^1\n>\n> Sorry, for not knowing how to do that properly in Asciidoc ;-).\n>\n> The source to the man page and HTML page reads like this:\n>\n> * A suffix '~<n>' to a revision parameter means the commit\n>   object that is the <n>th generation grand-parent of the named\n>   commit object, following only the first parent.  I.e. rev~3 is\n>   equivalent to rev^^^ which is equivalent to rev^1^1^1.\n\nNo the HTML page is screwed up too.\n\n\n-- \nAlan Chandler\nhttp://www.chandlerfamily.org.uk\nOpen Source. It's the difference between trust and antitrust.\n"},{"id":"9741","messageId":"20051005234222.GA19292@diku.dk","threadId":"2028","inReplyTo":"7v7jcrh7wu.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Fix usage of carets in git-rev-parse(1)","fromName":"Jonas Fonseca","fromEmail":"fonseca@diku.dk","sentAt":"2005-10-05T23:42:23Z","receivedAt":"2005-10-05T23:42:23Z","isPatch":true,"sender":{"key":"fonseca@diku.dk","avatar":"https://gravatar.com/avatar/f82f3ad698717c51873b020c750a92438c820a24056dc39fe4d07baa10a92264?d=mp&s=160"},"body":"... but using a {caret} attribute.\n\nSigned-off-by: Jonas Fonseca <fonseca@diku.dk>\n\n---\n\nJunio C Hamano <junkio@cox.net> wrote Wed, Oct 05, 2005:\n> Alan Chandler <alan@chandlerfamily.org.uk> writes:\n> \n> > \"A  suffix  ~<n>  to  a  revision parameter means the commit object that is \n> > the <n>th generation grand-parent of the named commit object, following only \n> > the first parent. I.e. rev~3 is equivalent to rev^ which is equivalent to \n> > rev11^1.\"\n> >\n> > Why is rev~3 equivalent to rev^,  surely it is equivalent to rev^^^\n> >\n> > Why is rev~3 equivalent to rev11^1, should that not be rev^1^1^1\n> \n> Sorry, for not knowing how to do that properly in Asciidoc ;-).\n\nI think something like the following will do ...\n\ndiff --git a/Documentation/asciidoc.conf b/Documentation/asciidoc.conf\n--- a/Documentation/asciidoc.conf\n+++ b/Documentation/asciidoc.conf\n@@ -7,6 +7,9 @@\n # Show GIT link as: <command>(<section>); if section is defined, else just show\n # the command.\n \n+[attributes]\n+caret=^\n+\n ifdef::backend-docbook[]\n [gitlink-inlinemacro]\n {0%{target}}\n@@ -19,3 +22,5 @@ ifdef::backend-xhtml11[]\n [gitlink-inlinemacro]\n <a href=\"{target}.html\">{target}{0?({0})}</a>\n endif::backend-xhtml11[]\n+\n+\ndiff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt\n--- a/Documentation/git-rev-parse.txt\n+++ b/Documentation/git-rev-parse.txt\n@@ -54,13 +54,13 @@ OPTIONS\n \t`git-diff-\\*`).\n \n --not::\n-\tWhen showing object names, prefix them with '^' and\n-\tstrip '^' prefix from the object names that already have\n+\tWhen showing object names, prefix them with '{caret}' and\n+\tstrip '{caret}' prefix from the object names that already have\n \tone.\n \n --symbolic::\n \tUsually the object names are output in SHA1 form (with\n-\tpossible '^' prefix); this option makes them output in a\n+\tpossible '{caret}' prefix); this option makes them output in a\n \tform as close to the original input as possible.\n \n \n@@ -93,22 +93,23 @@ what is called an 'extended SHA1' syntax\n   happen to have both heads/master and tags/master, you can\n   explicitly say 'heads/master' to tell GIT which one you mean.\n \n-* A suffix '^' to a revision parameter means the first parent of\n-  that commit object.  '^<n>' means the <n>th parent (i.e.\n-  'rev^'\n-  is equivalent to 'rev^1').  As a special rule,\n-  'rev^0' means the commit itself and is used when 'rev' is the\n+* A suffix '{caret}' to a revision parameter means the first parent of\n+  that commit object.  '{caret}<n>' means the <n>th parent (i.e.\n+  'rev{caret}'\n+  is equivalent to 'rev{caret}1').  As a special rule,\n+  'rev{caret}0' means the commit itself and is used when 'rev' is the\n   object name of a tag object that refers to a commit object.\n \n * A suffix '~<n>' to a revision parameter means the commit\n   object that is the <n>th generation grand-parent of the named\n   commit object, following only the first parent.  I.e. rev~3 is\n-  equivalent to rev^^^ which is equivalent to rev^1^1^1.\n+  equivalent to rev{caret}{caret}{caret} which is equivalent to\\\n+  rev{caret}1{caret}1{caret}1.\n \n-'git-rev-parse' also accepts a prefix '^' to revision parameter,\n+'git-rev-parse' also accepts a prefix '{caret}' to revision parameter,\n which is passed to 'git-rev-list'.  Two revision parameters\n concatenated with '..' is a short-hand for writing a range\n-between them.  I.e. 'r1..r2' is equivalent to saying '^r1 r2'\n+between them.  I.e. 'r1..r2' is equivalent to saying '{caret}r1 r2'\n \n \n Author\n-- \nJonas Fonseca\n"},{"id":"9743","messageId":"7vachnecz5.fsf@assigned-by-dhcp.cox.net","threadId":"2028","inReplyTo":"200510060033.51010.alan@chandlerfamily.org.uk","subject":"Re: Confused as to the correct syntax","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-10-05T23:54:54Z","receivedAt":"2005-10-05T23:54:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alan Chandler <alan@chandlerfamily.org.uk> writes:\n\n>> Sorry, for not knowing how to do that properly in Asciidoc ;-).\n>>\n>> The source to the man page and HTML page reads like this:\n>>\n>> * A suffix '~<n>' to a revision parameter means the commit\n>>   object that is the <n>th generation grand-parent of the named\n>>   commit object, following only the first parent.  I.e. rev~3 is\n>>   equivalent to rev^^^ which is equivalent to rev^1^1^1.\n>\n> No the HTML page is screwed up too.\n\nI know.  The source reads like above, is what I said.  Help from\nAsciidoc savvy people is very welcomed.\n"},{"id":"9745","messageId":"7vd5mjcxvl.fsf@assigned-by-dhcp.cox.net","threadId":"2028","inReplyTo":"20051005234222.GA19292@diku.dk","subject":"Re: [PATCH] Fix usage of carets in git-rev-parse(1)","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-10-06T00:06:22Z","receivedAt":"2005-10-06T00:06:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonas Fonseca <fonseca@diku.dk> writes:\n\n> ... but using a {caret} attribute.\n>\n> Signed-off-by: Jonas Fonseca <fonseca@diku.dk>\n\nThanks.  This seems to fix it.  Applied and pushed out (but not\nin time for just released 0.99.8b).\n"}]}