All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
Cc: Andy AO via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org, Bagas Sanjaya <bagasdotme@gmail.com>,
	Felipe Contreras <felipe.contreras@gmail.com>,
	"Robert P. J. Day" <rpjday@crashcourse.ca>,
	Derrick Stolee <stolee@gmail.com>, Andy AO <zen96285@gmail.com>
Subject: Re: [PATCH] describe-doc:fix a obscure error description in the git log documentation
Date: Mon, 31 May 2021 15:57:17 +0900	[thread overview]
Message-ID: <xmqqmtsbv19u.fsf@gitster.g> (raw)
In-Reply-To: <YLSGasYc4wVoOfYt@danh.dev> ("Đoàn Trần Công Danh"'s message of "Mon, 31 May 2021 13:47:06 +0700")

Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:

> Please use your real name and wrap your commit message at 50
> characters for subject line and 72 characters for body.

Very good suggestions.  Thanks for raising these issues.

> The default option is documented correctly as short.
> Please check out builtin/log.c:decorate_callback and
> builtin/log.c:parse_decoration_style.
>
> Below command print nothing in my machine:
>
> 	git log --decorate -1 >/tmp/default
> 	git log --decorate=short -1 >/tmp/short
> 	cmp /tmp/default /tmp/short
>
> I'm curious about your config and/or command invocation.
> From the code, I can't guess which scenario that's different.

You two are thinking about two "defaults", I think.  If a --decorate
option you give does not say which kind of decoration you want, by
default, you see the short output.  The above shows that.

If you do not give any --decorate option, the command behaves as if
you gave --decorate=auto, which is what the patch author wanted to
say, I think.

> 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.

  reply	other threads:[~2021-05-31  6:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31  6:00 [PATCH] describe-doc:fix a obscure error description in the git log documentation Andy AO via GitGitGadget
2021-05-31  6:41 ` Bagas Sanjaya
2021-05-31  6:47 ` Đoàn Trần Công Danh
2021-05-31  6:57   ` Junio C Hamano [this message]
2021-05-31  7:18     ` Đoàn Trần Công Danh
2021-05-31  7:49   ` Bagas Sanjaya
2021-05-31 10:00     ` Đoàn Trần Công Danh
2021-06-08  1:58 ` [PATCH] doc/log: correct default for --decorate Đoàn Trần Công Danh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqmtsbv19u.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=bagasdotme@gmail.com \
    --cc=congdanhqx@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=rpjday@crashcourse.ca \
    --cc=stolee@gmail.com \
    --cc=zen96285@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.