* Associating tags with changelogs
@ 2008-05-05 3:40 Zack Brown
2008-05-05 3:56 ` Kevin Ballard
2008-05-05 4:06 ` Shawn O. Pearce
0 siblings, 2 replies; 4+ messages in thread
From: Zack Brown @ 2008-05-05 3:40 UTC (permalink / raw)
To: git
Hi folks,
I'm using git to extract changelog entries into a MySQL database, and
I want to be able to associate each changelog with the official
release in which it first appears. I can use "git-tag -l" to see a
list of the tags, and I can use "git-log tag1..tag2" to view all the
changelogs between two tags, but neither of these are exactly what I
want.
My script keeps track of the most recent changelog entry that it has
processed into the MySQL database, so the next time it runs, it picks
up from that entry, using "`git-log sha1string.. --pretty=fuller", and
inserts only the changelogs since that entry into the database.
What I'd like is to still be able to get only the entries since that
sha1 string, while somehow identifying the tag of the release
encompassing each entry listed in that set. Then when I input the
changelog into my database, I can associate it with the proper
official release (or -rc candidate).
Is there a command to do that? I don't see anything in the man pages for it.
Thanks!
Zack
--
Zack Brown
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Associating tags with changelogs
2008-05-05 3:40 Associating tags with changelogs Zack Brown
@ 2008-05-05 3:56 ` Kevin Ballard
2008-05-05 4:20 ` Zack Brown
2008-05-05 4:06 ` Shawn O. Pearce
1 sibling, 1 reply; 4+ messages in thread
From: Kevin Ballard @ 2008-05-05 3:56 UTC (permalink / raw)
To: Zack Brown; +Cc: git
Sounds like you want git describe --contains.
-Kevin Ballard
On May 4, 2008, at 11:40 PM, Zack Brown wrote:
> I'm using git to extract changelog entries into a MySQL database, and
> I want to be able to associate each changelog with the official
> release in which it first appears. I can use "git-tag -l" to see a
> list of the tags, and I can use "git-log tag1..tag2" to view all the
> changelogs between two tags, but neither of these are exactly what I
> want.
>
> My script keeps track of the most recent changelog entry that it has
> processed into the MySQL database, so the next time it runs, it picks
> up from that entry, using "`git-log sha1string.. --pretty=fuller", and
> inserts only the changelogs since that entry into the database.
>
> What I'd like is to still be able to get only the entries since that
> sha1 string, while somehow identifying the tag of the release
> encompassing each entry listed in that set. Then when I input the
> changelog into my database, I can associate it with the proper
> official release (or -rc candidate).
>
> Is there a command to do that? I don't see anything in the man pages
> for it.
--
Kevin Ballard
http://kevin.sb.org
kevin@sb.org
http://www.tildesoft.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Associating tags with changelogs
2008-05-05 3:40 Associating tags with changelogs Zack Brown
2008-05-05 3:56 ` Kevin Ballard
@ 2008-05-05 4:06 ` Shawn O. Pearce
1 sibling, 0 replies; 4+ messages in thread
From: Shawn O. Pearce @ 2008-05-05 4:06 UTC (permalink / raw)
To: Zack Brown; +Cc: git
Zack Brown <zacharyb@gmail.com> wrote:
> I'm using git to extract changelog entries into a MySQL database, and
> I want to be able to associate each changelog with the official
> release in which it first appears. [...]
>
> My script keeps track of the most recent changelog entry that it has
> processed into the MySQL database, so the next time it runs, it picks
> up from that entry, using "`git-log sha1string.. --pretty=fuller", and
> inserts only the changelogs since that entry into the database.
...
> Is there a command to do that? I don't see anything in the man pages for it.
No, not really. The way to do this is either invoke
`git describe --contains $sha1` for each commit, or to
keep track of it yourself in the script.
The algorithm is really simple, especially if you have something like
Math::BigInt in Perl. Make a list of all tags, assign a bit to each
tag, make a hash of commits to BigInt (bitset of tags that contain the
commit).
Then run `git rev-list --all --parents --not sha1string` (where
sha1string is the last commit you added to the database) and copy
the bits of each commit onto its parents until the end of input.
Later loop through those commits again. If a commit's parent has
a color for a tag but the commit doesn't have that tag, then that
tag is the first time the commit appeared in a tag.
--
Shawn.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Associating tags with changelogs
2008-05-05 3:56 ` Kevin Ballard
@ 2008-05-05 4:20 ` Zack Brown
0 siblings, 0 replies; 4+ messages in thread
From: Zack Brown @ 2008-05-05 4:20 UTC (permalink / raw)
To: Kevin Ballard; +Cc: git
This seems to be working for me. I just call git-describe for each log
entry before I enter it into the database.
Thanks!
Zack
On Sun, May 4, 2008 at 11:56 PM, Kevin Ballard <kevin@sb.org> wrote:
> Sounds like you want git describe --contains.
>
> -Kevin Ballard
>
>
>
> On May 4, 2008, at 11:40 PM, Zack Brown wrote:
>
>
> > I'm using git to extract changelog entries into a MySQL database, and
> > I want to be able to associate each changelog with the official
> > release in which it first appears. I can use "git-tag -l" to see a
> > list of the tags, and I can use "git-log tag1..tag2" to view all the
> > changelogs between two tags, but neither of these are exactly what I
> > want.
> >
> > My script keeps track of the most recent changelog entry that it has
> > processed into the MySQL database, so the next time it runs, it picks
> > up from that entry, using "`git-log sha1string.. --pretty=fuller", and
> > inserts only the changelogs since that entry into the database.
> >
> > What I'd like is to still be able to get only the entries since that
> > sha1 string, while somehow identifying the tag of the release
> > encompassing each entry listed in that set. Then when I input the
> > changelog into my database, I can associate it with the proper
> > official release (or -rc candidate).
> >
> > Is there a command to do that? I don't see anything in the man pages for
> it.
> >
>
> --
> Kevin Ballard
> http://kevin.sb.org
> kevin@sb.org
> http://www.tildesoft.com
>
>
>
--
Zack Brown
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-05-05 4:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-05 3:40 Associating tags with changelogs Zack Brown
2008-05-05 3:56 ` Kevin Ballard
2008-05-05 4:20 ` Zack Brown
2008-05-05 4:06 ` Shawn O. Pearce
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).