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

Setup overwrites global (user) setting for core.editor on update #3153

Closed
1 task done
schtandard opened this issue Mar 29, 2021 · 2 comments
Closed
1 task done

Setup overwrites global (user) setting for core.editor on update #3153

schtandard opened this issue Mar 29, 2021 · 2 comments

Comments

@schtandard
Copy link

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

    $ git --version --build-options
    git version 2.31.1.windows.1
    cpu: x86_64
    built from commit: c5f0be26a7e3846e3b6268d1c6c4800d838c6bbb
    sizeof-long: 4
    sizeof-size_t: 8
    shell-path: /bin/sh
    feature: fsmonitor--daemon
    
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?

    $ cmd.exe /c ver
    
    Microsoft Windows [Version 10.0.19042.868]
    
  • What options did you set as part of the installation? Or did you choose the
    defaults?

    $ cat /etc/install-options.txt
    
    Editor Option: Atom
    Custom Editor Path:
    Default Branch Option:
    Path Option: Cmd
    SSH Option: OpenSSH
    Tortoise Option: false
    CURL Option: OpenSSL
    CRLF Option: CRLFAlways
    Bash Terminal Option: MinTTY
    Git Pull Behavior Option: Merge
    Use Credential Manager: Core
    Performance Tweaks FSCache: Enabled
    Enable Symlinks: Disabled
    Enable Pseudo Console Support: Disabled
    
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

    Nope.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

    Bash.

  • What's the problem?

    Due to an issue with Atom, I have to reconfigure core.editor, which I did using

    git config --global core.editor "atom --wait --new-window"

    which is then reflected in the corresponding %UserProfile%\.gitconfig file as

    [core]
      editor = atom --wait --new-window

    However, whenever I update Git for Windows, this is reverted to

    [core]
      editor = \"C:\\Users\\wilde\\appdata\\Local\\atom\\app-1.55.0\\atom.exe\" --wait

    and I have to reconfigure it anew.

    I would have expected the installer to only change the system level settings, not the global ones. This is also indicated by this comment to Windows Setup » 'Choose the default editor used by Git': two small but useful suggestions #2818. (An implementation to that feature request would also provide a way to get around this problem, but still this seems to be unintended behavior, which is why I am reporting it separately.)

@dscho
Copy link
Member

dscho commented Mar 29, 2021

@schtandard since you require custom options, I don't think you can use this:

Editor Option: Atom
Custom Editor Path:

But why not configure this as a custom editor? You already have the absolute path, and can then also specify the editor options.

I would have expected the installer to only change the system level settings, not the global ones.

Git for Windows will only configure editors in the system config which are installed system-wide. But Atom only comes in a user-wide flavor, therefore Git for Windows configures it in the user-wide config.

@schtandard
Copy link
Author

Git for Windows will only configure editors in the system config which are installed system-wide. But Atom only comes in a user-wide flavor, therefore Git for Windows configures it in the user-wide config.

Ah, that makes sense.

But why not configure this as a custom editor? You already have the absolute path, and can then also specify the editor options.

That works, thanks. However, I did find another issue in the process (#3155).

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

No branches or pull requests

2 participants