Fossil User Forum

commit message empty, fossil not waiting for save
Login

commit message empty, fossil not waiting for save

commit message empty, fossil not waiting for save

(1) By matt w. (maphew) on 2021-10-25 00:16:48 [source]

When I commit without using -m "..." commandline message parameter fossil creates the temp file but doesn't wait for the file to be saved by the external app but returns immediately saying the message is empty.

C:\Users\mhwilkie\code\mypdq>fossil commit --private
C:\Windows\notepad.exe ./ci-comment-E57278DF93F2.txt
empty check-in comment.  continue (y/N)?

I have Windows set to globally to replace Microsoft Notepad with Notepad++ (by means of Notepad Replacer).

There is a command line that is purported to work for git but it doesn't seem to work for fossil:

notepad++.exe -multiInst -notabbar -nosession -noPlugin %*

References

  • https://npp-user-manual.org/docs/command-prompt/
  • https://stackoverflow.com/questions/10564/how-can-i-set-up-an-editor-to-work-with-git-on-windows

(2) By matt w. (maphew) on 2021-10-25 00:23:01 in reply to 1 [link] [source]

I think this is a NPP problem. When it starts it has a prompt like "ci-comment-E57278DF93F2.txt doesn't exist, create it?", however when a different editor is used the ci-file is created and populated with some guidance comments ("lines beginning with # are ignored ...etc").

It turns out Visual Studio Code works quite well instead (and even has a fossil extension).

D:\> fossil setting editor "code -n -w"

-n = new window
-w = wait

(3) By Stephan Beal (stephan) on 2021-10-25 03:49:24 in reply to 2 [link] [source]

I think this is a NPP problem.

More generally, it's a problem with any editor which immediately forks and returns to the calling process (or does whatever the equivalent of that is on Windows). Some editors have a flag to tell it to not do so, and that's required for purposes of using it to write checkin messages.

An alternate approach is to write the message in a text file in advance and use the -M FILENAME flag (capital M) instead of -m ... (lower-case m).

(4) By graham on 2021-10-25 09:43:58 in reply to 2 [link] [source]

I haven't got Notepad++ to try it with, but you might try:

fossil setting editor "start /wait notepad++"

Depending on how Notepad++ works, this may fix the problem.

The problem stems from Windows having two types of EXE file: Console and GUI. The first runs with stdin/stdout connected and (normally) waits for the process to exit before returning to the process that started it. The latter (as the name implies) has a graphical interface, does not have an attached console, and normally returns to the caller immediately. START /WAIT is part of CMD.EXE that will wait for the latter type to exit.

(5) By sean (jungleboogie) on 2021-10-25 14:05:20 in reply to 1 [link] [source]

I remember having this issue with trying to use Visual Studio Code.

https://www.mail-archive.com/fossil-users@lists.fossil-scm.org/msg26046.html

I don't know if that will help you out, though.

(6) By matt w. (maphew) on 2021-10-26 12:24:30 in reply to 5 [link] [source]

Yep, I just switched to using vs-code instead of notepad++, using essentially the same solution as in your thread (here). Code is slightly more heavyweight than Notepad++ because of the extensions I have installed, but it's not that noticeable.