-6ren">
gpt4 book ai didi

git - 用于emacs的egg git接口(interface),提交消息为空

转载 作者:行者123 更新时间:2023-12-04 06:56:18 24 4
gpt4 key购买 nike

我在 emacs 中使用 egg (emacs got git) 作为 git 接口(interface)。
每当我尝试实现提交 --amend 时,我都会收到 "GIT-COMMIT-AMEND> Aborting commit due to empty commit message".
这就是我所做的:

C-u C-x v c

然后出现提交缓冲区,其中包含我之前提交的消息。

然后在 C-c C-c我收到上述消息:空提交消息。

我想我以前经常提交这种行为(如未修改),但不记得或找不到我是如何解决它的。

我尝试编辑消息(在某​​处添加空格)。没有工作。

我尝试在提交之前保存缓冲区,但这也不起作用(因为 C-c C-c 在提交缓冲区之外的另一个缓冲区中不活动)。

有什么线索吗?

最佳答案

是不是因为编辑器emacs试图打开一个commit --amend ?见 this exchange

[06:28:18] <burningdog> question: This is my first commit with git. I expected "git commit" to allow me to type a commit message in, but instead it opens up .git/COMMIT_EDITMSG in TextWrangler (I'm on a Mac) and terminates the commit, saying "Aborting commit due to empty commit message." What am I doing wrong?

[06:29:24] <Ilari> burningdog: Probably TextWrangler detaches from the shell when opening. This causes git to think you finished with the commit message when the editor opens.

[06:30:10] <burningdog> Ilari: hmmm...that sounds about right. /usr/bin/edit sends whatever is piped to it to TextWranger. Maybe I can change that...

[06:30:27] <Ilari> burningdog: Either put some option telling not to do it. Otherwise write commit message to file and then use -F <file> to commit.

[06:31:26] <burningdog> Ilari: is it expected behaviour that git calls /usr/bin/edit when a user enters a commit message?

[06:32:09] <Ilari> There are few settings it uses to determine what editor to open.

[06:32:54] <burningdog> ah, so that default text is opened in some editor. Got it.

[06:34:06] <Ilari> burningdog: core.editor $GIT_EDITOR $VISUAL and $EDITOR

[06:34:31] <burningdog> Ilari: I changed my bash profile to use pico as the editor - fixed that. Thanks for your help :)

关于git - 用于emacs的egg git接口(interface),提交消息为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2521985/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com