<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 22, 2020 at 2:25 PM Srikanth Kurapati <<a href="mailto:srikanth.kurapati@multicorewareinc.com">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"><br clear="all"><div>From 123a406a4845ec228bd234693115e6ffb6bc423f 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 | 28 ++++++++++------------------<br> 1 file changed, 10 insertions(+), 18 deletions(-)<br><br>diff --git a/source/cmake/Version.cmake b/source/cmake/Version.cmake<br>index 37c759268..21730cf91 100644<br>--- a/source/cmake/Version.cmake<br>+++ b/source/cmake/Version.cmake<br>@@ -152,14 +152,14 @@ 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_REPO_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>@@ -168,25 +168,17 @@ endif()<br> <br> # formatting based on positive or negative 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>+    if(GIT_ARCHETYPE STREQUAL "1")<br></div></div></blockquote><div>[AM] Why aren't we handling HG here? </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>+        set(X265_VERSION "${X265_LATEST_TAG}+${X265_TAG_DISTANCE}-${X265_REPO_ID}")<br></div></div></blockquote><div> [AM] Use X265_REVISION_ID to hold "repositoryChangeset" in both the cases ( i.e ARCHIVE type 1 and 2).</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>     else()<br>-        message(WARNING "ARCCHIVE TIP CHANGESET TO BE GREATER THAN REVISION ID")<br>+        set(X265_VERSION "${X265_LATEST_TAG}+${X265_TAG_DISTANCE}-${X265_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>+    set(X265_VERSION "${X265_LATEST_TAG}${X265_TAG_DISTANCE}+${X265_REPO_ID}")<br></div></div></blockquote><div>[AM] With the clean up mentioned above, this section shall be eliminated.</div><div><br></div><div>[AM] Treating 

GIT_ARCHETYPE as a flag will improve code readability.</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> else()<br>-    message(ERROR "Inappropriate set of version information")<br>+    message(ERROR "Inappropriate version information")<br></div></div></blockquote><div>[AM] This else() will never take a hit. Remove this. </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> endif()<br> <br> #will always be printed in its entirety based on version file configuration to avail revision monitoring by repo owners<br>-- <br>2.20.1.windows.1<br><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" class="gmail_signature"><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>