{"thread":{"id":"12690","subject":"The meaning of x~0 and x~ as rev-spec.","startedAt":"2008-03-14T13:20:30Z","lastAt":"2008-03-14T17:21:30Z","messageCount":3,"participants":["Sergei Organov","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"72077","messageId":"87bq5ho31d.fsf@osv.gnss.ru","threadId":"12690","inReplyTo":null,"subject":"The meaning of x~0 and x~ as rev-spec.","fromName":"Sergei Organov","fromEmail":"osv@javad.com","sentAt":"2008-03-14T13:20:30Z","receivedAt":"2008-03-14T13:20:30Z","isPatch":false,"sender":{"key":"osv@javad.com","avatar":null},"body":"Hello,\n\nTesting suggests that <name>~0 and <name>~ are the same and are just\nsynonyms for <name> as rev-specs. Is that correct? Is that by design, or\nby accident?\n\nShouldn't <name>~0 have [the same] special meaning as <name>^0?\n\nShouldn't <name>~ be a short-cut for <name>~1, similar to <name>^?\n\nAnyway, I think that at least <name>~0 (useful for scripting) should be\nexplicitly documented, provided that <name>^0 has special (and\ndocumented) meaning.\n\n[\nThe question arose when I wanted to write something like this to\nautomate reverting of a few last revisions:\n\n  for i in 0 1 2 3; do\n      git revert -n HEAD~$i\n  done\n  git commit -a\n]\n \n-- Sergei.\n"},{"id":"72108","messageId":"7vwso5p92q.fsf@gitster.siamese.dyndns.org","threadId":"12690","inReplyTo":"87bq5ho31d.fsf@osv.gnss.ru","subject":"Re: The meaning of x~0 and x~ as rev-spec.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-03-14T16:24:45Z","receivedAt":"2008-03-14T16:24:45Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sergei Organov <osv@javad.com> writes:\n\n> Testing suggests that <name>~0 and <name>~ are the same and are just\n> synonyms for <name> as rev-specs. Is that correct? Is that by design, or\n> by accident?\n\nsed -n -e '/name~3/,/x = 0;/p' sha1_name.c\n"},{"id":"72111","messageId":"87zlt1mdb9.fsf@osv.gnss.ru","threadId":"12690","inReplyTo":"7vwso5p92q.fsf@gitster.siamese.dyndns.org","subject":"Re: The meaning of x~0 and x~ as rev-spec.","fromName":"Sergei Organov","fromEmail":"osv@javad.com","sentAt":"2008-03-14T17:21:30Z","receivedAt":"2008-03-14T17:21:30Z","isPatch":false,"sender":{"key":"osv@javad.com","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Sergei Organov <osv@javad.com> writes:\n>\n>> Testing suggests that <name>~0 and <name>~ are the same and are just\n>> synonyms for <name> as rev-specs. Is that correct? Is that by design, or\n>> by accident?\n>\n> sed -n -e '/name~3/,/x = 0;/p' sha1_name.c\n\nOK, I'll send a patch for documentation.\n\n-- Sergei.\n"}]}