Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change the use of git checkout to git restore #927

Merged
merged 4 commits into from
Jul 18, 2024

Conversation

kleuveld
Copy link
Contributor

@kleuveld kleuveld commented Jun 5, 2023

I noticed that my version of git ( (2.36.1.windows.1) doesn't prompt the user to use git checkout to restore files. It uses git restore. This is much safer, and can't lead to nasty stuff like detached heads, so probably better for learners. I went ahead and changed all the references to git checkout to git restore.

What did I update:

  • I changed git output to show what my version of git shows
  • I replaced all instances of git checkout with the relevant git restore command, including in exercises.
  • I changed two pictures to use git restore. However, I don't have a SVG editor, so it looks fairly ugly. So that probably needs some work still.

@github-actions
Copy link

github-actions bot commented Jun 5, 2023

Thank you!

Thank you for your pull request 😃

🤖 This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}.

If you have files that automatically render output (e.g. R Markdown), then you should check for the following:

  • 🎯 correct output
  • 🖼️ correct figures
  • ❓ new warnings
  • ‼️ new errors

Rendered Changes

🔍 Inspect the changes: https://github.com/swcarpentry/git-novice/compare/md-outputs..md-outputs-PR-927

The following changes were observed in the rendered markdown documents:

 05-history.md             | 150 ++++++++++++++--------------------------------
 fig/git-restore.svg (new) | 111 ++++++++++++++++++++++++++++++++++
 fig/git_staging.svg       |   2 +-
 md5sum.txt                |   2 +-
 4 files changed, 157 insertions(+), 108 deletions(-)
What does this mean?

If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible.

This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation.

⏱️ Updated at 2024-07-18 07:32:22 +0000

Copy link
Contributor

@kekoziar kekoziar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this needed update. You missed some instances of checkout in this particular episode. Can you update your PR?

@kekoziar kekoziar added the status:changes requested Waiting for Contributor to update PR label Aug 14, 2023
@kleuveld
Copy link
Contributor Author

Hi,

Sorry for the slow reply, I was on a holiday, so it got to the bottom of the pile. I have added a new commit that should change all the remaining instances of checkout to restore.

Cheers,
koen

the PR was missing the last `git restore` needed to put `mars.txt` back in the state at the beginning of the episode (before the ill-considered change)
github-actions bot pushed a commit that referenced this pull request Sep 26, 2023
@peterjc
Copy link

peterjc commented Nov 14, 2023

See #691

@martinosorb
Copy link
Contributor

@kekoziar are you happy with the changes now? I'm happy to resolve the conflict myself, it's minor.

@martinosorb martinosorb removed the status:changes requested Waiting for Contributor to update PR label Jul 2, 2024
@martinosorb martinosorb requested a review from kekoziar July 2, 2024 15:16
github-actions bot pushed a commit that referenced this pull request Jul 18, 2024
@martinosorb martinosorb dismissed kekoziar’s stale review July 18, 2024 07:38

Requested changes were addressed by contributor

@martinosorb martinosorb removed the request for review from kekoziar July 18, 2024 07:39
@martinosorb martinosorb merged commit b33dbf2 into swcarpentry:main Jul 18, 2024
3 checks passed
github-actions bot pushed a commit that referenced this pull request Jul 18, 2024
Auto-generated via {sandpaper}
Source  : b33dbf2
Branch  : main
Author  : Martino Sorbaro <martinosorb@users.noreply.github.com>
Time    : 2024-07-18 07:39:46 +0000
Message : Merge pull request #927 from kleuveld/replace_checkout_with_restore

change the use of git checkout to git restore
github-actions bot pushed a commit that referenced this pull request Jul 18, 2024
Auto-generated via {sandpaper}
Source  : 496d4c4
Branch  : md-outputs
Author  : GitHub Actions <actions@github.com>
Time    : 2024-07-18 07:40:50 +0000
Message : markdown source builds

Auto-generated via {sandpaper}
Source  : b33dbf2
Branch  : main
Author  : Martino Sorbaro <martinosorb@users.noreply.github.com>
Time    : 2024-07-18 07:39:46 +0000
Message : Merge pull request #927 from kleuveld/replace_checkout_with_restore

change the use of git checkout to git restore
github-actions bot pushed a commit that referenced this pull request Jul 23, 2024
Auto-generated via {sandpaper}
Source  : 496d4c4
Branch  : md-outputs
Author  : GitHub Actions <actions@github.com>
Time    : 2024-07-18 07:40:50 +0000
Message : markdown source builds

Auto-generated via {sandpaper}
Source  : b33dbf2
Branch  : main
Author  : Martino Sorbaro <martinosorb@users.noreply.github.com>
Time    : 2024-07-18 07:39:46 +0000
Message : Merge pull request #927 from kleuveld/replace_checkout_with_restore

change the use of git checkout to git restore
github-actions bot pushed a commit that referenced this pull request Jul 30, 2024
Auto-generated via {sandpaper}
Source  : 496d4c4
Branch  : md-outputs
Author  : GitHub Actions <actions@github.com>
Time    : 2024-07-18 07:40:50 +0000
Message : markdown source builds

Auto-generated via {sandpaper}
Source  : b33dbf2
Branch  : main
Author  : Martino Sorbaro <martinosorb@users.noreply.github.com>
Time    : 2024-07-18 07:39:46 +0000
Message : Merge pull request #927 from kleuveld/replace_checkout_with_restore

change the use of git checkout to git restore
github-actions bot pushed a commit to WEHI-Education/git-novice that referenced this pull request Jul 30, 2024
Auto-generated via {sandpaper}
Source  : b33dbf2
Branch  : main
Author  : Martino Sorbaro <martinosorb@users.noreply.github.com>
Time    : 2024-07-18 07:39:46 +0000
Message : Merge pull request swcarpentry#927 from kleuveld/replace_checkout_with_restore

change the use of git checkout to git restore
github-actions bot pushed a commit to WEHI-Education/git-novice that referenced this pull request Jul 30, 2024
Auto-generated via {sandpaper}
Source  : 0831397
Branch  : md-outputs
Author  : GitHub Actions <actions@github.com>
Time    : 2024-07-30 06:18:41 +0000
Message : markdown source builds

Auto-generated via {sandpaper}
Source  : b33dbf2
Branch  : main
Author  : Martino Sorbaro <martinosorb@users.noreply.github.com>
Time    : 2024-07-18 07:39:46 +0000
Message : Merge pull request swcarpentry#927 from kleuveld/replace_checkout_with_restore

change the use of git checkout to git restore
github-actions bot pushed a commit that referenced this pull request Aug 6, 2024
Auto-generated via {sandpaper}
Source  : 496d4c4
Branch  : md-outputs
Author  : GitHub Actions <actions@github.com>
Time    : 2024-07-18 07:40:50 +0000
Message : markdown source builds

Auto-generated via {sandpaper}
Source  : b33dbf2
Branch  : main
Author  : Martino Sorbaro <martinosorb@users.noreply.github.com>
Time    : 2024-07-18 07:39:46 +0000
Message : Merge pull request #927 from kleuveld/replace_checkout_with_restore

change the use of git checkout to git restore
github-actions bot pushed a commit to WEHI-Education/git-novice that referenced this pull request Aug 6, 2024
Auto-generated via {sandpaper}
Source  : 0831397
Branch  : md-outputs
Author  : GitHub Actions <actions@github.com>
Time    : 2024-07-30 06:18:41 +0000
Message : markdown source builds

Auto-generated via {sandpaper}
Source  : b33dbf2
Branch  : main
Author  : Martino Sorbaro <martinosorb@users.noreply.github.com>
Time    : 2024-07-18 07:39:46 +0000
Message : Merge pull request swcarpentry#927 from kleuveld/replace_checkout_with_restore

change the use of git checkout to git restore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants