Re: [PATCH v2 2/2] doc/SubmittingPatches: show how to get a CLI commit summary
From: Junio C Hamano <hidden>
Date: 2017-03-21 20:18:19
SZEDER Gábor [off-list ref] writes:
quoted
That depends on what you use it for. I most often use mine to insert the reference that flows in a sentence, not as a separate displayed material, e.g. 1f6b1afe ("Git 2.12.1", 2017-03-20) so for that purpose, not adding a trailing newline is a feature.Perhaps we are running it differently. I use its output that way, too, usually running the command in a terminal and copy-pasting its output into an editor.
I do \C-u\M-!git one<ENTER> from Emacs in the middle of typing a
sentence (where "git one" is aliased to that --format thing), and
for this I obviously do not want the terminating newline.
Of course --pretty=format:... has the opposite effect and in a
terminal to make it easier to cut&paste you do want to have its
output separated from the prompt string.
So as I said, "That depends on what you use it for."
As this is a mere example, we should just shoot for brevity instead?
Both "--pretty=format:" and "--pretty=tformat:" are much longer than
"--format=", so we can just mention
git show --date=short -s --format='%h ("%s", %ad)'
and let the users to customize it for their needs?