Fossil Forum

empty check-in comment

empty check-in comment

empty check-in comment

(1) By ZanyScum (zany) on 2019-11-05 16:23:25 [link] [source]

I write

f commit -m ""

then I am asked:

empty check-in comment. continue (y/N)?

That just makes no sense. I tell it the comment is "" and it asks me if I want the comment to be "". Can I disable this?

(2) By seeg on 2019-11-12 07:08:47 in reply to 1 [link] [source]

Didn't you mean:

fossil commit -m '""'

I mean do you want the string "" to be the comment or just leave the comment as empty? If you type

fossil commit -m ""

then Bash or whatever shell you're using expands this into an empty string argument.

(3) By Stephan Beal (stephan) on 2019-11-12 07:18:56 in reply to 1 [link] [source]

It warns because an empty commit message is, 99.9% of the time, an unintentional mistake, and it has no way to squelch that warning (nor should it, IMHO). Empty commit messages are also poor practice, but fossil tries not to enforce project-level policy decisions, so it allows an empty checkin comment after a user explicitly confirms that the empty message was intended.

If you want to trick it a bit, you can use two sets of quotes:

fossil com -m '""'

Use single quotes on the outside and double on the inside, or vice versa, and that "should" bypass the warning, but will leave you with the literal quotes as a comment. It would seem easier to use use -m 0 or -m ' ' (space) instead, though (fossil might trim the leading/trailing space, in which case it may still warn about that one). For that matter, any one-character commit message would do the trick: -m ..

(4) By sebyte on 2019-12-12 10:20:05 in reply to 3 [link] [source]

Another way of fooling Fossil, at least on *nix platforms, is to temporarily set EDITOR=true. For example:

 $ EDITOR=true fossil stash snapshot > /dev/null

results in a silent, no questions asked, snapshot of work in progress.

(5) By Stephan Beal (stephan) on 2019-12-12 12:36:50 in reply to 4 [source]

FWIW, this is what i use:

alias fsnap='fossil stash snapshot -m "snapshot @ $(date)" && echo "snapshot created"'

(6) By Andy Bradford (andybradford) on 2019-12-12 15:27:46 in reply to 1 [link] [source]

Will you please tell us what you meant by:

fossil commit -m ""

Did you want Fossil to preserve the 2 quotes as your comment, or did you
want Fossil to not include a comment at all on the commit?