{"thread":{"id":"34674","subject":"How can I automatically create a GIT branch that represents a sequence of tags?","startedAt":"2013-08-10T22:29:45Z","lastAt":"2013-08-11T12:23:08Z","messageCount":9,"participants":["Kristian Freed","Fredrik Gustafsson","Michael Haggerty","Philip Oakley","Andreas Schwab","Felipe Contreras"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"225035","messageId":"CAFw3YtRLgUGGn9JV5K3P9XtMBcBeO7=VSM7PekSxtW6xCsfZ1Q@mail.gmail.com","threadId":"34674","inReplyTo":null,"subject":"How can I automatically create a GIT branch that represents a sequence of tags?","fromName":"Kristian Freed","fromEmail":"kristian.freed@gmail.com","sentAt":"2013-08-10T22:29:45Z","receivedAt":"2013-08-10T22:29:45Z","isPatch":false,"sender":{"key":"kristian.freed@gmail.com","avatar":null},"body":"In our current setup, we have automatic tagging in git of all\nsuccessful release builds. This makes it easy to go back to stable\npoints in history and compare functionality, check when bugs were\nintroduced etc.\n\nTo help with this process further, it would be useful to be able to\nuse git bisect, but as these are just a sequence of tags, not commits\non a branch, git bisect will not work as is.\n\nIs there any tooling for automatically recreating a branch from a\nsequence of tags, where each generated commit is the calculated delta\nbetween each two neighbouring tags?\n\nThanks,\nKristian\n"},{"id":"225036","messageId":"20130810232026.GF25779@paksenarrion.iveqy.com","threadId":"34674","inReplyTo":"CAFw3YtRLgUGGn9JV5K3P9XtMBcBeO7=VSM7PekSxtW6xCsfZ1Q@mail.gmail.com","subject":"Re: How can I automatically create a GIT branch that represents a sequence of tags?","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-08-10T23:20:26Z","receivedAt":"2013-08-10T23:20:26Z","isPatch":false,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Sat, Aug 10, 2013 at 11:29:45PM +0100, Kristian Freed wrote:\n> In our current setup, we have automatic tagging in git of all\n> successful release builds. This makes it easy to go back to stable\n> points in history and compare functionality, check when bugs were\n> introduced etc.\n> \n> To help with this process further, it would be useful to be able to\n> use git bisect, but as these are just a sequence of tags, not commits\n> on a branch, git bisect will not work as is.\n> \n> Is there any tooling for automatically recreating a branch from a\n> sequence of tags, where each generated commit is the calculated delta\n> between each two neighbouring tags?\n\nI don't understand, why is it better to find between which tags a error\nwas found and not in what commit. It's much easier to find a bug\nintroduced in a commit than in a tag/release. It sounds like you're\ndoing the bug hunting harder. Could you explain this further?\n\nIt would be very hard to do a tool such as you describe, the reason is\nthat there's no sane way to order your tags. Git today show tags\nalphabetically, all versions does not have a alphabtic order. You could\nargue that it should be in the order of the tagged commits commit date,\nhowever the commits are not ordered by date, an older commit can have a\nyounger commit as a parent. You could say that the tag order is the\norder you find the tags if you go from a branch and backwards in the\nhistory, however how do you then choose which path to take when you find\na merge?\n\nMy suggestion if you want to do this, is to have your buildtool to\ncheckout a special branch (let's call it tag_branch) do a git reset\nto get the worktree from the newly tagged commit and commit on that\nbranch once for each tag it's creating, when it creates the tag.\n\nIt would be quite easy to make a script that create such branch for you,\nif you only can sort the tags somehow.\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"225042","messageId":"52071E2E.2020001@alum.mit.edu","threadId":"34674","inReplyTo":"20130810232026.GF25779@paksenarrion.iveqy.com","subject":"Re: How can I automatically create a GIT branch that represents a sequence of tags?","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2013-08-11T05:16:30Z","receivedAt":"2013-08-11T05:16:30Z","isPatch":false,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"On 08/11/2013 01:20 AM, Fredrik Gustafsson wrote:\n> [...]\n> It would be very hard to do a tool such as you describe, the reason is\n> that there's no sane way to order your tags. Git today show tags\n> alphabetically, all versions does not have a alphabtic order. [...]\n> It would be quite easy to make a script that create such branch for you,\n> if you only can sort the tags somehow.\n\nGNU sort has a nice option that can sort this way:\n\n  -V, --version-sort\n     Sort by version name and number.  It behaves like a standard sort,\n     except that each sequence of decimal digits is treated numerically\n     as an index/version number.\n\nMichael\n\n-- \nMichael Haggerty\nmhagger@alum.mit.edu\nhttp://softwareswirl.blogspot.com/\n"},{"id":"225043","messageId":"20130811062026.GG25779@paksenarrion.iveqy.com","threadId":"34674","inReplyTo":"52071E2E.2020001@alum.mit.edu","subject":"Re: How can I automatically create a GIT branch that represents a sequence of tags?","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-08-11T06:20:26Z","receivedAt":"2013-08-11T06:20:26Z","isPatch":false,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Sun, Aug 11, 2013 at 07:16:30AM +0200, Michael Haggerty wrote:\n> On 08/11/2013 01:20 AM, Fredrik Gustafsson wrote:\n> > [...]\n> > It would be very hard to do a tool such as you describe, the reason is\n> > that there's no sane way to order your tags. Git today show tags\n> > alphabetically, all versions does not have a alphabtic order. [...]\n> > It would be quite easy to make a script that create such branch for you,\n> > if you only can sort the tags somehow.\n> \n> GNU sort has a nice option that can sort this way:\n> \n>   -V, --version-sort\n>      Sort by version name and number.  It behaves like a standard sort,\n>      except that each sequence of decimal digits is treated numerically\n>      as an index/version number.\n\nThat's a nice feature, I remember we had  that one as a feature request\nfor git tag just a few days ago. It works well with git.git version\nnumbers but won't be usefull in this case for git.git since git.git has\nother tags too (like the gitgui version tags). However if you've a nice\nnamespace for the tags where you only tags versions, it might be an\nalternative.\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"225048","messageId":"A728793F48D242F3BF93ACAA9D9F0F83@PhilipOakley","threadId":"34674","inReplyTo":"20130810232026.GF25779@paksenarrion.iveqy.com","subject":"Re: How can I automatically create a GIT branch that represents a sequence of tags?","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2013-08-11T07:49:36Z","receivedAt":"2013-08-11T07:49:36Z","isPatch":false,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Fredrik Gustafsson\" <iveqy@iveqy.com>\n> On Sat, Aug 10, 2013 at 11:29:45PM +0100, Kristian Freed wrote:\n>> In our current setup, we have automatic tagging in git of all\n>> successful release builds. This makes it easy to go back to stable\n>> points in history and compare functionality, check when bugs were\n>> introduced etc.\n>>\n>> To help with this process further, it would be useful to be able to\n>> use git bisect, but as these are just a sequence of tags, not commits\n>> on a branch, git bisect will not work as is.\n\nI was going to say simply use `git describe --contains <sha1>` and check \nthe result is <tag>^0 first and then either skip the commit (git bisect \nskip) or test it.\n\nUnfortunately I think it will conflict with the binary search style \n(i.e. a too sparse history with good tags). In such case it may be \nuseful to have an alternate search style but that would be a code \nupdate.\n\n>>\n>> Is there any tooling for automatically recreating a branch from a\n>> sequence of tags, where each generated commit is the calculated delta\n>> between each two neighbouring tags?\n>\n> I don't understand, why is it better to find between which tags a \n> error\n> was found and not in what commit. It's much easier to find a bug\n> introduced in a commit than in a tag/release. It sounds like you're\n> doing the bug hunting harder. Could you explain this further?\n>\nI can see that in many commercial environments that this would be \nconsidered \"best practice\" (which actually equates to common practice, \nrather than good practice). Obviously in a FOSS environment the \ndevelopers are willing to use the 'rebase until ready' approaches until \ntheir patches are acceptable. In a large corporate it can be that the \nfixes are locally good but globally bad, hence the extra tagging step.\n\n> It would be very hard to do a tool such as you describe, the reason is\n> that there's no sane way to order your tags. Git today show tags\n> alphabetically, all versions does not have a alphabtic order. You \n> could\n> argue that it should be in the order of the tagged commits commit \n> date,\n> however the commits are not ordered by date, an older commit can have \n> a\n> younger commit as a parent. You could say that the tag order is the\n> order you find the tags if you go from a branch and backwards in the\n> history, however how do you then choose which path to take when you \n> find\n> a merge?\n>\n> My suggestion if you want to do this, is to have your buildtool to\n> checkout a special branch (let's call it tag_branch) do a git reset\n> to get the worktree from the newly tagged commit and commit on that\n> branch once for each tag it's creating, when it creates the tag.\n>\n> It would be quite easy to make a script that create such branch for \n> you,\n> if you only can sort the tags somehow.\n>\n> -- \n> Med vänliga hälsningar\n> Fredrik Gustafsson\n>\n--\nPhilip \n"},{"id":"225051","messageId":"m2k3jssh59.fsf@linux-m68k.org","threadId":"34674","inReplyTo":"CAFw3YtRLgUGGn9JV5K3P9XtMBcBeO7=VSM7PekSxtW6xCsfZ1Q@mail.gmail.com","subject":"Re: How can I automatically create a GIT branch that represents a sequence of tags?","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2013-08-11T09:36:50Z","receivedAt":"2013-08-11T09:36:50Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Kristian Freed <kristian.freed@gmail.com> writes:\n\n> To help with this process further, it would be useful to be able to\n> use git bisect, but as these are just a sequence of tags, not commits\n> on a branch, git bisect will not work as is.\n\ngit bisect takes arbitrary revisions, there is no restriction on using\ntags as bounds.\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"},{"id":"225052","messageId":"CAMP44s1_rUVt9a6GbKFc7b0OjNtq4cZzSqC+i_s1k0x+Zs08UQ@mail.gmail.com","threadId":"34674","inReplyTo":"CAFw3YtRLgUGGn9JV5K3P9XtMBcBeO7=VSM7PekSxtW6xCsfZ1Q@mail.gmail.com","subject":"Re: How can I automatically create a GIT branch that represents a sequence of tags?","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-08-11T10:16:29Z","receivedAt":"2013-08-11T10:16:29Z","isPatch":false,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sat, Aug 10, 2013 at 5:29 PM, Kristian Freed\n<kristian.freed@gmail.com> wrote:\n> In our current setup, we have automatic tagging in git of all\n> successful release builds. This makes it easy to go back to stable\n> points in history and compare functionality, check when bugs were\n> introduced etc.\n>\n> To help with this process further, it would be useful to be able to\n> use git bisect, but as these are just a sequence of tags, not commits\n> on a branch, git bisect will not work as is.\n\nWhy don't you just do 'git bisect skip' if the commit doesn't have a tag?\n\n> Is there any tooling for automatically recreating a branch from a\n> sequence of tags, where each generated commit is the calculated delta\n> between each two neighbouring tags?\n\nThat would probably involve listing the wanted tags:\n\n% git log --topo-order --simplify-by-decoration --decorate --oneline\n\nAnd then generating the commits:\n\n% git cat-file -p v1.8.3 > commit\n# modify commit's parent\n% git hash-object -w < commit\n\n-- \nFelipe Contreras\n"},{"id":"225053","messageId":"CAFw3YtSp4QLXHkycRmmQNYkvoR=2_qC9YYV1mFV3PiwfWHspzQ@mail.gmail.com","threadId":"34674","inReplyTo":"20130810232026.GF25779@paksenarrion.iveqy.com","subject":"Re: How can I automatically create a GIT branch that represents a sequence of tags?","fromName":"Kristian Freed","fromEmail":"kristian.freed@gmail.com","sentAt":"2013-08-11T11:13:18Z","receivedAt":"2013-08-11T11:13:18Z","isPatch":false,"sender":{"key":"kristian.freed@gmail.com","avatar":null},"body":"On Sun, Aug 11, 2013 at 12:20 AM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:\n> I don't understand, why is it better to find between which tags a error\n> was found and not in what commit. It's much easier to find a bug\n> introduced in a commit than in a tag/release. It sounds like you're\n> doing the bug hunting harder. Could you explain this further?\n\nFor better or worse, the current state includes a lot of noisy \"fixing\ntests\" type commits which I\nwould like to automatically skip over when hunting bugs. This is not\ngreat and is being addressed,\nbut I am trying to make the most of the historical data we have today\n- which does contain tags\nfor all builds that passed automated testing etc but does not have\nonly good commits on the related\nbranch.\n\n> My suggestion if you want to do this, is to have your buildtool to\n> checkout a special branch (let's call it tag_branch) do a git reset\n> to get the worktree from the newly tagged commit and commit on that\n> branch once for each tag it's creating, when it creates the tag.\n\nI can see how this would work, but only for future builds. I would\nneed something like it but loop\nover all existing tags as this is a problem with historical data.\nCould you please be more specific\nas to the steps required to automatically form a commit that\nrepresents the change between\ntwo commits (i.e. tags)?\n\nThanks,\nKristian\n"},{"id":"225056","messageId":"20130811122308.GH25779@paksenarrion.iveqy.com","threadId":"34674","inReplyTo":"CAFw3YtSp4QLXHkycRmmQNYkvoR=2_qC9YYV1mFV3PiwfWHspzQ@mail.gmail.com","subject":"Re: How can I automatically create a GIT branch that represents a sequence of tags?","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-08-11T12:23:08Z","receivedAt":"2013-08-11T12:23:08Z","isPatch":false,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Sun, Aug 11, 2013 at 12:13:18PM +0100, Kristian Freed wrote:\n> On Sun, Aug 11, 2013 at 12:20 AM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:\n> > I don't understand, why is it better to find between which tags a error\n> > was found and not in what commit. It's much easier to find a bug\n> > introduced in a commit than in a tag/release. It sounds like you're\n> > doing the bug hunting harder. Could you explain this further?\n> \n> For better or worse, the current state includes a lot of noisy \"fixing\n> tests\" type commits which I\n> would like to automatically skip over when hunting bugs. This is not\n> great and is being addressed,\n> but I am trying to make the most of the historical data we have today\n> - which does contain tags\n> for all builds that passed automated testing etc but does not have\n> only good commits on the related\n> branch.\n\nThank you, that make sense (even if it's really sad to have such\nhistory).\n\n> \n> > My suggestion if you want to do this, is to have your buildtool to\n> > checkout a special branch (let's call it tag_branch) do a git reset\n> > to get the worktree from the newly tagged commit and commit on that\n> > branch once for each tag it's creating, when it creates the tag.\n> \n> I can see how this would work, but only for future builds. I would\n> need something like it but loop\n> over all existing tags as this is a problem with historical data.\n> Could you please be more specific\n> as to the steps required to automatically form a commit that\n> represents the change between\n> two commits (i.e. tags)?\n> \n\nCreate an orphan branch:\ngit checkout --orphan tag_branch\n\nNow for every tag, t:\ngit checkout t\ngit reset --soft tag_branch\ngit add .\ngit commit -m \"t\"\n\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"}]}