Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
Hello all, Sorry for bringing up an old thread, you can find the original thread here: http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/8658 I pushed the topic again with no changes (just a rebase), I've been using it for a while with no issues at all. Is it ok to merge it to next? Cheers, Daniele -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
On 03/27/2014 11:16 AM, Daniele E. Domenichelli wrote: Is it ok to merge it to next? Yes, but let's do only one change to ExternalProject per day so we can see how the tests do. Thanks, -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
On 03/27/2014 11:34 AM, Brad King wrote: On 03/27/2014 11:16 AM, Daniele E. Domenichelli wrote: Is it ok to merge it to next? Yes, but let's do only one change to ExternalProject per day so we can see how the tests do. Please take a look at the failure on the continuous test submissions. fatal: Couldn't find remote ref origin/master fatal: The remote end hung up unexpectedly Thanks, -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
On 03/27/2014 02:35 PM, Brad King wrote: Please take a look at the failure on the continuous test submissions. fatal: Couldn't find remote ref origin/master fatal: The remote end hung up unexpectedly Is there a particular version requirement on Git? Also I just noticed this line: +COMMAND \${git_EXECUTABLE}\ stash --all --quiet That should be stash save --all --quiet because git stash may some day do nothing without the explicit save command. -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
On 03/27/2014 02:35 PM, Brad King wrote: Please take a look at the failure on the continuous test submissions. fatal: Couldn't find remote ref origin/master fatal: The remote end hung up unexpectedly I see this fix, thanks: ExternalProject: Strip out origin/ from git tag http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=40bf640c + if(${git_tag} MATCHES ^origin/(.+)$) +set(git_tag ${CMAKE_MATCH_1}) + endif() Until now we made no assumption about the name of the remote. What guarantee do we have that it is called origin? Perhaps instead the logic that sets is_remote_ref can determine the name of the remote since it checks the refs/remotes namespace. Thanks, -Brad -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
On 27/03/14 19:45, Brad King wrote: On 03/27/2014 02:35 PM, Brad King wrote: Please take a look at the failure on the continuous test submissions. fatal: Couldn't find remote ref origin/master fatal: The remote end hung up unexpectedly Is there a particular version requirement on Git? I don't think so. I believe the problem was the origin/ in the tag. I just pushed a fix that strips origin/ from the tag to see if this fixes the tests, but I'm not sure if this is correct, what if the tag/branch name is actually origin/something? I think I can do something better by parsing the output of git show-ref ${git_tag}. I will try later. Also I just noticed this line: +COMMAND \${git_EXECUTABLE}\ stash --all --quiet That should be stash save --all --quiet because git stash may some day do nothing without the explicit save command. Fixed. Daniele -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
On Mon, Nov 18, 2013 at 12:19:55 +0100, Daniele E. Domenichelli wrote: If there are local changes, git stash is used to save the changes and restore them after the pull. If any of these operation fails, it tries to restore the original status and exits with a fatal error, asking the user to resolve the conflicts manually. I like the `--all` usage, but I see that `--index` is passed to `stash pop`, but `--keep-index` isn't passed to `stash save`. Is this intended? --Ben -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
On 03/12/13 21:34, Ben Boeckel wrote: On Mon, Nov 18, 2013 at 12:19:55 +0100, Daniele E. Domenichelli wrote: If there are local changes, git stash is used to save the changes and restore them after the pull. If any of these operation fails, it tries to restore the original status and exits with a fatal error, asking the user to resolve the conflicts manually. I like the `--all` usage, but I see that `--index` is passed to `stash pop`, but `--keep-index` isn't passed to `stash save`. Is this intended? git stash save automatically saves the index, that is restored using git stash pop --index. The --keep-index does not save the index but instead keeps it in the working tree. This means that after stashing you will still have a dirty working tree, and therefore rebase will fail. Cheers, Daniele -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
On Tue, Dec 03, 2013 at 23:09:38 +0100, Daniele E. Domenichelli wrote: git stash save automatically saves the index, that is restored using git stash pop --index. The --keep-index does not save the index but instead keeps it in the working tree. This means that after stashing you will still have a dirty working tree, and therefore rebase will fail. Ah, right. Misread the docs for it. Thanks, --Ben -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
Hi Daniele, Brad, On Tue, Nov 26, 2013 at 3:57 AM, Daniele E. Domenichelli daniele.domeniche...@gmail.com wrote: On 25/11/13 18:04, Jean-Christophe Fillion-Robin wrote: After copying the ExternalProject.cmake in the Module directory of the CMake installation I used for daily work, I didn't see any issue / side effect. Considering the external projects I am dealing with always specify the SHA1, I didn't have a chance to explicitly test the case if(is_remote_ref) ... Thanks for testing! Did anyone try it with a remote branch? Testing locally, it worked great for me! Thanks, Matt -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
On 25/11/13 18:04, Jean-Christophe Fillion-Robin wrote: After copying the ExternalProject.cmake in the Module directory of the CMake installation I used for daily work, I didn't see any issue / side effect. Considering the external projects I am dealing with always specify the SHA1, I didn't have a chance to explicitly test the case if(is_remote_ref) ... Thanks for testing! Did anyone try it with a remote branch? Cheers, Daniele -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
Hi Daniele, After copying the ExternalProject.cmake in the Module directory of the CMake installation I used for daily work, I didn't see any issue / side effect. Considering the external projects I am dealing with always specify the SHA1, I didn't have a chance to explicitly test the case if(is_remote_ref) ... Hth Jc On Fri, Nov 22, 2013 at 1:06 PM, Brad King brad.k...@kitware.com wrote: Jc, Matt, On 11/18/2013 10:10 AM, Jean-Christophe Fillion-Robin wrote: Will give a try and let you know how it goes. [snip] On 11/18/2013 12:40 PM, Matt McCormick wrote: I have checkout out the branch, will test it locally, and make any notes of unexpected behavior. Thanks for looking at this topic. Once you have reported back from local experimentation we can proceed with it. Thanks, -Brad -- +1 919 869 8849 -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
Jc, Matt, On 11/18/2013 10:10 AM, Jean-Christophe Fillion-Robin wrote: Will give a try and let you know how it goes. [snip] On 11/18/2013 12:40 PM, Matt McCormick wrote: I have checkout out the branch, will test it locally, and make any notes of unexpected behavior. Thanks for looking at this topic. Once you have reported back from local experimentation we can proceed with it. Thanks, -Brad -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
[cmake-developers] Review Request: Topic ExternalProject_GitUpdate
Hello, Please review the topic ExternalProject_GitUpdate ExternalProject handles git remote branches by commit hash. Due to this, the git repository ends in detached states, and local commits are discarded. This patch uses git pull --rebase for remote branches instead of git checkout. If there are local changes, git stash is used to save the changes and restore them after the pull. If any of these operation fails, it tries to restore the original status and exits with a fatal error, asking the user to resolve the conflicts manually. This also makes the behaviour of ExternalProject using git more similar to the svn version, and probably more likely to what the user expects by setting GIT_TAG to a branch. Cheers, Daniele -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
Hi Daniele, This is a great improvement. It is so easy to loose local change to an external project A made while debugging/tweaking it for a better interaction into an other project B with B depending on A. Will give a try and let you know how it goes. Thanks Jc On Mon, Nov 18, 2013 at 6:19 AM, Daniele E. Domenichelli daniele.domeniche...@gmail.com wrote: Hello, Please review the topic ExternalProject_GitUpdate ExternalProject handles git remote branches by commit hash. Due to this, the git repository ends in detached states, and local commits are discarded. This patch uses git pull --rebase for remote branches instead of git checkout. If there are local changes, git stash is used to save the changes and restore them after the pull. If any of these operation fails, it tries to restore the original status and exits with a fatal error, asking the user to resolve the conflicts manually. This also makes the behaviour of ExternalProject using git more similar to the svn version, and probably more likely to what the user expects by setting GIT_TAG to a branch. Cheers, Daniele -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers -- +1 919 869 8849 -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
I am understanding properly that the last paragraph properly, this will fix the problem that setting GIT_TAG to a named branch doesn't keep the branch up to date with the remotes version of the branch? Overall I really like this change to ExternalProject, and I see it being more in line with how I would guess GIT_TAG to behave like. On Mon, Nov 18, 2013 at 6:19 AM, Daniele E. Domenichelli daniele.domeniche...@gmail.com wrote: Hello, Please review the topic ExternalProject_GitUpdate ExternalProject handles git remote branches by commit hash. Due to this, the git repository ends in detached states, and local commits are discarded. This patch uses git pull --rebase for remote branches instead of git checkout. If there are local changes, git stash is used to save the changes and restore them after the pull. If any of these operation fails, it tries to restore the original status and exits with a fatal error, asking the user to resolve the conflicts manually. This also makes the behaviour of ExternalProject using git more similar to the svn version, and probably more likely to what the user expects by setting GIT_TAG to a branch. Cheers, Daniele -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
Hi Daniele, Thanks for the contribution! Code review looks good -- I like how there is a reset --hard to the previous head_sha and message if the stash pop does not work as expected. I have checkout out the branch, will test it locally, and make any notes of unexpected behavior. Thanks, Matt On Mon, Nov 18, 2013 at 10:39 AM, Robert Maynard robert.mayn...@kitware.com wrote: I am understanding properly that the last paragraph properly, this will fix the problem that setting GIT_TAG to a named branch doesn't keep the branch up to date with the remotes version of the branch? Overall I really like this change to ExternalProject, and I see it being more in line with how I would guess GIT_TAG to behave like. On Mon, Nov 18, 2013 at 6:19 AM, Daniele E. Domenichelli daniele.domeniche...@gmail.com wrote: Hello, Please review the topic ExternalProject_GitUpdate ExternalProject handles git remote branches by commit hash. Due to this, the git repository ends in detached states, and local commits are discarded. This patch uses git pull --rebase for remote branches instead of git checkout. If there are local changes, git stash is used to save the changes and restore them after the pull. If any of these operation fails, it tries to restore the original status and exits with a fatal error, asking the user to resolve the conflicts manually. This also makes the behaviour of ExternalProject using git more similar to the svn version, and probably more likely to what the user expects by setting GIT_TAG to a branch. Cheers, Daniele -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
Re: [cmake-developers] Review Request: Topic ExternalProject_GitUpdate
On 18/11/13 16:39, Robert Maynard wrote: I am understanding properly that the last paragraph properly, this will fix the problem that setting GIT_TAG to a named branch doesn't keep the branch up to date with the remotes version of the branch? Yes, exactly... setting GIT_TAG to master (or any other branch) will cause it to run git fetch, git stash (if necessary), git pull --rebase, git stash pop. At the end you will have the updated branch with your local commit on top of it. If any error occurred, the state before the update will be restored and you will have a FATAL_ERROR asking you to handle the situation manually. Daniele -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers