NVIDIAGameWorks / RayTracingDenoiser

NVIDIA Ray Tracing Denoiser
Other
504 stars 46 forks source link

git .modules #56

Closed r2d2Proton closed 1 year ago

r2d2Proton commented 1 year ago

Just a friendly note. I may be misusing git but it appears that submodules will not update unless you go the module folder and issue a checkout command. For example, if I clone the donut repo, I use the following commands

git clone --recursive https://github.com/NVIDIAGameWorks/donut CD donut git submodule update --init --recursive CD nvrhi git checkout main CD ..\thirdparty\imgui git checkout master CD ..\lz4 git checkout release

Can someone confirm that the head is detached? Also, how I should be updating the submodules with git?

gitsubmoduleupdateinitrecursive

djbelyak commented 1 year ago

That's an expected git behavior. "Pinning" dependencies to a particular commit guarantees a project will be shipped with correct versions of the dependencies. If you use git pull --recurse-submodules, you'll get the latest version of project with author's defined versions of dependencies.

You may change the default git behavior with git config -f .gitmodules submodule.$name.update merge where $name is a a submodule name, but a dependency managment becomes a your headache ;-)

r2d2Proton commented 1 year ago

Thank you Ivan. Either the command I am entering is wrong, or it doesn't work the way we think it does. Again, it could be my misunderstanding. As you may know, donut has a dependency on nvrhi. I added a small modification "Test" under Introduction to nvrhi::README.md:

### Test

And cloned the donut repo with:

git clone --recursive https://github.com/r2d2Proton/donut cd donut git pull --recurse-submodules

Notice in the first image below Test is missing. Also notice that the head is detached in nvrhi. In the second image, after the git checkout main, the current files is pulled from the repo. Am I doing something wrong?

One 01

One 02

dzhdanNV commented 1 year ago

@djbelyak Thanks Ivan!

@r2d2Proton Ivan's clarifications, plus the fact that a "Donut" discussion happens in "NRD" repo, seem to be enough to close the issue. Feel free to reopen in "Donut" repo.

r2d2Proton commented 1 year ago

This is not just a donut repo issue. If I am right, this is an across the board issue. Of course, you would expect git to make sure the repo version is tagged. Likewise, you would expect git to honor the request to get the latest changes out of the repos. But that is not occurring, at least not using the commands we are. Feel free to move the issue or reopen it.

dzhdanNV commented 1 year ago

> Likewise, you would expect git to honor the request to get the latest changes out of the repos

I don't expect it. At any time a user gets the version which was the latest at the moment of update. Not the real latest. There can be changes breaking compatibility. During an NRD repo update I always update ALL related submodules to the latest (NRD is somewhere in between).

r2d2Proton commented 1 year ago

During an NRD repo update I always update ALL related submodules to the latest (NRD is somewhere in between).

How?

djbelyak commented 1 year ago

The update procedure looks like about:

cd External/MathLib
git pull origin main
cd ../..
# Update NRD code to work with the latest version of MathLib + version updates
git commit -a
git push origin master
r2d2Proton commented 1 year ago

The update procedure looks like about:

cd External/MathLib
git pull origin main
cd ../..
# Update NRD code to work with the latest version of MathLib + version updates
git commit -a
git push origin master

Thank you again Ivan. I have been doing git checkout <branchName> but I noticed you are using git pull origin <branchName>

I need to look at the difference between the two commands. And update my batch files :)