Thread (17 messages) flat view 17 messages, 7 authors, 2016-06-15

Re: [PATCH] Add option to git-commit to allow empty log messages

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:48:33

Possibly related (same subject, not in this thread)

Hi,

Ævar Arnfjörð Bjarmason wrote:
Learning to use and switching to
something like git-fast-import(1) or git-commit-tree(1) is too big of
a hurdle for small throwaway scripts that take ~1m to write and aren't
big dedicated importers like snerp-vortex.

There's probably a lot of code out there doing `git commit -m"Yet
another revision"' from some cron job.
FWIW, I have no strong opinion about whether to add this --allow-empty-message
option.  Maybe it would make something more convenient for someone,
though that has to be weighed against it making it harder for everyone
else to read the manual.

Instead, I just wanted to suggest that it is really worth the time to
learn to use ‘git commit-tree’.  Mostly because it does not take much
time to learn at all.

Hint:

	parent=HEAD && : or whatever &&
	tree=$(git write-tree) &&
	printf "%s\n" message |
	commit=$(git commit-tree "$tree" -p "$parent") &&
	git update-ref refs/heads/somebranch "$commit"

It is a very flexible tool, and I think you will find yourself fighting
with git much less if you use tools like it in situations that would
be unusual for a human to run into.

Cheers,
Jonathan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help