{"thread":{"id":"59572","subject":"'git config --edit' unexpected behavior","startedAt":"2023-04-10T19:51:18Z","lastAt":"2023-04-10T20:19:00Z","messageCount":2,"participants":["Mervin Guy","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"475077","messageId":"0E8CDEA4-21CC-4CF1-809F-3FE37849ED47@mervin.works","threadId":"59572","inReplyTo":null,"subject":"'git config --edit' unexpected behavior","fromName":"Mervin Guy","fromEmail":"mail@mervin.works","sentAt":"2023-04-10T19:44:26Z","receivedAt":"2023-04-10T19:51:18Z","isPatch":false,"sender":{"key":"mail@mervin.works","avatar":null},"body":"What did you do before the bug happened? (Steps to reproduce your issue)\n\n- Changed my directory to a git-repo I was working on, using 'cd <directory_name>'. Then I ran 'git config --global -e'.\n\nWhat did you expect to happen? (Expected behavior)\n\n- I exepected the command to display my current-config file, with all settings included, in my editor.\n\nWhat happened instead? (Actual behavior)\n\n- My config-file was overwritten and displayed a default-setup message, the config-file was lost after this point.\n  I experimented with different ways of activating the command, but they all led to an overwrite of the file.\n\nWhat's different between what you expected and what actually happened?\n\n- The config-file should've displayed as-was, and no overwrite should've occurred unless explicitly commanded.\n\nAnything else you want to add:\n\n- It should be noted that I've been updating my config-file manually, up until this point. When updating it, I used\n '[subsection] component' rather than 'subsection.component'.\n\n[System Info]\ngit version: 2.40.0\ncpu: i686\nsizeof-long: 4\nsizeof-size_t: 4\nshell-path: /bin/sh\ncompiler info: gnuc: 12.2\nlibc info: no libc information available\n$SHELL (typically, interactive shell): /bin/ash\n\n"},{"id":"475081","messageId":"20230410201853.GD104097@coredump.intra.peff.net","threadId":"59572","inReplyTo":"0E8CDEA4-21CC-4CF1-809F-3FE37849ED47@mervin.works","subject":"Re: 'git config --edit' unexpected behavior","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-04-10T20:18:53Z","receivedAt":"2023-04-10T20:19:00Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Apr 10, 2023 at 03:44:26PM -0400, Mervin Guy wrote:\n\n> What did you do before the bug happened? (Steps to reproduce your issue)\n> \n> - Changed my directory to a git-repo I was working on, using 'cd <directory_name>'. Then I ran 'git config --global -e'.\n> \n> What did you expect to happen? (Expected behavior)\n> \n> - I exepected the command to display my current-config file, with all settings included, in my editor.\n> \n> What happened instead? (Actual behavior)\n> \n> - My config-file was overwritten and displayed a default-setup message, the config-file was lost after this point.\n>   I experimented with different ways of activating the command, but they all led to an overwrite of the file.\n\nThat's certainly unexpected. \"git config --global -e\" works fine for me.\nAnd Git itself won't overwrite the file; it will run your editor with\nthe name of the file, and the editor is responsible for any writing.\nWhich editor are you trying to use? Can you try running with:\n\n  GIT_TRACE=1 git config --global -e\n\nwhich should show the editor command that Git runs.\n\n-Peff\n"}]}