{"thread":{"id":"28786","subject":"Q: \"git diff\" using tag names","startedAt":"2011-10-28T12:28:36Z","lastAt":"2011-11-02T20:08:46Z","messageCount":10,"participants":["Ulrich Windl","Alexey Shumkin","Jakub Narebski","Frans Klaver","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"178461","messageId":"4EAABC15020000A100007D9D@gwsmtp1.uni-regensburg.de","threadId":"28786","inReplyTo":null,"subject":"Q: \"git diff\" using tag names","fromName":"Ulrich Windl","fromEmail":"ulrich.windl@rz.uni-regensburg.de","sentAt":"2011-10-28T12:28:36Z","receivedAt":"2011-10-28T12:28:36Z","isPatch":false,"sender":{"key":"ulrich.windl@rz.uni-regensburg.de","avatar":null},"body":"Hi,\n\nwhen using a somewhat older git (of SLES11 SP1 SDK), I could not find a way to \"git diff\" between two tag names; I can only diff between two commit numbers. I can display a changeset using \"git show\", but that's not what I wanted.\nIs it possible to get the diff I want using older versions, and is such a feature implemented in the current version? If so, since when?\n\nAs I'm not subscribed to the list, I'd appreciate CC'ed replies. Thank you.\n\nGreeting\nUlrich\n"},{"id":"178462","messageId":"20111028165943.2cc8253d@ashu.dyn.rarus.ru","threadId":"28786","inReplyTo":"4EAABC15020000A100007D9D@gwsmtp1.uni-regensburg.de","subject":"Re: Q: \"git diff\" using tag names","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2011-10-28T12:59:43Z","receivedAt":"2011-10-28T12:59:43Z","isPatch":false,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"Tag is a pointer to a commit (if to say simply)\n\ne.g. in my repo\n$ git show-ref --tags --abbrev=7\n-->8--\n676f194 refs/tags/v2.6.7\nb23c481 refs/tags/v2.6.8\n-->8--\n\nso\n\n$ git diff v2.6.7..v2.6.8\nis equivalent to\n$ git diff 676f194..b23c481\n\netc\n> Hi,\n> \n> when using a somewhat older git (of SLES11 SP1 SDK), I could not find\n> a way to \"git diff\" between two tag names; I can only diff between\n> two commit numbers. I can display a changeset using \"git show\", but\n> that's not what I wanted. Is it possible to get the diff I want using\n> older versions, and is such a feature implemented in the current\n> version? If so, since when?\n> \n> As I'm not subscribed to the list, I'd appreciate CC'ed replies.\n> Thank you.\n> \n> Greeting\n> Ulrich\n> \n> \n"},{"id":"178464","messageId":"m3aa8l5k1y.fsf@localhost.localdomain","threadId":"28786","inReplyTo":"4EAABC15020000A100007D9D@gwsmtp1.uni-regensburg.de","subject":"Re: Q: \"git diff\" using tag names","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2011-10-28T13:21:51Z","receivedAt":"2011-10-28T13:21:51Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\"Ulrich Windl\" <Ulrich.Windl@rz.uni-regensburg.de> writes:\n\n> When using a somewhat older git (of SLES11 SP1 SDK),\n\nNb. you can check version of git with \"git --version\".\n\n>                                                      I could not\n> find a way to \"git diff\" between two tag names; I can only diff\n> between two commit numbers. I can display a changeset using \"git\n> show\", but that's not what I wanted.\n>\n> Is it possible to get the diff I want using older versions, and is\n> such a feature implemented in the current version? If so, since\n> when?\n\nFrom the very beginning in Git you can use tag name where you need\ncommit identifier; Git would use commit that tag points to (will\ndereference or peel a tag).\n\nThat is not possible in some [censored] version control systems; I am\nlooking at you, Subversion!\n\n\nSo if you can do\n\n  $ git show v0.9\n  $ git show v1.0\n\nyou can also do\n\n  $ git diff v0.9 v1.0\n\nand\n\n  $ git log v0.9..v1.0\n\n-- \nJakub Narębski\n"},{"id":"178667","messageId":"4EB0FFCA020000A100007DE2@gwsmtp1.uni-regensburg.de","threadId":"28786","inReplyTo":"20111028165943.2cc8253d@ashu.dyn.rarus.ru","subject":"Antw: Re: Q: \"git diff\" using tag names","fromName":"Ulrich Windl","fromEmail":"ulrich.windl@rz.uni-regensburg.de","sentAt":"2011-11-02T07:31:06Z","receivedAt":"2011-11-02T07:31:06Z","isPatch":false,"sender":{"key":"ulrich.windl@rz.uni-regensburg.de","avatar":null},"body":"Hello Alexey,\n\nthank you very much for your reply. I felt I did something wrong, but couldn't find out what it was. Actually it turned out that I had just mistyped one tag name.\n\nAlso it seems that both syntaxes work:\ngit diff v0.4..v0.5\ngit diff v0.4 v0.5\n\nThe question is: How does git disambiguate between tag names, commits and file names? (All may start with a letter)\nThis seems to work automagically, and I was desparately looking for an option like \"--\" to separate revisions from file names. I found \"SPECIFYING REVISIONS\" in git-rev-parse(1), so you don't really have to answer.\n\nRegards,\nUlrich\n\n>>> Alexey Shumkin <Alex.Crezoff@gmail.com> schrieb am 28.10.2011 um 14:59 in\nNachricht <20111028165943.2cc8253d@ashu.dyn.rarus.ru>:\n> Tag is a pointer to a commit (if to say simply)\n> \n> e.g. in my repo\n> $ git show-ref --tags --abbrev=7\n> -->8--\n> 676f194 refs/tags/v2.6.7\n> b23c481 refs/tags/v2.6.8\n> -->8--\n> \n> so\n> \n> $ git diff v2.6.7..v2.6.8\n> is equivalent to\n> $ git diff 676f194..b23c481\n> \n> etc\n> > Hi,\n> > \n> > when using a somewhat older git (of SLES11 SP1 SDK), I could not find\n> > a way to \"git diff\" between two tag names; I can only diff between\n> > two commit numbers. I can display a changeset using \"git show\", but\n> > that's not what I wanted. Is it possible to get the diff I want using\n> > older versions, and is such a feature implemented in the current\n> > version? If so, since when?\n> > \n> > As I'm not subscribed to the list, I'd appreciate CC'ed replies.\n> > Thank you.\n> > \n> > Greeting\n> > Ulrich\n> > \n> > \n> \n> \n\n \n \n"},{"id":"178669","messageId":"4EB100DD020000A100007DE7@gwsmtp1.uni-regensburg.de","threadId":"28786","inReplyTo":"m3aa8l5k1y.fsf@localhost.localdomain","subject":"Antw: Re: Q: \"git diff\" using tag names","fromName":"Ulrich Windl","fromEmail":"ulrich.windl@rz.uni-regensburg.de","sentAt":"2011-11-02T07:35:41Z","receivedAt":"2011-11-02T07:35:41Z","isPatch":false,"sender":{"key":"ulrich.windl@rz.uni-regensburg.de","avatar":null},"body":">>> Jakub Narebski <jnareb@gmail.com> schrieb am 28.10.2011 um 15:21 in Nachricht\n<m3aa8l5k1y.fsf@localhost.localdomain>:\n> \"Ulrich Windl\" <Ulrich.Windl@rz.uni-regensburg.de> writes:\n> \n> > When using a somewhat older git (of SLES11 SP1 SDK),\n> \n> Nb. you can check version of git with \"git --version\".\n\nHi!\n\nFor the records, it's \"1.6.0.2\"...\n\n> \n> >                                                      I could not\n> > find a way to \"git diff\" between two tag names; I can only diff\n> > between two commit numbers. I can display a changeset using \"git\n> > show\", but that's not what I wanted.\n> >\n> > Is it possible to get the diff I want using older versions, and is\n> > such a feature implemented in the current version? If so, since\n> > when?\n> \n> From the very beginning in Git you can use tag name where you need\n> commit identifier; Git would use commit that tag points to (will\n> dereference or peel a tag).\n\nAs said before, I was confused by the simplicity: I was looking for an option to specify revisions (as opposed to file names), like \"-r\" for RCS, but found none. To make things complicated, I had mistyped one tag name without noticing, so I failed to diff, making me think that tag names won't work the way they actually do.\n\nSorry, and thanks to everybody who helped!\n\nUlrich\n\n> \n> That is not possible in some [censored] version control systems; I am\n> looking at you, Subversion!\n> \n> \n> So if you can do\n> \n>   $ git show v0.9\n>   $ git show v1.0\n> \n> you can also do\n> \n>   $ git diff v0.9 v1.0\n> \n> and\n> \n>   $ git log v0.9..v1.0\n\n\n\n \n"},{"id":"178676","messageId":"20111102132945.582707aa@ashu.dyn.rarus.ru","threadId":"28786","inReplyTo":"4EB0FFCA020000A100007DE2@gwsmtp1.uni-regensburg.de","subject":"Re: Q: \"git diff\" using tag names","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2011-11-02T09:29:45Z","receivedAt":"2011-11-02T09:29:45Z","isPatch":false,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"> Hello Alexey,\n> \n> thank you very much for your reply. I felt I did something wrong, but\n> couldn't find out what it was. Actually it turned out that I had just\n> mistyped one tag name.\n> \n> Also it seems that both syntaxes work:\n> git diff v0.4..v0.5\n> git diff v0.4 v0.5\n> \n> The question is: How does git disambiguate between tag names, commits\n> and file names? (All may start with a letter) This seems to work\n> automagically, and I was desparately looking for an option like \"--\"\n> to separate revisions from file names. I found \"SPECIFYING REVISIONS\"\n> in git-rev-parse(1), so you don't really have to answer.\n\nYes, you found right answer. \"--\" option separates file names from\n\"commits' names\". but it usually necessary when you have branches or\ntags named as some of your files.\nE.g. you have file \"test\" and you name branch \"test\"\nso \"git log test\" will complain that it cannot understand your\nintention to see log of what and will fail\n\n$ git log test\nfatal: ambiguous argument 'test': both revision and filename\nUse '--' to separate filenames from revisions\n\n$ git log -- test\nwill show log of file test\n\n$ git log test --\nwill show log of branch test\n\n\n> Also it seems that both syntaxes work:\n> git diff v0.4..v0.5\n> git diff v0.4 v0.5\nhonestly, I do not know the difference (at the moment :))\nmay be gurus or manual will help to discover it\n> \n> Regards,\n> Ulrich\n> \n> >>> Alexey Shumkin <Alex.Crezoff@gmail.com> schrieb am 28.10.2011 um\n> >>> 14:59 in\n> Nachricht <20111028165943.2cc8253d@ashu.dyn.rarus.ru>:\n> > Tag is a pointer to a commit (if to say simply)\n> > \n> > e.g. in my repo\n> > $ git show-ref --tags --abbrev=7\n> > -->8--\n> > 676f194 refs/tags/v2.6.7\n> > b23c481 refs/tags/v2.6.8\n> > -->8--\n> > \n> > so\n> > \n> > $ git diff v2.6.7..v2.6.8\n> > is equivalent to\n> > $ git diff 676f194..b23c481\n> > \n> > etc\n> > > Hi,\n> > > \n> > > when using a somewhat older git (of SLES11 SP1 SDK), I could not\n> > > find a way to \"git diff\" between two tag names; I can only diff\n> > > between two commit numbers. I can display a changeset using \"git\n> > > show\", but that's not what I wanted. Is it possible to get the\n> > > diff I want using older versions, and is such a feature\n> > > implemented in the current version? If so, since when?\n> > > \n> > > As I'm not subscribed to the list, I'd appreciate CC'ed replies.\n> > > Thank you.\n> > > \n> > > Greeting\n> > > Ulrich\n> > > \n> > > \n> > \n> > \n> \n>  \n>  \n> \n"},{"id":"178677","messageId":"CAH6sp9OdjNZ6_j-eSFMpecUcxW_y6fpkDZ0cRds62wOrc12x-Q@mail.gmail.com","threadId":"28786","inReplyTo":"20111102132945.582707aa@ashu.dyn.rarus.ru","subject":"Re: Q: \"git diff\" using tag names","fromName":"Frans Klaver","fromEmail":"fransklaver@gmail.com","sentAt":"2011-11-02T09:34:11Z","receivedAt":"2011-11-02T09:34:11Z","isPatch":false,"sender":{"key":"fransklaver@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1876483?v=4"},"body":"On Wed, Nov 2, 2011 at 10:29 AM, Alexey Shumkin <alex.crezoff@gmail.com> wrote:\n\n>> Also it seems that both syntaxes work:\n>> git diff v0.4..v0.5\n>> git diff v0.4 v0.5\n> honestly, I do not know the difference (at the moment :))\n> may be gurus or manual will help to discover it\n\nAs per the git-diff documentation, these two versions behave equally\n-- i.e. no differences.\n\nComparing branches\n$ git diff topic master    <1>\n$ git diff topic..master   <2>\n$ git diff topic...master  <3>\n‪1.‬ Changes between the tips of the topic and the master branches.\n‪2.‬ Same as above.\n‪3.‬ Changes that occurred on the master branch since when the topic\nbranch was started off it.\n\nCheers,\nFrans\n"},{"id":"178678","messageId":"7vty6mkgsg.fsf@alter.siamese.dyndns.org","threadId":"28786","inReplyTo":"20111102132945.582707aa@ashu.dyn.rarus.ru","subject":"Re: Q: \"git diff\" using tag names","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-11-02T09:35:59Z","receivedAt":"2011-11-02T09:35:59Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Alexey Shumkin <alex.crezoff@gmail.com> writes:\n\n>> Also it seems that both syntaxes work:\n>> git diff v0.4..v0.5\n>> git diff v0.4 v0.5\n> honestly, I do not know the difference (at the moment :))\n> may be gurus or manual will help to discover it\n\nThe latter is the kosher version, as diff is about two \"endpoints\" and not\nabout \"ranges\". The only reason the former is parsed without erroring out\nis because too many people are used to type .. between two things without\nthinking, learned the notation from \"git log\", which _is_ about ranges.\n"},{"id":"178714","messageId":"20111103000813.66dd2685@zappedws","threadId":"28786","inReplyTo":"CAH6sp9OdjNZ6_j-eSFMpecUcxW_y6fpkDZ0cRds62wOrc12x-Q@mail.gmail.com","subject":"Re: Q: \"git diff\" using tag names","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2011-11-02T20:08:13Z","receivedAt":"2011-11-02T20:08:13Z","isPatch":false,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"thanks )\n\n> On Wed, Nov 2, 2011 at 10:29 AM, Alexey Shumkin\n> <alex.crezoff@gmail.com> wrote:\n> \n> >> Also it seems that both syntaxes work:\n> >> git diff v0.4..v0.5\n> >> git diff v0.4 v0.5\n> > honestly, I do not know the difference (at the moment :))\n> > may be gurus or manual will help to discover it\n> \n> As per the git-diff documentation, these two versions behave equally\n> -- i.e. no differences.\n> \n> Comparing branches\n> $ git diff topic master    <1>\n> $ git diff topic..master   <2>\n> $ git diff topic...master  <3>\n> ‪1.‬ Changes between the tips of the topic and the master branches.\n> ‪2.‬ Same as above.\n> ‪3.‬ Changes that occurred on the master branch since when the topic\n> branch was started off it.\n> \n> Cheers,\n> Frans\n"},{"id":"178715","messageId":"20111103000846.784cba29@zappedws","threadId":"28786","inReplyTo":"7vty6mkgsg.fsf@alter.siamese.dyndns.org","subject":"Re: Q: \"git diff\" using tag names","fromName":"Alexey Shumkin","fromEmail":"alex.crezoff@gmail.com","sentAt":"2011-11-02T20:08:46Z","receivedAt":"2011-11-02T20:08:46Z","isPatch":false,"sender":{"key":"alex.crezoff@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1183752?v=4"},"body":"Oh, I see\n\n> Alexey Shumkin <alex.crezoff@gmail.com> writes:\n> \n> >> Also it seems that both syntaxes work:\n> >> git diff v0.4..v0.5\n> >> git diff v0.4 v0.5\n> > honestly, I do not know the difference (at the moment :))\n> > may be gurus or manual will help to discover it\n> \n> The latter is the kosher version, as diff is about two \"endpoints\"\n> and not about \"ranges\". The only reason the former is parsed without\n> erroring out is because too many people are used to type .. between\n> two things without thinking, learned the notation from \"git log\",\n> which _is_ about ranges.\n"}]}