Re: Associating tags with changelogs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zack Brown <zacharyb@xxxxxxxxx> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux