fsprojects / ProjectScaffold

A prototypical .NET solution (file system layout and tooling), recommended for F# projects
http://fsprojects.github.io/ProjectScaffold
The Unlicense
515 stars 154 forks source link

Git history not cleared if remote name doesn't end with .git #315

Closed rmunn closed 6 years ago

rmunn commented 6 years ago

Description

276 is not quite fixed, because if you clone the ProjectScaffold repo by copying the URL from your browser (in which case its remote will be https://github.com/fsprojects/ProjectScaffold) then it won't be matched by the regex in init.fsx and the git history won't be cleared.

Repro steps

Please provide the steps required to reproduce the problem

  1. Clone https://github.com/fsprojects/ProjectScaffold
  2. Run ./build.sh
  3. Notice that the Git history was not cleared

Solution

The best fix, IMHO, is to add (\.git)? to the remote-matching regex so that it will also match if someone clones the repo from a remote without the .git extension.

Note that @jackfoxy's comment at https://github.com/fsprojects/ProjectScaffold/issues/276#issuecomment-345783002 should also be considered; i.e., what do we do when there's no remote?