You can apply git diffs by copying the diff to a file and then running git apply <file_containing_diff>
But check this thread to make sure to dry-run first, to check what it will do, before you overwrite anything
https://stackoverflow.com/questions/2249852/how-to-apply-a-patch-generated-with-git-format-patch
ExasperatedCrab78 Such a git patch appeared to track a lot of unrelated unexecuted stuff. And was whimsical when being applied - it errored on all those unrelated code files as far as i could tell so i had to use --reject
in git apply --reject --whitespace=fix experiment-a1fbb0ecfc4e4d698e017d8356d8be52.patch
I get that this feature is probably coming from a robust reproducibility design perspective. If only there'd be a shortcut tho. For example, official Python
VSCode extension has this thing: you can execute select lines of code from a source file via Python Interactive
,and then one can export all the executed code into a standalone notebook (it will not have any other code from the source file).Gather
python VSCode extension does something similair but from notebooks: after you execute cells in the notebook it allows to export all the code that was necessary to execute that cell into a standalone notebook.
Both solutions do not stalk for changes in the whole package and personally i've found them quite enabling.
A good enough solution would be, i think, having an option of listing git diff for each file separately. So I could pick which files i wanna rollback via git apply
ExasperatedCrab78 the problem is it is saved, rendered and copied to clipboard via a button as a git diff stdout, not as a valid python code
If you didn't use git, then clearML saves your .py
script completely in the uncommited changes
section like you say. You should be able to just copy paste it to get the code. In what format are your uncommited changes logged? Can you paste a screenshot or paste the contents of uncommitted changes
?