Skip to content

Commit

Permalink
.git/safe is opt-in
Browse files Browse the repository at this point in the history
The idea behind the .git/safe is that I run it manually and explicitly
after I trust the directoy and the team behind the project.

Creating it as part of the setup script defeats the point of that. Doing
so without explcitly telling the user comes across as sneaky, perhaps.
(I do expect all devs to read setup scripts before running them -- but I
also know that they do not!)

Switch this script to inform the user that they have no `.git/safe`
directory but might like to make one.

The warning output looks like this:

```
~/thoughtbot/suspenders/foo% ./bin/setup
The Gemfile's dependencies are satisfied
Database 'foo_development' already exists
Database 'foo_test' already exists
W, [2017-04-28T10:29:08.973415 #29958]  WARN -- : [SKYLIGHT] [1.2.1] Running Skylight in development mode. No data will be reported until you deploy your app.
(To disable this message for all local apps, run `skylight disable_dev_warning`.)
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
-- enable_extension("plpgsql")
   -> 0.0081s
-- create_table("delayed_jobs", {:force=>:cascade})
   -> 0.0618s
-- initialize_schema_migrations_table()
   -> 0.0019s
-- enable_extension("plpgsql")
   -> 0.0208s
-- create_table("delayed_jobs", {:force=>:cascade})
   -> 0.0328s
-- initialize_schema_migrations_table()
   -> 0.0008s
-----------------------------------------------------------------------

-> When you trust this repo, remember to run: mkdir -p .git/safe

~/thoughtbot/suspenders/foo%
```
  • Loading branch information
mike-burns authored and seanpdoyle committed Aug 4, 2017
1 parent 141a965 commit efda495
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
`master`

* No longer generate `mkdir -p .git/safe` as part of `bin/setup`
* Update Bitters to 1.7
* Update Neat to 2.1
* Update Bourbon to 5.0.0.beta.8
Expand Down
8 changes: 6 additions & 2 deletions templates/bin_setup
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ bundle check || bundle install
# Set up database and add any development seed data
bin/rails dev:prime

# Add binstubs to PATH via export PATH=".git/safe/../../bin:$PATH" in ~/.zshenv
mkdir -p .git/safe
if [ ! -d .git/safe ] && echo $PATH | grep .git/safe > /dev/null; then
echo "-----------------------------------------------------------------------"
echo
echo "-> When you trust this repo, remember to run: mkdir -p .git/safe"
echo
fi

# Only if this isn't CI
# if [ -z "$CI" ]; then
Expand Down

0 comments on commit efda495

Please sign in to comment.