[OpenWrt-Devel] SVN to GIT transition

Felix Fietkau nbd at openwrt.org
Mon Oct 12 16:15:40 EDT 2015


On 2015-10-12 22:02, Javier Domingo Cansino wrote:
>     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.
> 
> 
> In git you wouldn't need such thing, the way would be to track the
> forking point comparing the user history with the upstream master
> history, and describing the path. The oneliner I sent before (which I
> now realize I split in two), did (or will do) the following.
> 
> 1) Go back in history and find the latest tag, save it as $tag
We currently don't have any tags for mainline trunk, since we usually
don't directly release from it.

> 2) Find the forking point between upstream and user branch if any, save
> current commit if not such fork exists as $parent.
How does the script know which one is the right upstream?

> 3) count how many commits are from $tag commit to $parent commit, save
> it as $parent_n
> 3) If fork exists, count how many commits from $parent to HEAD, save it
> as $commit_n
> 4) If tree is dirty, save $dirty='-dirty', else $dirty=''
> 
> compose the build version info as the following:
> 
> $tag-$parent_n-$parent-$commit_n-$parent$dirty
If I see such a string, how do I look up the last OpenWrt commit from
that? With the revision number, I simply start git log and search for
@<number>

- felix
_______________________________________________
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