Skip to content

Git-specific updates: Adding new .gitignore files and rules, updating tools/update_fork.pl#49

Merged
mkavulich merged 8 commits intowrf-model:masterfrom
mkavulich:more_git_updates
Dec 16, 2016
Merged

Git-specific updates: Adding new .gitignore files and rules, updating tools/update_fork.pl#49
mkavulich merged 8 commits intowrf-model:masterfrom
mkavulich:more_git_updates

Conversation

@mkavulich
Copy link
Contributor

@mkavulich mkavulich commented Dec 1, 2016

TYPE: no impact

KEYWORDS: Git, .gitignore, update_fork.pl

SOURCE: internal

DESCRIPTION OF CHANGES:

One of the issues in both SVN and Git is that if you have compiled code, there will be hundreds, if not thousands, of unversioned files that pollute the display when you try to view the status of your working copy. In Git, this can be handled by .gitignore files: a list of file names (or wildcards) in these files will allow git to ignore these files when displaying, for example, the results of git status.

We have already added a few .gitignore files, this proposal adds a few other ones, and adds new rules to the existing files.

In addition, this change includes updates to the script tools/update_fork.pl. The previous version automatically changed to the master before performing the update: the script now prompts the user to switch to the master branch rather than doing it automatically. This should avoid some confusion users have had. In addition, the script now refuses to update if there are any changes to the local master (fast-forward merges only). This will also avoid messing up your fork's history in case you made changes to your fork's master branch.

LIST OF MODIFIED FILES:

M .gitignore
A external/.gitignore
A inc/.gitignore
A test/em_real/.gitignore
M tools/update_fork.pl
A var/.gitignore
A var/build/.gitignore

TESTS CONDUCTED: No standard tests necessary; does not impact compiled code. Looked at before and after of git status with WRF and WRFDA builds: hundreds of compile-time files are now successfully ignored. update_fork.pl now quits with a useful warning message if user attempts to run while not on the master branch.

 - Updating "update_fork.pl" script so that it is even *less* likely to mess things up (aborts if a fast-forward merge is not possible)
 - Update top-level .gitignore file to include ".a" and ".backup" files
 - Add new .gitignore files to external/, inc/ and var/build/ directories

With the new .gitignore rules, there are now ~25 compile-time files listed on a `git status` with WRFDA built code, rather than the previous >100
…less than 20 unignored build files for standard WRF build.
… more helpful error message for the git fetch stage in case it fails
@jamiebresch
Copy link
Contributor

To view status of tracked files only, use
git status -uno

…les by adding *.f90 rule to top-level .gitignore, then adding exceptions in external/.gitignore and var/.gitignore.
@mkavulich
Copy link
Contributor Author

@negin513 I have updated the gitignore structures to use the exception rules you mentioned. Now there will be a top-level rule to ignore *.f90 files, with exceptions noted in external/.gitignore and a new var/.gitignore file. This removes the need for .gitignore files in dyn_em/, frame/, main/, phys/, and share/.

Copy link
Contributor

@davegill davegill left a comment

Choose a reason for hiding this comment

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

Approved by WRF Dev

@mkavulich mkavulich merged commit 0ecff85 into wrf-model:master Dec 16, 2016
@mkavulich mkavulich deleted the more_git_updates branch September 19, 2017 22:49
letmaik added a commit to TEB-model/wrf-teb that referenced this pull request Jan 17, 2021
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.

3 participants