RSE-Sheffield / fair4rs-lesson-setup

Instructions for setting up a lesson repository for the University of Sheffield FAIR4RS training programme
Creative Commons Attribution 4.0 International
1 stars 0 forks source link

fair4rs_config.patch not applied #20

Closed RicCampbell closed 7 months ago

RicCampbell commented 7 months ago

Patch was copied and saved locally in notepad, running through the RStudio terminal via the command given and receive the following message:

$ git apply --index 'U:\R Projects\fair4rs_config.patch' U:/R Projects/fair4rs_config.patch:7: trailing whitespace.

This CITATION.cff file was generated with cffinit.

U:/R Projects/fair4rs_config.patch:8: trailing whitespace.

Visit https://bit.ly/cffinit to generate yours today!

U:/R Projects/fair4rs_config.patch:9: trailing whitespace.

U:/R Projects/fair4rs_config.patch:10: trailing whitespace. cff-version: 1.2.0 U:/R Projects/fair4rs_config.patch:11: trailing whitespace. title: Lesson Title # FIXME error: corrupt patch at line 147

tdjames1 commented 7 months ago

Hi @RicCampbell,

As the error message suggests, notepad has added some whitespace to the patch file which means that the patch fails to apply.

Could you go to the link for the patch file again: https://raw.githubusercontent.com/RSE-Sheffield/fair4rs-lesson-setup/main/fair4rs_config.patch

and try right click > "save page as" to save the file to your computer without touching notepad?

Then try running the git apply command again. :crossed_fingers:

RicCampbell commented 7 months ago

Hi @tdjames1 ,

That seems to have done it! I knew not to have it touch anything, but haven't right click saved anything in so long didn't occur to me.

Sided note, it still saves it as a text file on windows, so the git apply command has to be run on '...config.patch.txt'

Thank you!

tdjames1 commented 7 months ago

Thanks @RicCampbell that's useful info - I'll make a note to update the README.

ns-rse commented 7 months ago

Sided note, it still saves it as a text file on windows, so the git apply command has to be run on '...config.patch.txt'

This is a symptom of M$-Windows than GitHub (saves as config.patch under GNU/Linux, can't speak for OSX).

You can always modify file extensions from the File Manager but by default these are not shown so you have to go to View > Show File Extensions and then you can remove the extraneous .txt that was added.