[OpenWrt-Devel] SVN to GIT transition

David Lang david at lang.hm
Mon Oct 12 16:19:55 EDT 2015


On Mon, 12 Oct 2015, Felix Fietkau wrote:

> On 2015-10-12 22:06, David Lang wrote:
>> On Mon, 12 Oct 2015, Jonathan Bennett wrote:
>>
>>> His point is that users don't ever do an SVN checkout. Because the r number
>>> is baked into the image, it's a really easy and obvious way for an end user
>>> to report the revision in a bug report.  I can see the advantage in this.
>>> If we are to move to git, we would want some way to preserve this feature,
>>> that is a super easy way for a user to report the revision.  We could bake
>>> the short hash into the image, but this would not be useful if any commits
>>> were added locally, whereas the r number would still show some useful
>>> information.
>>>
>>> Would it be possible to track the revision number in an automated way even
>>> in a git repo?  So store the r number, and automatically increment on
>>> commits.  Not sure if that's an option, but it seems like it might address
>>> the problem.
>>
>> It sounds like what you really want to do is to have the nightly build embed the
>> date of the build in the image and have people report that.
> Many people build from source and don't use nightly builds.
>
>> If someone checks out the source and compiles a new copy (with local
>> modifications), reporting a SVN version is as misleading as a git hash.
> It may not always be accurate, but the SVN version is actually useful in
> most cases, even when modifications are present.
>
>> I know that various projects I work with have the build process embed the date
>> in the package versions, so it should be straightforward to put it into some
>> file in the resulting firmware image. Such a process can also check if it's
>> running on the 'official' tree or in someone else's repo (check repo
>> owner/e-mail) and add the initials of the person compiling it.
>
> What I don't understand is how the script should check if something is
> the official tree, e.g. in the simple case of somebody having forked the
> OpenWrt mirror on github, cloned it locally, added and pushed a few
> commits and then made a build.

git config --get user.name
git config --get user.email

if they are set to the name of the official buildbot, no nothing. If they are 
set to anything else, take some data (initials or something) and make that part 
of the version number.

It's not checking if it's an unmodified tree, just if it's being built on the 
OpenWRT infrastructure.

If someone is building an unmodified tree, the git hash will work for 
identifying what tree it is. And someone else posted a process for trackign 
divergence from the upstream tree if they are modifying it first.

David Lang
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list