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

Update C-git-commands.asc with a new TextEdit command #1650

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pibion
Copy link

@pibion pibion commented May 21, 2021

Changes

  • Update C-git-commands.asc with a new TextEdit command

Context

The existing git config instructions for TextEdit on Mac would hang after closing the TextEdit program. The instructions outlined in https://ericasadun.com/2018/07/12/using-textedit-as-your-git-editor/ worked and I propose updating the book with her solution.

@@ -62,7 +62,7 @@ Accompanying the configuration instructions in <<ch01-getting-started#_editor>>,
|Scratch (Linux)|`git config --global core.editor "scratch-text-editor"`
|Sublime Text (macOS) |`git config --global core.editor "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl --new-window --wait"`
|Sublime Text (Windows 64-bit) |`git config --global core.editor "'C:\Program Files\Sublime Text 3\sublime_text.exe' -w"` (Also see note below)
|TextEdit (macOS)|`git config --global core.editor "open --wait-apps --new -e"`
|TextEdit (macOS)|`git config --global core.editor "open -W -n"`
Copy link
Member

Choose a reason for hiding this comment

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

Three things:

  1. The -W flag is short for --wait-apps, and -n is short for --new. When we're writing something that will go into a file and be forgotten until we're trying to figure out why it broke, we want to optimize for readability, so I'd prefer we keep the long version of the flags here.
  2. The -e flag specifies that the file should be opened in TextEdit. Without it, you'll get whatever app registers itself as the default app for plain text files. We're specifically trying to get TextEdit here, so removing the -e flag just makes this less specific.
  3. I just tested both variations of this, and they behave the same? You have to actually command-Q the app to make open recognize that it's done, but otherwise I don't see a difference.

Copy link
Author

Choose a reason for hiding this comment

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

Keeping the long version of the flags makes sense.

I'm not sure why we saw a different behavior on our system between these two commands, and I'll see if we can re-test to confirm that we weren't imagining things.

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.

None yet

2 participants