{"thread":{"id":"13380","subject":"Associating tags with changelogs","startedAt":"2008-05-05T03:40:23Z","lastAt":"2008-05-05T04:20:36Z","messageCount":4,"participants":["Zack Brown","Kevin Ballard","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"76063","messageId":"218b69370805042040h66d02979jac6bd64456a9d304@mail.gmail.com","threadId":"13380","inReplyTo":null,"subject":"Associating tags with changelogs","fromName":"Zack Brown","fromEmail":"zacharyb@gmail.com","sentAt":"2008-05-05T03:40:23Z","receivedAt":"2008-05-05T03:40:23Z","isPatch":false,"sender":{"key":"zacharyb@gmail.com","avatar":"https://gravatar.com/avatar/d01e954365eae00957bcf8c5f1a9757cbaddf0f3d5229ace9b2ac84c498e40c0?d=mp&s=160"},"body":"Hi folks,\n\nI'm using git to extract changelog entries into a MySQL database, and\nI want to be able to associate each changelog with the official\nrelease in which it first appears. I can use \"git-tag -l\" to see a\nlist of the tags, and I can use \"git-log tag1..tag2\" to view all the\nchangelogs between two tags, but neither of these are exactly what I\nwant.\n\nMy script keeps track of the most recent changelog entry that it has\nprocessed into the MySQL database, so the next time it runs, it picks\nup from that entry, using \"`git-log sha1string.. --pretty=fuller\", and\ninserts only the changelogs since that entry into the database.\n\nWhat I'd like is to still be able to get only the entries since that\nsha1 string, while somehow identifying the tag of the release\nencompassing each entry listed in that set. Then when I input the\nchangelog into my database, I can associate it with the proper\nofficial release (or -rc candidate).\n\nIs there a command to do that? I don't see anything in the man pages for it.\n\nThanks!\nZack\n\n-- \nZack Brown\n"},{"id":"76065","messageId":"436ECC5F-0664-4379-8F69-0121AE5F496E@sb.org","threadId":"13380","inReplyTo":"218b69370805042040h66d02979jac6bd64456a9d304@mail.gmail.com","subject":"Re: Associating tags with changelogs","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2008-05-05T03:56:31Z","receivedAt":"2008-05-05T03:56:31Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"Sounds like you want git describe --contains.\n\n-Kevin Ballard\n\nOn May 4, 2008, at 11:40 PM, Zack Brown wrote:\n\n> I'm using git to extract changelog entries into a MySQL database, and\n> I want to be able to associate each changelog with the official\n> release in which it first appears. I can use \"git-tag -l\" to see a\n> list of the tags, and I can use \"git-log tag1..tag2\" to view all the\n> changelogs between two tags, but neither of these are exactly what I\n> want.\n>\n> My script keeps track of the most recent changelog entry that it has\n> processed into the MySQL database, so the next time it runs, it picks\n> up from that entry, using \"`git-log sha1string.. --pretty=fuller\", and\n> inserts only the changelogs since that entry into the database.\n>\n> What I'd like is to still be able to get only the entries since that\n> sha1 string, while somehow identifying the tag of the release\n> encompassing each entry listed in that set. Then when I input the\n> changelog into my database, I can associate it with the proper\n> official release (or -rc candidate).\n>\n> Is there a command to do that? I don't see anything in the man pages  \n> for it.\n\n-- \nKevin Ballard\nhttp://kevin.sb.org\nkevin@sb.org\nhttp://www.tildesoft.com\n"},{"id":"76068","messageId":"20080505040646.GK29038@spearce.org","threadId":"13380","inReplyTo":"218b69370805042040h66d02979jac6bd64456a9d304@mail.gmail.com","subject":"Re: Associating tags with changelogs","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2008-05-05T04:06:46Z","receivedAt":"2008-05-05T04:06:46Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Zack Brown <zacharyb@gmail.com> wrote:\n> I'm using git to extract changelog entries into a MySQL database, and\n> I want to be able to associate each changelog with the official\n> release in which it first appears. [...]\n> \n> My script keeps track of the most recent changelog entry that it has\n> processed into the MySQL database, so the next time it runs, it picks\n> up from that entry, using \"`git-log sha1string.. --pretty=fuller\", and\n> inserts only the changelogs since that entry into the database.\n...\n> Is there a command to do that? I don't see anything in the man pages for it.\n\nNo, not really.  The way to do this is either invoke\n`git describe --contains $sha1` for each commit, or to\nkeep track of it yourself in the script.\n\nThe algorithm is really simple, especially if you have something like\nMath::BigInt in Perl.  Make a list of all tags, assign a bit to each\ntag, make a hash of commits to BigInt (bitset of tags that contain the\ncommit).\n\nThen run `git rev-list --all --parents --not sha1string` (where\nsha1string is the last commit you added to the database) and copy\nthe bits of each commit onto its parents until the end of input.\n\nLater loop through those commits again.  If a commit's parent has\na color for a tag but the commit doesn't have that tag, then that\ntag is the first time the commit appeared in a tag.\n\n-- \nShawn.\n"},{"id":"76069","messageId":"218b69370805042120p533cc100r53d5d96888843273@mail.gmail.com","threadId":"13380","inReplyTo":"436ECC5F-0664-4379-8F69-0121AE5F496E@sb.org","subject":"Re: Associating tags with changelogs","fromName":"Zack Brown","fromEmail":"zacharyb@gmail.com","sentAt":"2008-05-05T04:20:36Z","receivedAt":"2008-05-05T04:20:36Z","isPatch":false,"sender":{"key":"zacharyb@gmail.com","avatar":"https://gravatar.com/avatar/d01e954365eae00957bcf8c5f1a9757cbaddf0f3d5229ace9b2ac84c498e40c0?d=mp&s=160"},"body":"This seems to be working for me. I just call git-describe for each log\nentry before I enter it into the database.\n\nThanks!\nZack\n\nOn Sun, May 4, 2008 at 11:56 PM, Kevin Ballard <kevin@sb.org> wrote:\n> Sounds like you want git describe --contains.\n>\n>  -Kevin Ballard\n>\n>\n>\n>  On May 4, 2008, at 11:40 PM, Zack Brown wrote:\n>\n>\n> > I'm using git to extract changelog entries into a MySQL database, and\n> > I want to be able to associate each changelog with the official\n> > release in which it first appears. I can use \"git-tag -l\" to see a\n> > list of the tags, and I can use \"git-log tag1..tag2\" to view all the\n> > changelogs between two tags, but neither of these are exactly what I\n> > want.\n> >\n> > My script keeps track of the most recent changelog entry that it has\n> > processed into the MySQL database, so the next time it runs, it picks\n> > up from that entry, using \"`git-log sha1string.. --pretty=fuller\", and\n> > inserts only the changelogs since that entry into the database.\n> >\n> > What I'd like is to still be able to get only the entries since that\n> > sha1 string, while somehow identifying the tag of the release\n> > encompassing each entry listed in that set. Then when I input the\n> > changelog into my database, I can associate it with the proper\n> > official release (or -rc candidate).\n> >\n> > Is there a command to do that? I don't see anything in the man pages for\n> it.\n> >\n>\n>  --\n>  Kevin Ballard\n>  http://kevin.sb.org\n>  kevin@sb.org\n>  http://www.tildesoft.com\n>\n>\n>\n\n\n\n-- \nZack Brown\n"}]}