From da8240794b681f1dcd62feb6aead0b15dc290c08 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Tue, 30 Nov 2021 15:55:11 -0700 Subject: [PATCH 1/4] Track .nc files via git lfs --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index e9f0bd7694..3ab9b6ad54 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,3 +4,4 @@ *.jpeg filter=lfs diff=lfs merge=lfs -text *.gif filter=lfs diff=lfs merge=lfs -text *.pdf filter=lfs diff=lfs merge=lfs -text +*.nc filter=lfs diff=lfs merge=lfs -text From 129e3210a94286e01e72d1282a24ca1e5fd5cb9d Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 1 Dec 2021 12:17:28 -0700 Subject: [PATCH 2/4] Have git lfs auto-fetch netcdf files, but not other files --- .lfsconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.lfsconfig b/.lfsconfig index 3d2778fad3..e97d0e2c7d 100644 --- a/.lfsconfig +++ b/.lfsconfig @@ -1,2 +1,7 @@ [lfs] - fetchexclude = * + # We auto-fetch any netCDF files, because they are needed for + # running tests; however, we do NOT auto-fetch other binary + # files, in particular image files that are part of the + # documentation source (these are fetched as part of the + # documentation build process). + fetchinclude = *.nc From 1ebce9975852ea5e822b15c56025f217b47499e2 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 1 Dec 2021 18:02:53 -0700 Subject: [PATCH 3/4] Don't ignore netcdf files in the upcoming testinputs directory --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9b97e8c3c0..1c9f52fe14 100644 --- a/.gitignore +++ b/.gitignore @@ -13,8 +13,10 @@ manage_externals.log **/.svn/** .svn/ -# binary files +# netcdf files *.nc +# but don't ignore netcdf files here: +!/python/ctsm/test/testinputs/*.nc # editor files *.swp From 5958cc78d87b02072d908b5f5cebcb86a8edd1c1 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 2 Dec 2021 22:17:31 -0700 Subject: [PATCH 4/4] Add a README file about adding netCDF files to the testinputs directory --- python/ctsm/test/testinputs/README.md | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 python/ctsm/test/testinputs/README.md diff --git a/python/ctsm/test/testinputs/README.md b/python/ctsm/test/testinputs/README.md new file mode 100644 index 0000000000..8b4d4d0aba --- /dev/null +++ b/python/ctsm/test/testinputs/README.md @@ -0,0 +1,35 @@ +Any netCDF files in this directory (and elsewhere in the repository) should be +stored via Git LFS (Large File Support). To retrieve any netCDF files, or to add +or modify any netCDF files, you will need to install the Git LFS tool. + +Installing Git LFS on your machine is a two-step process; step (1) needs to be +done once per machine, and step (2) needs to be done once per user: +1. Install the Git LFS tool: Follow the instructions on the [Git LFS +page](https://git-lfs.github.com/) for installing Git LFS on your platform. + - On cheyenne, Git LFS is already available as long as you are using a git + module rather than the default system-level git. So just make sure that you + are always using git via a git module (`module load git`). + - On a Mac using homebrew, this can be done with `brew install git-lfs`. +2. Set up your git configuration to use Git LFS by running: `git lfs install` + (this will add a few lines to your `.gitconfig` file in your home directory). + (If you're not sure whether you have already done this, it is safe to rerun + that command to be sure.) + +If any netCDF file appears to be a text file like this: + +``` +version https://git-lfs.github.com/spec/v1 +oid sha256:df03c76138bbdcdd12497a4bb0a86591283d1d8ef90cba80d823660f549381c0 +size 896 +``` + +then that is a sign that you may not have Git LFS installed. You can first try +running "git lfs pull". If that doesn't work, then install Git LFS as documented +above. + +For more information on using Git LFS with CTSM, search for lfs here: +. +Most of the notes about using Git LFS for the documentation's image files apply +here as well, although (in contrast to image files) netCDF files *are* pulled +down by default, so you usually should *not* need to explicitly run `git lfs +pull` to get new or updated netCDF files.