<div dir="ltr">just to make sure that the is tag information is not spurious. All valid tags will have a commit id associated with them. We read it to check if the association is complete.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 24, 2020 at 5:55 PM Aruna Matheswaran <<a href="mailto:aruna@multicorewareinc.com">aruna@multicorewareinc.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 23, 2020 at 9:40 PM Srikanth Kurapati <<a href="mailto:srikanth.kurapati@multicorewareinc.com" target="_blank">srikanth.kurapati@multicorewareinc.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">From 06e09d500b9453b32835a6090df873b7b5842f22 Mon Sep 17 00:00:00 2001<br>From: Srikanth Kurapati <<a href="mailto:srikanth.kurapati@multicorewareinc.com" target="_blank">srikanth.kurapati@multicorewareinc.com</a>><br>Date: Wed, 16 Dec 2020 10:52:33 +0530<br>Subject: [PATCH] fix: avoids unnecessary lexicographic order checks on git<br> changesets<br><br>and correct variables used for git archive version reporting<br>---<br> source/cmake/Version.cmake | 103 ++++++++++++++++---------------------<br> 1 file changed, 44 insertions(+), 59 deletions(-)<br><br>diff --git a/source/cmake/Version.cmake b/source/cmake/Version.cmake<br>index 37c759268..f67b77395 100644<br>--- a/source/cmake/Version.cmake<br>+++ b/source/cmake/Version.cmake<br>@@ -28,8 +28,6 @@<br> set(X265_VERSION "unknown")<br> set(X265_LATEST_TAG "0.0")<br> set(X265_TAG_DISTANCE "0")<br>-set(HG_ARCHETYPE "0")<br>-set(GIT_ARCHETYPE "0")<br> <br> #Find version control software to be used for live and extracted repositories from compressed tarballs<br> if(CMAKE_VERSION VERSION_LESS "2.8.10")<br>@@ -43,10 +41,10 @@ else()<br> endif()<br> if(HG_EXECUTABLE)<br>     #Set Version Control binary for source code kind<br>-    if(EXISTS CMAKE_CURRENT_SOURCE_DIR}/../.hg_archival.txt)<br>+    if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.hg_archival.txt)<br>         set(HG_ARCHETYPE "1")<br>     elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.hg)<br>-        set(HG_ARCHETYPE "2")<br>+        set(HG_ARCHETYPE "0")<br>     endif()<br> endif(HG_EXECUTABLE)<br> find_package(Git QUIET) #No restrictions on Git versions used, any versions from 1.8.x to 2.2.x or later should do.<br>@@ -54,14 +52,14 @@ if(Git_FOUND)<br>     find_program(GIT_EXECUTABLE git)<br>     message(STATUS "GIT_EXECUTABLE ${GIT_EXECUTABLE}")<br>     if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.git)<br>-        set(GIT_ARCHETYPE "2")<br>+        set(GIT_ARCHETYPE "0")<br>     elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../x265Version.txt)<br>         set(GIT_ARCHETYPE "1")<br>     endif()<br> endif(Git_FOUND)<br>-if(HG_ARCHETYPE STREQUAL "1")<br>+if(HG_ARCHETYPE)<br>     #Read the lines of the archive summary file to extract the version<br>-    message(STATUS "SOURCE CODE IS FROM x265 ARCHIVED ZIP OR TAR BALL")<br>+    message(STATUS "SOURCE CODE IS FROM x265 HG ARCHIVED ZIP OR TAR BALL")<br>     file(READ ${CMAKE_CURRENT_SOURCE_DIR}/../.hg_archival.txt archive)<br>     STRING(REGEX REPLACE "\n" ";" archive "${archive}")<br>     foreach(f ${archive})<br>@@ -79,7 +77,8 @@ if(HG_ARCHETYPE STREQUAL "1")<br>         string(SUBSTRING "${hg_node}" 0 12 X265_REVISION_ID)<br>     endif()<br>     message(STATUS "HG ARCHIVAL INFORMATION PROCESSED")<br>-elseif(HG_ARCHETYPE STREQUAL "2")<br>+elseif(NOT DEFINED GIT_ARCHETYPE)<br>+# means that's its neither hg archive nor git clone/archive hence it has to be hg live repo as these are only four cases that need to processed in mutual exclusion.<br>     execute_process(COMMAND<br>         ${HG_EXECUTABLE} log -r. --template "{latesttag}"<br>         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}<br>@@ -107,33 +106,8 @@ elseif(HG_ARCHETYPE STREQUAL "2")<br>         string(SUBSTRING ${X265_LATEST_TAG} 1 -1 X265_LATEST_TAG)<br>     endif()<br>     message(STATUS "HG LIVE REPO STATUS CHECK DONE")<br>-elseif(GIT_ARCHETYPE STREQUAL "2")<br>-    execute_process(<br>-        COMMAND<br>-        ${GIT_EXECUTABLE} describe --abbrev=0 --tags<br>-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}<br>-        OUTPUT_VARIABLE X265_LATEST_TAG<br>-        ERROR_QUIET<br>-        OUTPUT_STRIP_TRAILING_WHITESPACE<br>-        )<br>-    execute_process(<br>-        COMMAND<br>-        ${GIT_EXECUTABLE} rev-list ${X265_LATEST_TAG}.. --count --first-parent<br>-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}<br>-        OUTPUT_VARIABLE X265_TAG_DISTANCE<br>-        ERROR_QUIET<br>-        OUTPUT_STRIP_TRAILING_WHITESPACE<br>-        )<br>-    execute_process(<br>-        COMMAND<br>-        ${GIT_EXECUTABLE} log --pretty=format:%h -n 1<br>-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}<br>-        OUTPUT_VARIABLE X265_REVISION_ID<br>-        ERROR_QUIET<br>-        OUTPUT_STRIP_TRAILING_WHITESPACE<br>-        )<br>-elseif(GIT_ARCHETYPE STREQUAL "1")<br>-    message(STATUS "X265 GIT ARCHIVE EXTRACT VERSION INFORMATION PROCESSING")<br>+elseif(GIT_ARCHETYPE)<br>+    message(STATUS "SOURCE CODE IS FROM x265 GIT ARCHIVED ZIP OR TAR BALL")<br>     #Read the lines of the archive summary file to extract the version<br>     file(READ ${CMAKE_CURRENT_SOURCE_DIR}/../x265Version.txt filebuf)<br>     STRING(REGEX REPLACE "\n" ";" filebuf "${filebuf}")<br>@@ -152,42 +126,53 @@ elseif(GIT_ARCHETYPE STREQUAL "1")<br>             message(WARNING "RELEASE CHANGESET INFO NOT PRESENT IN VERSION FILE")<br>         endif()<br>         if(DEFINED git_repositorychangeset)<br>-           string(SUBSTRING "${git_repositorychangeset}" 0 9 X265_REPO_ID)<br>+            string(SUBSTRING "${git_repositorychangeset}" 0 9 X265_REVISION_ID)<br>         else()<br>-           message(STATUS "X265 LATEST COMMIT TIP INFORMATION NOT AVAILABLE")<br>+            message(STATUS "X265 LATEST COMMIT TIP INFORMATION NOT AVAILABLE")<br>         endif()<br>         if(DEFINED git_releasetagdistance)<br>-           set(X265_TAG_DISTANCE ${git_releasetagdistance})<br>+            set(X265_TAG_DISTANCE ${git_releasetagdistance})<br>         else()<br>-           message(WARNING "COMMIT INFORMATION AFTER LATEST REVISION UNAVAILABLE")<br>+            message(WARNING "COMMIT INFORMATION AFTER LATEST REVISION UNAVAILABLE")<br>         endif()<br>     else()<br>         message(WARNING "X265 RELEASE VERSION LABEL MISSING: ${X265_LATEST_TAG}")<br>     endif()<br>+  message(STATUS "GIT ARCHIVAL INFORMATION PROCESSED")<br>+else()<br>+    execute_process(<br>+        COMMAND<br>+        ${GIT_EXECUTABLE} describe --abbrev=0 --tags<br>+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}<br>+        OUTPUT_VARIABLE X265_LATEST_TAG<br>+        ERROR_QUIET<br>+        OUTPUT_STRIP_TRAILING_WHITESPACE<br>+        )<br>+    execute_process(<br>+        COMMAND<br>+        ${GIT_EXECUTABLE} rev-list ${X265_LATEST_TAG}.. --count --first-parent<br>+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}<br>+        OUTPUT_VARIABLE X265_TAG_DISTANCE<br>+        ERROR_QUIET<br>+        OUTPUT_STRIP_TRAILING_WHITESPACE<br>+        )<br>+    execute_process(<br>+        COMMAND<br>+        ${GIT_EXECUTABLE} log --pretty=format:%h -n 1<br>+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}<br>+        OUTPUT_VARIABLE X265_REVISION_ID<br>+        ERROR_QUIET<br>+        OUTPUT_STRIP_TRAILING_WHITESPACE<br>+        )<br>+    message(STATUS "GIT LIVE REPO VERSION RETRIEVED")<br> endif()<br> <br>-# formatting based on positive or negative distance from tag<br>+# formatting based on distance from tag<br> if(X265_TAG_DISTANCE STREQUAL "0")<br>-    if(X265_REVISION_ID STREQUAL X265_REPO_ID)<br>-        set(X265_VERSION "${X265_LATEST_TAG}")<br>-    else()<br>-        message(WARNING "REPO AND RELEASE CHANGESETS NOT MATCHING")<br>-    endif()<br>+    set(X265_VERSION "${X265_LATEST_TAG}")<br> elseif(X265_TAG_DISTANCE STRGREATER "0")<br>-    if(X265_REVISION_ID STRLESS X265_REPO_ID)<br>-        set(X265_VERSION "${X265_LATEST_TAG}+${X265_TAG_DISTANCE}-${X265_REVISION_ID}")<br>-    else()<br>-        message(WARNING "ARCCHIVE TIP CHANGESET TO BE GREATER THAN REVISION ID")<br>-    endif()<br>-elseif(X265_TAG_DISTANCE STRLESS "0")<br>-    if(X265_REVISION_ID STRGREATER X265_REPO_ID)<br>-       set(X265_VERSION "${X265_LATEST_TAG}${X265_TAG_DISTANCE}+${X265_REPO_ID}")<br>-    else()<br>-        message(WARNING "REVISION ID EXPECTED TO BE LARGER THAN ARCHIVE TIP CHANGESET")<br>-    endif()<br>-else()<br>-    message(ERROR "Inappropriate set of version information")<br>+    set(X265_VERSION "${X265_LATEST_TAG}+${X265_TAG_DISTANCE}-${X265_REVISION_ID}")<br> endif()<br> <br> #will always be printed in its entirety based on version file configuration to avail revision monitoring by repo owners<br>-message(STATUS "x265 RELEASE VERSION ${X265_VERSION}")<br>+message(STATUS "X265 RELEASE VERSION ${X265_VERSION}")<br>-- <br>2.20.1.windows.1<br></div></blockquote><div>[AM] The need for releasetagcommitid is still not clear. Why do we need that?</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><b style="background-color:rgb(255,255,255)"><font color="#0b5394">With Regards,</font></b><div><b style="background-color:rgb(255,255,255)"><font color="#0b5394">Srikanth Kurapati.</font></b></div></div></div></div>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org" target="_blank">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font face="georgia, serif">Regards,</font><div><b><font face="georgia, serif">Aruna Matheswaran,</font></b></div><div><font face="georgia, serif">Video Codec Engineer,</font></div><div><font face="georgia, serif">Media & AI analytics BU,</font></div><div><span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><span style="border:none;display:inline-block;overflow:hidden;width:153px;height:58px"><img src="https://lh5.googleusercontent.com/gjX5cPNIZgwUrhfqkTwQUZWztIKmmo0qs3kbwvkS5H-bDVE2ftte9pMTVnFLSjOcjYWLtfc6_OGpxW4vraLg2r5QAIf1Q3MpldFDgWtzK_gXi8ptw5B3joIbsGL6mxj-JRdjHzT5" width="96" height="36" style="margin-left: 0px; margin-top: 0px;"></span></span></span><font face="georgia, serif"><br></font></div><div><span><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;vertical-align:baseline;white-space:pre-wrap"><span style="border:none;display:inline-block;overflow:hidden;width:153px;height:58px"><img src="https://lh5.googleusercontent.com/gjX5cPNIZgwUrhfqkTwQUZWztIKmmo0qs3kbwvkS5H-bDVE2ftte9pMTVnFLSjOcjYWLtfc6_OGpxW4vraLg2r5QAIf1Q3MpldFDgWtzK_gXi8ptw5B3joIbsGL6mxj-JRdjHzT5" style="margin-left: 0px; margin-top: 0px;"></span></span></span><font face="georgia, serif"><br></font></div><div><font face="georgia, serif"><br></font></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
x265-devel mailing list<br>
<a href="mailto:x265-devel@videolan.org" target="_blank">x265-devel@videolan.org</a><br>
<a href="https://mailman.videolan.org/listinfo/x265-devel" rel="noreferrer" target="_blank">https://mailman.videolan.org/listinfo/x265-devel</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><b style="background-color:rgb(255,255,255)"><font color="#0b5394">With Regards,</font></b><div><b style="background-color:rgb(255,255,255)"><font color="#0b5394">Srikanth Kurapati.</font></b></div></div></div>