git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] describe-doc:fix a obscure error description in the git log documentation

From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Date
May 31, 2021, 07:18 UTC
Message-ID
<YLSNv8Xw3SVzYm8r@danh.dev>
In-Reply-To
<xmqqmtsbv19u.fsf@gitster.g>
On 2021-05-31 15:57:17+0900, Junio C Hamano <gitster@pobox.com> wrote:
Show 14 quoted lines
> > I think you meant:
> >
> > 	git log -1 >/tmp/no-decorate
> 
> Yes, and this (with redirection to file), I think you do not get any
> decoration---that is what you get from --decorate=auto, i.e.
> 
> 	git log --decorate=auto -1 >/tmp/auto-decorate
> 
> I think the default discussed in the paragraph the patch touches is
> "what happens if you do not say what kind, i.e. "--decorate" not
> "--decorate=<what kind>", so "the default is 'short'" is correct,
> but at the same time, "even if you do not say --decorate, you'll see
> short decoration when on a terminal" is worth mentioning somewhere.
I forgot that I have log.decorate configured to 'short'. *facepalm*
I think something like this should be nice.
----8<----
diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 1bbf865a1b..0498e7bacb 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -39,7 +39,9 @@ OPTIONS
 	full ref name (including prefix) will be printed. If 'auto' is
 	specified, then if the output is going to a terminal, the ref names
 	are shown as if 'short' were given, otherwise no ref names are
-	shown. The default option is 'short'.
+	shown. The option `--decorate` is short-hand for `--decorate=short`.
+	Default to configuration value of `log.decorate` if configured,
+	otherwise, `auto`.
 
 --decorate-refs=<pattern>::
 --decorate-refs-exclude=<pattern>::
---->8---------

Andy, feel free to pick this up and re-wording however you like.
-- 
Danh
Previous: Junio C HamanoNext: Bagas Sanjaya
Message 5 of 8 in “describe-doc:fix a obscure error description in the git log documentation”
  1. describe-doc:fix a obscure error description in the git log documentationAndy AO via GitGitGadget, May 31, 2021
  2. Bagas SanjayaMay 31, 2021
  3. Đoàn Trần Công DanhMay 31, 2021
  4. Junio C HamanoMay 31, 2021
  5. Đoàn Trần Công DanhMay 31, 2021
  6. Bagas SanjayaMay 31, 2021
  7. Đoàn Trần Công DanhMay 31, 2021
  8. doc/log: correct default for --decorateĐoàn Trần Công Danh, Jun 8, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.