{"thread":{"id":"55807","subject":"[PATCH] describe-doc:fix a obscure error description in the git log documentation","startedAt":"2021-05-31T06:01:06Z","lastAt":"2021-06-08T02:00:19Z","messageCount":8,"participants":["Andy AO via GitGitGadget","Bagas Sanjaya","Đoàn Trần Công Danh","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"425969","messageId":"pull.1030.git.git.1622440856607.gitgitgadget@gmail.com","threadId":"55807","inReplyTo":null,"subject":"[PATCH] describe-doc:fix a obscure error description in the git log documentation","fromName":"Andy AO via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T06:00:56Z","receivedAt":"2021-05-31T06:01:06Z","isPatch":true,"sender":{"key":"name:Andy AO","avatar":null},"body":"From: zen96285 <zen96285@gmail.com>\n\nThe git log documentation says \"The default option is 'short'.\" This is wrong. After testing, the default value of '--decorate' is 'auto', not 'short'.\n\nThere is no difference between 'auto' and 'short' in terminal, but there is a significant difference in how they behave in the shell.The information generated by the 'short' can be saved in shell variables, while the 'auto' can't.\n\nSigned-off-by: AndyAo Zen96285@gmail.com\n---\n    describe-doc:fix a obscure error description in the git log documenta…\n    \n    The git log documentation says \"The default option is 'short'.\" This is\n    wrong. After testing, the default value of '--decorate' is 'auto', not\n    'short'.\n    \n    There is no difference between 'auto' and 'short' in terminal, but there\n    is a significant difference in how they behave in the shell.The\n    information generated by the 'short' can be saved in shell variables,\n    while the 'auto' can't.\n    \n    Signed-off-by: AndyAo Zen96285@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1030%2FAndy-AO%2Ffix_a_obscure_error_description_in_the_git_log_documentation-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1030/Andy-AO/fix_a_obscure_error_description_in_the_git_log_documentation-v1\nPull-Request: https://github.com/git/git/pull/1030\n\n Documentation/git-log.txt | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex 1bbf865a1b2d..37a4694b060a 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -39,7 +39,7 @@ OPTIONS\n \tfull ref name (including prefix) will be printed. If 'auto' is\n \tspecified, then if the output is going to a terminal, the ref names\n \tare shown as if 'short' were given, otherwise no ref names are\n-\tshown. The default option is 'short'.\n+\tshown. The default option is 'auto'.\n \n --decorate-refs=<pattern>::\n --decorate-refs-exclude=<pattern>::\n\nbase-commit: 4e42405f00ecbbee412846f48cb0253efeebe726\n-- \ngitgitgadget\n"},{"id":"425972","messageId":"b5acad71-af41-ece2-6128-bca243f8f299@gmail.com","threadId":"55807","inReplyTo":"pull.1030.git.git.1622440856607.gitgitgadget@gmail.com","subject":"Re: [PATCH] describe-doc:fix a obscure error description in the git log documentation","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-05-31T06:41:15Z","receivedAt":"2021-05-31T06:41:46Z","isPatch":true,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"Hi Andy, welcome to Git mailing list!\n\nOn 31/05/21 13.00, Andy AO via GitGitGadget wrote:\n> From: zen96285 <zen96285@gmail.com>\n> \n> The git log documentation says \"The default option is 'short'.\" This is wrong. After testing, the default value of '--decorate' is 'auto', not 'short'.\n> \n> There is no difference between 'auto' and 'short' in terminal, but there is a significant difference in how they behave in the shell.The information generated by the 'short' can be saved in shell variables, while the 'auto' can't.\n> \n\nWhy are info generated with 'short' option (and not 'auto') can be \nassigned to a variable?\n\n> diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\n> index 1bbf865a1b2d..37a4694b060a 100644\n> --- a/Documentation/git-log.txt\n> +++ b/Documentation/git-log.txt\n> @@ -39,7 +39,7 @@ OPTIONS\n>   \tfull ref name (including prefix) will be printed. If 'auto' is\n>   \tspecified, then if the output is going to a terminal, the ref names\n>   \tare shown as if 'short' were given, otherwise no ref names are\n> -\tshown. The default option is 'short'.\n> +\tshown. The default option is 'auto'.\n>   \n\nLooks OK to me, thanks.\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"425976","messageId":"YLSGasYc4wVoOfYt@danh.dev","threadId":"55807","inReplyTo":"pull.1030.git.git.1622440856607.gitgitgadget@gmail.com","subject":"Re: [PATCH] describe-doc:fix a obscure error description in the git log documentation","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2021-05-31T06:47:06Z","receivedAt":"2021-05-31T06:47:15Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2021-05-31 06:00:56+0000, Andy AO via GitGitGadget <gitgitgadget@gmail.com> wrote:\n> From: zen96285 <zen96285@gmail.com>\n> \n> The git log documentation says \"The default option is 'short'.\" This is wrong. After testing, the default value of '--decorate' is 'auto', not 'short'.\n> \n> There is no difference between 'auto' and 'short' in terminal, but there is a significant difference in how they behave in the shell.The information generated by the 'short' can be saved in shell variables, while the 'auto' can't.\n\nPlease use your real name and wrap your commit message at 50\ncharacters for subject line and 72 characters for body.\n\nLet's the commit message aside.\n\nThe default option is documented correctly as short.\nPlease check out builtin/log.c:decorate_callback and\nbuiltin/log.c:parse_decoration_style.\n\nBelow command print nothing in my machine:\n\n\tgit log --decorate -1 >/tmp/default\n\tgit log --decorate=short -1 >/tmp/short\n\tcmp /tmp/default /tmp/short\n\nI'm curious about your config and/or command invocation.\nFrom the code, I can't guess which scenario that's different.\n\nI think you meant:\n\n\tgit log -1 >/tmp/no-decorate\n\nIn that case, please check your \"log.decorate\" config.\n\n-- \nDanh\n"},{"id":"425979","messageId":"xmqqmtsbv19u.fsf@gitster.g","threadId":"55807","inReplyTo":"YLSGasYc4wVoOfYt@danh.dev","subject":"Re: [PATCH] describe-doc:fix a obscure error description in the git log documentation","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-05-31T06:57:17Z","receivedAt":"2021-05-31T06:57:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:\n\n> Please use your real name and wrap your commit message at 50\n> characters for subject line and 72 characters for body.\n\nVery good suggestions.  Thanks for raising these issues.\n\n> The default option is documented correctly as short.\n> Please check out builtin/log.c:decorate_callback and\n> builtin/log.c:parse_decoration_style.\n>\n> Below command print nothing in my machine:\n>\n> \tgit log --decorate -1 >/tmp/default\n> \tgit log --decorate=short -1 >/tmp/short\n> \tcmp /tmp/default /tmp/short\n>\n> I'm curious about your config and/or command invocation.\n> From the code, I can't guess which scenario that's different.\n\nYou two are thinking about two \"defaults\", I think.  If a --decorate\noption you give does not say which kind of decoration you want, by\ndefault, you see the short output.  The above shows that.\n\nIf you do not give any --decorate option, the command behaves as if\nyou gave --decorate=auto, which is what the patch author wanted to\nsay, I think.\n\n> I think you meant:\n>\n> \tgit log -1 >/tmp/no-decorate\n\nYes, and this (with redirection to file), I think you do not get any\ndecoration---that is what you get from --decorate=auto, i.e.\n\n\tgit log --decorate=auto -1 >/tmp/auto-decorate\n\nI think the default discussed in the paragraph the patch touches is\n\"what happens if you do not say what kind, i.e. \"--decorate\" not\n\"--decorate=<what kind>\", so \"the default is 'short'\" is correct,\nbut at the same time, \"even if you do not say --decorate, you'll see\nshort decoration when on a terminal\" is worth mentioning somewhere.\n"},{"id":"425981","messageId":"YLSNv8Xw3SVzYm8r@danh.dev","threadId":"55807","inReplyTo":"xmqqmtsbv19u.fsf@gitster.g","subject":"Re: [PATCH] describe-doc:fix a obscure error description in the git log documentation","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2021-05-31T07:18:23Z","receivedAt":"2021-05-31T07:18:31Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2021-05-31 15:57:17+0900, Junio C Hamano <gitster@pobox.com> wrote:\n> > I think you meant:\n> >\n> > \tgit log -1 >/tmp/no-decorate\n> \n> Yes, and this (with redirection to file), I think you do not get any\n> decoration---that is what you get from --decorate=auto, i.e.\n> \n> \tgit log --decorate=auto -1 >/tmp/auto-decorate\n> \n> I think the default discussed in the paragraph the patch touches is\n> \"what happens if you do not say what kind, i.e. \"--decorate\" not\n> \"--decorate=<what kind>\", so \"the default is 'short'\" is correct,\n> but at the same time, \"even if you do not say --decorate, you'll see\n> short decoration when on a terminal\" is worth mentioning somewhere.\n\nI forgot that I have log.decorate configured to 'short'. *facepalm*\n\nI think something like this should be nice.\n\n----8<----\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex 1bbf865a1b..0498e7bacb 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -39,7 +39,9 @@ OPTIONS\n \tfull ref name (including prefix) will be printed. If 'auto' is\n \tspecified, then if the output is going to a terminal, the ref names\n \tare shown as if 'short' were given, otherwise no ref names are\n-\tshown. The default option is 'short'.\n+\tshown. The option `--decorate` is short-hand for `--decorate=short`.\n+\tDefault to configuration value of `log.decorate` if configured,\n+\totherwise, `auto`.\n \n --decorate-refs=<pattern>::\n --decorate-refs-exclude=<pattern>::\n---->8---------\n\nAndy, feel free to pick this up and re-wording however you like.\n\n-- \nDanh\n"},{"id":"425983","messageId":"f34de283-d749-854a-0ed0-d4e244dc259b@gmail.com","threadId":"55807","inReplyTo":"YLSGasYc4wVoOfYt@danh.dev","subject":"Re: [PATCH] describe-doc:fix a obscure error description in the git log documentation","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-05-31T07:49:32Z","receivedAt":"2021-05-31T07:49:55Z","isPatch":true,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"Hi Đoàn,\n\nOn 31/05/21 13.47, Đoàn Trần Công Danh wrote:\n> On 2021-05-31 06:00:56+0000, Andy AO via GitGitGadget <gitgitgadget@gmail.com> wrote:\n>> From: zen96285 <zen96285@gmail.com>\n>>\n>> The git log documentation says \"The default option is 'short'.\" This is wrong. After testing, the default value of '--decorate' is 'auto', not 'short'.\n>>\n>> There is no difference between 'auto' and 'short' in terminal, but there is a significant difference in how they behave in the shell.The information generated by the 'short' can be saved in shell variables, while the 'auto' can't.\n> \n> Please use your real name and wrap your commit message at 50\n> characters for subject line and 72 characters for body.\n\nI think the case here was Andy forwarded this patch from someone, which \nhappened to be also himself. Maybe that From: line above can be removed, \nunless that he forwarded from other people (in which From: line must be \npreserved).\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"425994","messageId":"YLSzxIyULB1CcIdQ@danh.dev","threadId":"55807","inReplyTo":"f34de283-d749-854a-0ed0-d4e244dc259b@gmail.com","subject":"Re: [PATCH] describe-doc:fix a obscure error description in the git log documentation","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2021-05-31T10:00:36Z","receivedAt":"2021-05-31T10:00:54Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2021-05-31 14:49:32+0700, Bagas Sanjaya <bagasdotme@gmail.com> wrote:\n> Hi Đoàn,\n> \n> On 31/05/21 13.47, Đoàn Trần Công Danh wrote:\n> > On 2021-05-31 06:00:56+0000, Andy AO via GitGitGadget <gitgitgadget@gmail.com> wrote:\n> > > From: zen96285 <zen96285@gmail.com>\n> > > \n> > > The git log documentation says \"The default option is 'short'.\" This is wrong. After testing, the default value of '--decorate' is 'auto', not 'short'.\n> > > \n> > > There is no difference between 'auto' and 'short' in terminal, but there is a significant difference in how they behave in the shell.The information generated by the 'short' can be saved in shell variables, while the 'auto' can't.\n> > \n> > Please use your real name and wrap your commit message at 50\n> > characters for subject line and 72 characters for body.\n> \n> I think the case here was Andy forwarded this patch from someone, which\n> happened to be also himself. Maybe that From: line above can be removed,\n> unless that he forwarded from other people (in which From: line must be\n> preserved).\n\nAndy is using GitGitGadget bridge.\nThat bridge uses its own email address (gitgitgadget@gmail.com).\n\nThus, the identity in the RFC 822's header: \"From\" should be ignored,\nand we should use the \"From: \" line in body instead.\n\nIn principle, GitGitGadget will use the Author identity in the commit\nthat was pushed into GitHub to generate such \"From: \" line.\nSo, it's Andy's resposibility to configure correct core.name and\ncore.email in Andy's machine, and create a commit with correct\nauthorship. Otherwise, GitGitGadget will create above message.\n\nHope that help.\n\n-- \nDanh\n"},{"id":"426691","messageId":"20210608015840.24532-1-congdanhqx@gmail.com","threadId":"55807","inReplyTo":"pull.1030.git.git.1622440856607.gitgitgadget@gmail.com","subject":"[PATCH] doc/log: correct default for --decorate","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2021-06-08T01:58:40Z","receivedAt":"2021-06-08T02:00:19Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"There're two different default options for log --decorate:\n* Should `--decorate` be given without any arguments, it's default to\n  `short`\n* Should neither `--decorate` nor `--no-decorate` be given, it's default\n  to the `log.decorate` or `auto`.\n\nWe documented the former, but not the latter.\n\nLet's document them, too.\n\nReported-by: Andy AO <zen96285@gmail.com>\nSigned-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>\n---\n\n I'm reluctant to send this out since I would like to see Andy get familiar\n with the list.  However, it's a while since the original patch.\n\n Documentation/git-log.txt | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-log.txt b/Documentation/git-log.txt\nindex 1bbf865a1b..0498e7bacb 100644\n--- a/Documentation/git-log.txt\n+++ b/Documentation/git-log.txt\n@@ -39,7 +39,9 @@ OPTIONS\n \tfull ref name (including prefix) will be printed. If 'auto' is\n \tspecified, then if the output is going to a terminal, the ref names\n \tare shown as if 'short' were given, otherwise no ref names are\n-\tshown. The default option is 'short'.\n+\tshown. The option `--decorate` is short-hand for `--decorate=short`.\n+\tDefault to configuration value of `log.decorate` if configured,\n+\totherwise, `auto`.\n \n --decorate-refs=<pattern>::\n --decorate-refs-exclude=<pattern>::\n-- \n2.32.0.5.gc7fdd17fde\n\n"}]}