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

Add .gitattributes file #332

Merged
merged 1 commit into from
Jul 13, 2019

Conversation

phil-blain
Copy link
Member

@phil-blain phil-blain commented Jul 10, 2019

PR checklist

  • Short (1 sentence) summary of your PR:
    Add a .gitattributes file at the base of the repo
  • Developer(s):
    Philippe Blain
  • Suggest PR reviewers from list in the column to the right. @apcraig
  • Please copy the PR test results link or provide a summary of testing completed below.
    No tests needed
  • How much do the PR code changes differ from the unmodified code?
    • bit for bit
    • different at roundoff level
    • more substantial
  • Does this PR create or have dependencies on Icepack or any other models?
    • Yes
    • No
      I will do the same for Icepack if this is accepted.
  • Does this PR add any new test cases?
    • Yes
    • No
  • Is the documentation being updated? ("Documentation" includes information on the wiki or in the .rst files from doc/source/, which are used to create the online technical docs at https://readthedocs.org/projects/cice-consortium-cice/.)
    • Yes
    • No, does the documentation need to be updated at a later time?
      • Yes
      • No
  • Please provide any additional information or relevant details below:

This makes 'git diff' more useful by showing in which subroutine the shown changes are in the hunk header :
without .gitattributes (check the hunk header @@ ... @@):

$ git  diff
diff --git a/cicecore/cicedynB/dynamics/ice_dyn_vp.F90 b/cicecore/cicedynB/dynamics/ice_dyn_vp.F90
index 5533315..7e3b810 100644
--- a/cicecore/cicedynB/dynamics/ice_dyn_vp.F90
+++ b/cicecore/cicedynB/dynamics/ice_dyn_vp.F90
@@ -229,7 +229,10 @@
       type (block) :: &
          this_block           ! block information for current block
       
-      real (kind=dbl_kind), allocatable :: bvec(:), sol(:), diagvec(:)
+      real (kind=dbl_kind), allocatable :: &
+         bvec(:)     , & ! right-hand-side vector
+         sol(:),     , & ! solution vector
+         diagvec(:)      ! diagonal vector
       
       character(len=*), parameter :: subname = '(imp_solver)

with .gitattributes (check the hunk header @@ ... @@):

$ git  diff
diff --git a/cicecore/cicedynB/dynamics/ice_dyn_vp.F90 b/cicecore/cicedynB/dynamics/ice_dyn_vp.F90
index 5533315..7e3b810 100644
--- a/cicecore/cicedynB/dynamics/ice_dyn_vp.F90
+++ b/cicecore/cicedynB/dynamics/ice_dyn_vp.F90
@@ -229,7 +229,10 @@ subroutine imp_solver (dt)
       type (block) :: &
          this_block           ! block information for current block
       
-      real (kind=dbl_kind), allocatable :: bvec(:), sol(:), diagvec(:)
+      real (kind=dbl_kind), allocatable :: &
+         bvec(:)     , & ! right-hand-side vector
+         sol(:),     , & ! solution vector
+         diagvec(:)      ! diagonal vector
       
       character(len=*), parameter :: subname = '(imp_solver)'

This can also be done locally in the file .git/info/attributes but I think it's useful enough to put it in the repo.

Add diff=fortran for *.F90 files
@apcraig apcraig merged commit 93ea7a7 into CICE-Consortium:master Jul 13, 2019
@phil-blain phil-blain deleted the add-gitattributes branch July 23, 2019 18:29
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.

2 participants