On Tue, Oct 20, 2020 at 04:17:03PM +0800, Li Yuanchao wrote:
On Tue, Oct 20, 2020 at 04:02:06PM +0800, Wu Fengguang wrote:
On Tue, Oct 20, 2020 at 03:36:02PM +0800, Li Yuanchao wrote:
On Tue, Oct 20, 2020 at 03:00:50PM +0800, Zhang Yuhang wrote:
On Tue, Oct 20, 2020 at 02:41:39PM +0800, Li Yuanchao wrote:
On Tue, Oct 20, 2020 at 11:18:30AM +0800, Cao Xueliang wrote:
On Tue, Oct 20, 2020 at 10:58:51AM +0800, Li Yuanchao wrote: >sometimes the testcase needs a specific version software, add >upstream_tag can help find the specific version. > >Signed-off-by: Li Yuanchao lyc163mail@163.com >--- > sbin/auto_submit | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >diff --git a/sbin/auto_submit b/sbin/auto_submit >index 1f55701..88ec560 100755 >--- a/sbin/auto_submit >+++ b/sbin/auto_submit >@@ -28,12 +28,25 @@ class AutoSubmit > return pkgbuild_repo > end > >+ def if_tagged(tag_list, commit_id)
if_tagged => find_tag?
find_tag maybe not suitable. I mean, it is to check if the commit is tagged, not to find a tag.
Thanks, Yuanchao
def tagged?(tag_list, commit_id)
Yes, it's a good advice. Thanks
"some_func?" should return true/false. Is it the case here?
No. Maybe 'check_tag'? Good name is really a challenge
Thanks, Yuanchao
def if_tagged(tag_list, commit_id) tag_list.each_line do |line| if line.include?(commit_id) tag = line.split return tag[1].delete_prefix('refs/tags/') end end return nil end
tag = if_tagged(tag_list, commit_id) real_argvs.push("upstream_tag=#{tag}") if tag
The function will return string or nil. Then return the value to variable "tag".
Could we just use "get_tag"?
Thanks, Zhang Yuhang