{"thread":{"id":"29722","subject":"[BugReport] git tag -a / git show","startedAt":"2012-02-24T10:24:48Z","lastAt":"2012-02-24T23:14:39Z","messageCount":9,"participants":["Romain Vimont (®om)","Zbigniew Jędrzejewski-Szmek","Junio C Hamano","Jeff King","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"185327","messageId":"b05f03b381140ca57a7d03a934f605bd@rom1v.com","threadId":"29722","inReplyTo":null,"subject":"[BugReport] git tag -a / git show","fromName":"Romain Vimont (®om)","fromEmail":"rom@rom1v.com","sentAt":"2012-02-24T10:24:48Z","receivedAt":"2012-02-24T10:24:48Z","isPatch":false,"sender":{"key":"rom@rom1v.com","avatar":"https://gravatar.com/avatar/5d1bec4ca84670167365bdfe4735f6f2cb5b49a710c137815ac614826a2c5f73?d=mp&s=160"},"body":"$ git --version\ngit version 1.7.5.4\n\n$ git log --pretty=online\n0ef41513d0b6d0ad28f21d0ac1da7096ad1dc6ff This is the last commit\na4702c69c28484d357179166cf3b116764da20a4 This is a commit\n\nNow, I edit some files (for example in a config file \"mock_data=true\"), \nthen I want to tag without commiting this change.\n\n$ git tag -a v0.1 -m 'My v0.1 with mock data'\n\n$ git show v0.1\ntag v0.1\nTagger: Me <me@me.me>\nDate:   Fri Feb 24 11:23:38 2012 +0100\n\n     My v0.1 with mock data\n\ncommit 0ef41513d0b6d0ad28f21d0ac1da7096ad1dc6ff\nAuthor: Me <me@me.me>\nDate:   Fri Feb 24 11:14:19 2012 +0100\n\n     This is the last commit\n\ndiff --git a/myfile b/myfile\nindex 8430bf6..20feeb6 100644\n...\n\n\nAnd it shows the diff between a4702c69c28484d357179166cf3b116764da20a4 \nand 0ef41513d0b6d0ad28f21d0ac1da7096ad1dc6ff (the two last commits).\nInstead, it should show the diff between \n0ef41513d0b6d0ad28f21d0ac1da7096ad1dc6ff (the last commit) and v0.1 (the \ntag).\n\nBest regards,\n®om\n"},{"id":"185344","messageId":"4F47E48D.4080501@in.waw.pl","threadId":"29722","inReplyTo":"b05f03b381140ca57a7d03a934f605bd@rom1v.com","subject":"Re: [BugReport] git tag -a / git show","fromName":"Zbigniew Jędrzejewski-Szmek","fromEmail":"zbyszek@in.waw.pl","sentAt":"2012-02-24T19:27:09Z","receivedAt":"2012-02-24T19:27:09Z","isPatch":false,"sender":{"key":"zbyszek@in.waw.pl","avatar":"https://avatars.githubusercontent.com/u/349618?v=4"},"body":"On 02/24/2012 11:24 AM, Romain Vimont (®om) wrote:\n> $ git log --pretty=online\n> 0ef41513d0b6d0ad28f21d0ac1da7096ad1dc6ff This is the last commit\n> a4702c69c28484d357179166cf3b116764da20a4 This is a commit\n>\n> Now, I edit some files (for example in a config file \"mock_data=true\"),\n> then I want to tag without commiting this change.\n>\n> $ git tag -a v0.1 -m 'My v0.1 with mock data'\n\n> And it shows the diff between a4702c69c28484d357179166cf3b116764da20a4\n> and 0ef41513d0b6d0ad28f21d0ac1da7096ad1dc6ff (the two last commits).\n\nHi Romain,\ngit tag attaches the tag to the last commit, 0ef41513 in your case. \nDirty changes in your tree are ignored by the tag command. You would \nhave to commit them first, and attach the tag to this new commit.\n\nzbyszek\n"},{"id":"185349","messageId":"7vsji0yprw.fsf@alter.siamese.dyndns.org","threadId":"29722","inReplyTo":"b05f03b381140ca57a7d03a934f605bd@rom1v.com","subject":"Re: [Not A BugReport] git tag -a / git show","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-02-24T19:50:27Z","receivedAt":"2012-02-24T19:50:27Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Romain Vimont (®om)\" <rom@rom1v.com> writes:\n\n> Now, I edit some files (for example in a config file\n> \"mock_data=true\"), then I want to tag without commiting this change.\n\nTag applies to an existing commit [*1*].  Your change in the working tree\nis purely ephemeral until it is committed.\n\nIn other words, you don't \"tag without committing\".\n\n> $ git tag -a v0.1 -m 'My v0.1 with mock data'\n\nBy omitting the [<head>] part from your command line for a command whose\nusage is:\n\n  usage: git tag [-a|-s|-u <key-id>] [-f] [-m <msg>|-F <file>] <tagname> [<head>]\n\nyou asked <head> to default to HEAD, the most recent commit, so the tag\npoints at your 0ef41513d0b6 (This is the last commit).  The tag message\nshould say \"My v0.1\" without anything else.\n\nAnd show naturally shows the patch to bring its parent to that tagged\ncommit.\n\nIf you wanted to keep your mainline pristine without mock data, and want\nto have a playpen that uses mock data, a way to do so is to use a separate\nbranch, e.g.\n\n        $ git checkout -b playpen\n\nNow, you are on your 'playpen' branch that was forked from the tip of\nwhatever branch you were on, perhaps 'master'.  Then commit that state\nwith whatever change that is specific to the playpen you want to keep out\nof the mainline:\n\n\t$ edit config.txt ;# set mock_data=true\n        $ git commit -a -m 'With mock data'\n\nYou can optionally tag the resulting commit if you want to.  You are still\non the 'playpen' branch, so you probably would want to come back to the\nprevious branch after you are done.\n\n\n[Footnote]\n\n*1* technically, tag can apply to any type of object, but it is most\ncommon to apply to a commit.\n"},{"id":"185350","messageId":"1330113345.2727.3.camel@rom-laptop","threadId":"29722","inReplyTo":"4F47E48D.4080501@in.waw.pl","subject":"Re: [BugReport] git tag -a / git show","fromName":"Romain Vimont (®om)","fromEmail":"rom@rom1v.com","sentAt":"2012-02-24T19:55:45Z","receivedAt":"2012-02-24T19:55:45Z","isPatch":false,"sender":{"key":"rom@rom1v.com","avatar":"https://gravatar.com/avatar/5d1bec4ca84670167365bdfe4735f6f2cb5b49a710c137815ac614826a2c5f73?d=mp&s=160"},"body":"Thank you for your answer.\n\nAfter my message this morning, that's what I did: I commited with the\nmock data then tag.\n\nTonight, I just tried something which do exactly what I wanted to do\nthis morning:\n\n$ git checkout -b temp\n$ git commit -a -m 'My config file with mock_data=true'\n$ git tag -a v0.1 -m v0.1\n$ git checkout master\n$ git branch -D temp\n\nWith these commands, the tag is associated to a commit which is not in\nany branch.\n\nRegards,\n©om\n\nLe vendredi 24 février 2012 à 20:27 +0100, Zbigniew Jędrzejewski-Szmek a\nécrit :\n> On 02/24/2012 11:24 AM, Romain Vimont (®om) wrote:\n> > $ git log --pretty=online\n> > 0ef41513d0b6d0ad28f21d0ac1da7096ad1dc6ff This is the last commit\n> > a4702c69c28484d357179166cf3b116764da20a4 This is a commit\n> >\n> > Now, I edit some files (for example in a config file \"mock_data=true\"),\n> > then I want to tag without commiting this change.\n> >\n> > $ git tag -a v0.1 -m 'My v0.1 with mock data'\n> \n> > And it shows the diff between a4702c69c28484d357179166cf3b116764da20a4\n> > and 0ef41513d0b6d0ad28f21d0ac1da7096ad1dc6ff (the two last commits).\n> \n> Hi Romain,\n> git tag attaches the tag to the last commit, 0ef41513 in your case. \n> Dirty changes in your tree are ignored by the tag command. You would \n> have to commit them first, and attach the tag to this new commit.\n> \n> zbyszek\n> \n"},{"id":"185351","messageId":"1330113528.2727.5.camel@rom-laptop","threadId":"29722","inReplyTo":"7vsji0yprw.fsf@alter.siamese.dyndns.org","subject":"Re: [Not A BugReport] git tag -a / git show","fromName":"Romain Vimont (®om)","fromEmail":"rom@rom1v.com","sentAt":"2012-02-24T19:58:48Z","receivedAt":"2012-02-24T19:58:48Z","isPatch":false,"sender":{"key":"rom@rom1v.com","avatar":"https://gravatar.com/avatar/5d1bec4ca84670167365bdfe4735f6f2cb5b49a710c137815ac614826a2c5f73?d=mp&s=160"},"body":"Thank you for the details.\n\n> *1* technically, tag can apply to any type of object, but it is most\ncommon to apply to a commit.\n\nTo what other type of object can you apply a tag ?\n\nGood evening.\n\nLe vendredi 24 février 2012 à 11:50 -0800, Junio C Hamano a écrit :\n> \"Romain Vimont (®om)\" <rom@rom1v.com> writes:\n> \n> > Now, I edit some files (for example in a config file\n> > \"mock_data=true\"), then I want to tag without commiting this change.\n> \n> Tag applies to an existing commit [*1*].  Your change in the working tree\n> is purely ephemeral until it is committed.\n> \n> In other words, you don't \"tag without committing\".\n> \n> > $ git tag -a v0.1 -m 'My v0.1 with mock data'\n> \n> By omitting the [<head>] part from your command line for a command whose\n> usage is:\n> \n>   usage: git tag [-a|-s|-u <key-id>] [-f] [-m <msg>|-F <file>] <tagname> [<head>]\n> \n> you asked <head> to default to HEAD, the most recent commit, so the tag\n> points at your 0ef41513d0b6 (This is the last commit).  The tag message\n> should say \"My v0.1\" without anything else.\n> \n> And show naturally shows the patch to bring its parent to that tagged\n> commit.\n> \n> If you wanted to keep your mainline pristine without mock data, and want\n> to have a playpen that uses mock data, a way to do so is to use a separate\n> branch, e.g.\n> \n>         $ git checkout -b playpen\n> \n> Now, you are on your 'playpen' branch that was forked from the tip of\n> whatever branch you were on, perhaps 'master'.  Then commit that state\n> with whatever change that is specific to the playpen you want to keep out\n> of the mainline:\n> \n> \t$ edit config.txt ;# set mock_data=true\n>         $ git commit -a -m 'With mock data'\n> \n> You can optionally tag the resulting commit if you want to.  You are still\n> on the 'playpen' branch, so you probably would want to come back to the\n> previous branch after you are done.\n> \n> \n> [Footnote]\n> \n> *1* technically, tag can apply to any type of object, but it is most\n> common to apply to a commit.\n> \n"},{"id":"185372","messageId":"20120224205203.GA21780@sigill.intra.peff.net","threadId":"29722","inReplyTo":"1330113345.2727.3.camel@rom-laptop","subject":"Re: [BugReport] git tag -a / git show","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-24T20:52:03Z","receivedAt":"2012-02-24T20:52:03Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Feb 24, 2012 at 08:55:45PM +0100, Romain Vimont (®om) wrote:\n\n> Tonight, I just tried something which do exactly what I wanted to do\n> this morning:\n> \n> $ git checkout -b temp\n> $ git commit -a -m 'My config file with mock_data=true'\n> $ git tag -a v0.1 -m v0.1\n> $ git checkout master\n> $ git branch -D temp\n\nThere is nothing at all wrong with the commands above, but you might be\ninterested to know that you can do it without the temporary branch:\n\n  $ git commit -a -m 'My config...'\n  $ git tag -m v0.1 v0.1\n  $ git reset HEAD^\n\nThe final reset will rewind your branch tip and the index state to what\nit was before the commit, but will leave the files in the working tree\nuntouched.\n\n-Peff\n"},{"id":"185386","messageId":"1330119763.2727.10.camel@rom-laptop","threadId":"29722","inReplyTo":"20120224205203.GA21780@sigill.intra.peff.net","subject":"Re: [BugReport] git tag -a / git show","fromName":"Romain Vimont (®om)","fromEmail":"rom@rom1v.com","sentAt":"2012-02-24T21:42:43Z","receivedAt":"2012-02-24T21:42:43Z","isPatch":false,"sender":{"key":"rom@rom1v.com","avatar":"https://gravatar.com/avatar/5d1bec4ca84670167365bdfe4735f6f2cb5b49a710c137815ac614826a2c5f73?d=mp&s=160"},"body":"Thank you, I didn't know this '^' thing ;-)\n\nLe vendredi 24 février 2012 à 15:52 -0500, Jeff King a écrit :\n> On Fri, Feb 24, 2012 at 08:55:45PM +0100, Romain Vimont (®om) wrote:\n> \n> > Tonight, I just tried something which do exactly what I wanted to do\n> > this morning:\n> > \n> > $ git checkout -b temp\n> > $ git commit -a -m 'My config file with mock_data=true'\n> > $ git tag -a v0.1 -m v0.1\n> > $ git checkout master\n> > $ git branch -D temp\n> \n> There is nothing at all wrong with the commands above, but you might be\n> interested to know that you can do it without the temporary branch:\n> \n>   $ git commit -a -m 'My config...'\n>   $ git tag -m v0.1 v0.1\n>   $ git reset HEAD^\n> \n> The final reset will rewind your branch tip and the index state to what\n> it was before the commit, but will leave the files in the working tree\n> untouched.\n> \n> -Peff\n> \n"},{"id":"185387","messageId":"20120224214428.GA16828@sigill.intra.peff.net","threadId":"29722","inReplyTo":"1330119763.2727.10.camel@rom-laptop","subject":"Re: [BugReport] git tag -a / git show","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-02-24T21:44:28Z","receivedAt":"2012-02-24T21:44:28Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Feb 24, 2012 at 10:42:43PM +0100, Romain Vimont (®om) wrote:\n\n> Thank you, I didn't know this '^' thing ;-)\n\nYou might find the \"Specifying Revisions\" section of \"git help\nrev-parse\" enlightening. :)\n\n-Peff\n"},{"id":"185396","messageId":"m2fwdzzuw0.fsf@igel.home","threadId":"29722","inReplyTo":"1330113528.2727.5.camel@rom-laptop","subject":"Re: [Not A BugReport] git tag -a / git show","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2012-02-24T23:14:39Z","receivedAt":"2012-02-24T23:14:39Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Romain Vimont \"(®om)\" <rom@rom1v.com> writes:\n\n> To what other type of object can you apply a tag ?\n\nAny.  Take a look at the junio-gpg-pub tag in git's repository, or the\nv2.6.11-tree tag in Linus's kernel repository.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"}]}