{"thread":{"id":"54990","subject":"add a blank line when a commit has no parent in log output?","startedAt":"2021-01-14T18:31:10Z","lastAt":"2021-01-25T07:09:58Z","messageCount":29,"participants":["Jason Pyeron","Philippe Blain","Junio C Hamano","Kyle Marek"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"414372","messageId":"191201d6eaa3$4b585fa0$e2091ee0$@pdinc.us","threadId":"54990","inReplyTo":null,"subject":"add a blank line when a commit has no parent in log output?","fromName":"Jason Pyeron","fromEmail":"jpyeron@pdinc.us","sentAt":"2021-01-14T18:30:11Z","receivedAt":"2021-01-14T18:31:10Z","isPatch":false,"sender":{"key":"jpyeron@pdinc.us","avatar":"https://gravatar.com/avatar/c2e53452caa53d940768a1ffc9cf76196d851b9b534b7a39cd39852a70a0508f?d=mp&s=160"},"body":"Take this git log --format=\"%C(auto) %h% ad%d% s%C(green)% aE\" --graph --date=short\n\n| | | *  5505e019c2 2014-07-09 initial xxxxxx@xxxx\n| | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n| | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n\nOne might assume 5505e019c2 and 3e658f4085 are related. But git cat-file -p 5505e019c2\ntree 546c6b71f01e7fd086c8adb832518240b71a9075\nauthor sam swindell <xxxxxx@xxxx> 1404878701 -0400\ncommitter sam swindell <xxxxxx@xxxx> 1404878701 -0400\n\ninitial\n\n\nIs there a way to have it look like:\n\n| | | *  5505e019c2 2014-07-09 initial xxxxxx@xxxx\n| | |\n| | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n| | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n\nOr \n\n| | | #  5505e019c2 2014-07-09 initial xxxxxx@xxxx\n| | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n| | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n\nRespectfully,\n\nJason Pyeron\n\n\n--\nJason Pyeron  | Architect\nPD Inc        |\n10 w 24th St  |\nBaltimore, MD |\n \n.mil: jason.j.pyeron.ctr...\n.com: jpyeron@pdinc.us\ntel : 202-741-9397\n\n\n\n"},{"id":"414375","messageId":"abc900c1-16cc-4ad4-4be3-c405924215cd@gmail.com","threadId":"54990","inReplyTo":"191201d6eaa3$4b585fa0$e2091ee0$@pdinc.us","subject":"Re: add a blank line when a commit has no parent in log output?","fromName":"Philippe Blain","fromEmail":"levraiphilippeblain@gmail.com","sentAt":"2021-01-14T19:29:27Z","receivedAt":"2021-01-14T19:30:27Z","isPatch":false,"sender":{"key":"levraiphilippeblain@gmail.com","avatar":"https://avatars.githubusercontent.com/u/44212482?v=4"},"body":"Hi Jason,\n\nLe 2021-01-14 à 13:30, Jason Pyeron a écrit :\n> Take this git log --format=\"%C(auto) %h% ad%d% s%C(green)% aE\" --graph --date=short\n> \n> | | | *  5505e019c2 2014-07-09 initial xxxxxx@xxxx\n> | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n> | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n> \n> One might assume 5505e019c2 and 3e658f4085 are related. But git cat-file -p 5505e019c2\n> tree 546c6b71f01e7fd086c8adb832518240b71a9075\n> author sam swindell <xxxxxx@xxxx> 1404878701 -0400\n> committer sam swindell <xxxxxx@xxxx> 1404878701 -0400\n> \n> initial\n> \n> \n> Is there a way to have it look like:\n> \n> | | | *  5505e019c2 2014-07-09 initial xxxxxx@xxxx\n> | | |\n> | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n> | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n> \n> Or\n> \n> | | | #  5505e019c2 2014-07-09 initial xxxxxx@xxxx\n> | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n> | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n> \n\nIf you remove '--graph', then you can add '--show-linear-break' [1]. Unfortunately\nthese two options do not work together. I think your suggestion to have the '*'\nbe changed to '#' for root commit is a great idea.\n\nIn the mean time, I use this trick:\n\n     git log --date=short --format='%C(auto) %h% [%<(2,trunc)%p] ad%d% s%C(green)% aE'\n\nThis adds the abbreviated parent hashes (%p) but truncated to 2 characters ([2], [3]). So\nthe brackets will be empty for root commits.\n\nCheers,\n\nPhilippe.\n\n\n[1] https://git-scm.com/docs/git-log#Documentation/git-log.txt---show-linear-breakltbarriergt\n[2] https://git-scm.com/docs/git-log#Documentation/git-log.txt-empem\n[3] https://git-scm.com/docs/git-log#Documentation/git-log.txt-emltltNgttruncltruncmtruncem\n"},{"id":"414389","messageId":"196101d6eab6$20714550$6153cff0$@pdinc.us","threadId":"54990","inReplyTo":"abc900c1-16cc-4ad4-4be3-c405924215cd@gmail.com","subject":"RE: add a blank line when a commit has no parent in log output?","fromName":"Jason Pyeron","fromEmail":"jpyeron@pdinc.us","sentAt":"2021-01-14T20:44:59Z","receivedAt":"2021-01-14T20:45:37Z","isPatch":false,"sender":{"key":"jpyeron@pdinc.us","avatar":"https://gravatar.com/avatar/c2e53452caa53d940768a1ffc9cf76196d851b9b534b7a39cd39852a70a0508f?d=mp&s=160"},"body":"Kyle:\n\nNeed you to whip up a patch (back port it to current Cygwin git too), see below. It will help with cleaning up Cresaptown branches. Or if you think Watson can do it, give it to him.\n\n> -----Original Message-----\n> From: Philippe Blain <levraiphilippeblain@gmail.com>\n> Sent: Thursday, January 14, 2021 2:29 PM\n> To: git@vger.kernel.org; Jason Pyeron <jpyeron@pdinc.us>\n> Subject: Re: add a blank line when a commit has no parent in log output?\n> \n> Hi Jason,\n> \n> Le 2021-01-14 à 13:30, Jason Pyeron a écrit :\n> > Take this git log --format=\"%C(auto) %h% ad%d% s%C(green)% aE\" --graph --date=short\n> >\n> > | | | *  5505e019c2 2014-07-09 initial xxxxxx@xxxx\n> > | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n> > | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n> >\n> > One might assume 5505e019c2 and 3e658f4085 are related. But git cat-file -p 5505e019c2\n> > tree 546c6b71f01e7fd086c8adb832518240b71a9075\n> > author sam swindell <xxxxxx@xxxx> 1404878701 -0400\n> > committer sam swindell <xxxxxx@xxxx> 1404878701 -0400\n> >\n> > initial\n> >\n> >\n> > Is there a way to have it look like:\n> >\n> > | | | *  5505e019c2 2014-07-09 initial xxxxxx@xxxx\n> > | | |\n> > | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n> > | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n> >\n> > Or\n> >\n> > | | | #  5505e019c2 2014-07-09 initial xxxxxx@xxxx\n> > | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n> > | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n> >\n> \n> If you remove '--graph', then you can add '--show-linear-break' [1]. Unfortunately\n> these two options do not work together. I think your suggestion to have the '*'\n> be changed to '#' for root commit is a great idea.\n\nPatch description\n\nWhen --graph is used\n\n--show-linear-break converts the * to a #\n\n--show-linear-break=x converts the * to a x\n\n> \n> In the mean time, I use this trick:\n> \n>      git log --date=short --format='%C(auto) %h% [%<(2,trunc)%p] ad%d% s%C(green)% aE'\n> \n> This adds the abbreviated parent hashes (%p) but truncated to 2 characters ([2], [3]). So\n> the brackets will be empty for root commits.\n> \n> Cheers,\n> \n> Philippe.\n> \n> \n> [1] https://git-scm.com/docs/git-log#Documentation/git-log.txt---show-linear-breakltbarriergt\n> [2] https://git-scm.com/docs/git-log#Documentation/git-log.txt-empem\n> [3] https://git-scm.com/docs/git-log#Documentation/git-log.txt-emltltNgttruncltruncmtruncem\n\n"},{"id":"414412","messageId":"xmqq8s8vvw9m.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"191201d6eaa3$4b585fa0$e2091ee0$@pdinc.us","subject":"Re: add a blank line when a commit has no parent in log output?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-15T01:12:05Z","receivedAt":"2021-01-15T01:13:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Jason Pyeron\" <jpyeron@pdinc.us> writes:\n\n> Is there a way to have it look like:\n>\n> | | | *  5505e019c2 2014-07-09 initial xxxxxx@xxxx\n> | | |\n> | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n> | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n>\n> Or \n>\n> | | | #  5505e019c2 2014-07-09 initial xxxxxx@xxxx\n> | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n> | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n\nThis latter variant won't work.  Imagine we are showing --left-right\nfor example.  Which side does '#' belong to?\n\nThe former is not so great in that it wastes a line, and the break\nwon't be as noticeable when --graph is *not* used with --oneline.\n\nIt would be great to show it more like this:\n\n | | |   * 5505e019c2 2014-07-09 initial xxxxxx@xxxx\n | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n\nThe point being that by shifting the column for the commit to the\nright, it shows that 5505 is not a child of 3e65 (and 3e65 is the\ntip of its lineage), and its parents do not appear in the displayed\nhistory.  In the real life, the independent 'root' may be connected\nto the main history somehow, so you may see a graph like this:\n\n | | *  12345678 2021-01-14 merge xxxxx@xxxx into the history  \n | | |\\\n | | | \\\n | | *  \\  23456789 2021-01-12 merge citest into the main history\n | | |\\  * 5505e019c2 2014-07-09 initial xxxxxx@xxxx\n | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n\n\nHmm?\n"},{"id":"414547","messageId":"20210117110337.429994-2-kmarek@pdinc.us","threadId":"54990","inReplyTo":"20210117110337.429994-1-kmarek@pdinc.us","subject":"[PATCH 1/2] revision: Denote root commits with '#'","fromName":"Kyle Marek","fromEmail":"kmarek@pdinc.us","sentAt":"2021-01-17T11:03:36Z","receivedAt":"2021-01-17T12:07:03Z","isPatch":true,"sender":{"key":"kmarek@pdinc.us","avatar":null},"body":"This aids in identifying where an unrelated branch history starts when\nusing `git log --graph --oneline --all`\n\nSigned-off-by: Kyle Marek <kmarek@pdinc.us>\n---\n revision.c | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/revision.c b/revision.c\nindex 9dff845bed..8556923de8 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -4191,9 +4191,11 @@ const char *get_revision_mark(const struct rev_info *revs, const struct commit *\n \t\t\treturn \"<\";\n \t\telse\n \t\t\treturn \">\";\n-\t} else if (revs->graph)\n+\t} else if (revs->graph) {\n+\t\tif (!commit->parents)\n+\t\t\treturn \"#\";\n \t\treturn \"*\";\n-\telse if (revs->cherry_mark)\n+\t} else if (revs->cherry_mark)\n \t\treturn \"+\";\n \treturn \"\";\n }\n-- \n2.29.2\n\n"},{"id":"414548","messageId":"20210117110337.429994-1-kmarek@pdinc.us","threadId":"54990","inReplyTo":"196101d6eab6$20714550$6153cff0$@pdinc.us","subject":"[PATCH 0/2] Option to modify revision mark for root commits","fromName":"Kyle Marek","fromEmail":"kmarek@pdinc.us","sentAt":"2021-01-17T11:03:35Z","receivedAt":"2021-01-17T12:07:08Z","isPatch":true,"sender":{"key":"kmarek@pdinc.us","avatar":null},"body":"This patch series allows --show-linear-break to be used with --graph,\nallowing for the revision mark to be changed for root commits.\n\nFeel free to squash away PATCH 1, or maybe even discard PATCH 2.\n\nJason: tested against Cygwin x86_64/release/git/git-2.30.0-1-src.tar.xz\n\nNote: PATCH 2 revision.c:2410 makes a second copy of optarg. This may\nnot be necessary.\n\nBackground:\n\nThe use case is --graph --oneline with unrelated histories. For example,\nin a hypothetical repository with an orphaned \"prebuilt\" branch\ncontaining builds of the master branch, the history may look like:\n\nkmarek@kyle-ppc64le /tmp/somerepo\n$ git log --graph --all --oneline\n* 02190b6 (prebuilt) add aarch64\n* 7b873f6 add x86_64\n* 26cc783 add ppc64le\n* 5b7186e (HEAD -> master) add Makefile\n* ea69093 implement cmdline parsing\n* a65df8a add main.c\n* 7727eb3 Initial commit\n\nAt first sight, the above log implies that 26cc783's parent is 5b7186e,\nor that master is an ancestor to prebuilt, but 26cc783 is the start of a\nnew history:\n\nkmarek@kyle-ppc64le /tmp/somerepo\n$ git log --graph --oneline master\n* 5b7186e (HEAD -> master) add Makefile\n* ea69093 implement cmdline parsing\n* a65df8a add main.c\n* 7727eb3 Initial commit\n\nkmarek@kyle-ppc64le /tmp/somerepo\n$ git log --graph --oneline prebuilt\n* 02190b6 (prebuilt) add aarch64\n* 7b873f6 add x86_64\n* 26cc783 add ppc64le\n\nTo identify the start of a new history:\n\nkmarek@kyle-ppc64le /tmp/somerepo\n$ git log --graph --all --oneline --show-linear-break\n* 02190b6 (prebuilt) add aarch64\n* 7b873f6 add x86_64\n# 26cc783 add ppc64le\n* 5b7186e (HEAD -> master) add Makefile\n* ea69093 implement cmdline parsing\n* a65df8a add main.c\n# 7727eb3 Initial commit\n\nkmarek@kyle-ppc64le /tmp/somerepo\n$ git log --graph --all --oneline --show-linear-break=I\n* 02190b6 (prebuilt) add aarch64\n* 7b873f6 add x86_64\nI 26cc783 add ppc64le\n* 5b7186e (HEAD -> master) add Makefile\n* ea69093 implement cmdline parsing\n* a65df8a add main.c\nI 7727eb3 Initial commit\n\nKyle Marek (2):\n  revision: Denote root commits with '#'\n  revision: implement --show-linear-break for --graph\n\n Documentation/rev-list-options.txt |  7 +++++++\n log-tree.c                         |  2 +-\n revision.c                         | 10 ++++++----\n revision.h                         |  1 +\n 4 files changed, 15 insertions(+), 5 deletions(-)\n\n-- \n2.29.2\n\n"},{"id":"414549","messageId":"20210117110337.429994-3-kmarek@pdinc.us","threadId":"54990","inReplyTo":"20210117110337.429994-1-kmarek@pdinc.us","subject":"[PATCH 2/2] revision: implement --show-linear-break for --graph","fromName":"Kyle Marek","fromEmail":"kmarek@pdinc.us","sentAt":"2021-01-17T11:03:37Z","receivedAt":"2021-01-17T12:07:30Z","isPatch":true,"sender":{"key":"kmarek@pdinc.us","avatar":null},"body":"where <barrier> sets rev_info.break_revision_mark, the revision mark\nused for root commits.\n\nSigned-off-by: Kyle Marek <kmarek@pdinc.us>\n---\n Documentation/rev-list-options.txt | 7 +++++++\n log-tree.c                         | 2 +-\n revision.c                         | 8 ++++----\n revision.h                         | 1 +\n 4 files changed, 13 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt\nindex 002379056a..93adb77c19 100644\n--- a/Documentation/rev-list-options.txt\n+++ b/Documentation/rev-list-options.txt\n@@ -1104,6 +1104,13 @@ This implies the `--topo-order` option by default, but the\n \tdo not belong to a linear branch. This option puts a barrier\n \tin between them in that case. If `<barrier>` is specified, it\n \tis the string that will be shown instead of the default one.\n++\n+When --graph is used with --oneline, there is usually no vertical\n+space between commits, so the graph edge is not drawn. This can make\n+it hard to see that a history may end at one commit, while an\n+unrelated history starts at the next commit. This option changes the\n+revision mark for root commits. If `<barrier>` is specified, it is\n+used as the new revision mark instead of the default one.\n \n ifdef::git-rev-list[]\n --count::\ndiff --git a/log-tree.c b/log-tree.c\nindex fd0dde97ec..f62300e404 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -962,7 +962,7 @@ int log_tree_commit(struct rev_info *opt, struct commit *commit)\n \tif (opt->line_level_traverse)\n \t\treturn line_log_print(opt, commit);\n \n-\tif (opt->track_linear && !opt->linear && !opt->reverse_output_stage)\n+\tif (!opt->graph && opt->track_linear && !opt->linear && !opt->reverse_output_stage)\n \t\tfprintf(opt->diffopt.file, \"\\n%s\\n\", opt->break_bar);\n \tshown = log_tree_diff(opt, commit, &log);\n \tif (!shown && opt->loginfo && opt->always_show_header) {\ndiff --git a/revision.c b/revision.c\nindex 8556923de8..51deab2326 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -2402,10 +2402,12 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg\n \t\trevs->show_signature = 0;\n \t} else if (!strcmp(arg, \"--show-linear-break\")) {\n \t\trevs->break_bar = \"                    ..........\";\n+\t\trevs->break_revision_mark = \"#\";\n \t\trevs->track_linear = 1;\n \t\trevs->track_first_time = 1;\n \t} else if (skip_prefix(arg, \"--show-linear-break=\", &optarg)) {\n \t\trevs->break_bar = xstrdup(optarg);\n+\t\trevs->break_revision_mark = xstrdup(optarg);\n \t\trevs->track_linear = 1;\n \t\trevs->track_first_time = 1;\n \t} else if (skip_prefix(arg, \"--show-notes=\", &optarg) ||\n@@ -2530,8 +2532,6 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg\n \t\t\tunkv[(*unkc)++] = arg;\n \t\treturn opts;\n \t}\n-\tif (revs->graph && revs->track_linear)\n-\t\tdie(\"--show-linear-break and --graph are incompatible\");\n \n \treturn 1;\n }\n@@ -4192,8 +4192,8 @@ const char *get_revision_mark(const struct rev_info *revs, const struct commit *\n \t\telse\n \t\t\treturn \">\";\n \t} else if (revs->graph) {\n-\t\tif (!commit->parents)\n-\t\t\treturn \"#\";\n+\t\tif (revs->break_revision_mark && !commit->parents)\n+\t\t\treturn revs->break_revision_mark;\n \t\treturn \"*\";\n \t} else if (revs->cherry_mark)\n \t\treturn \"+\";\ndiff --git a/revision.h b/revision.h\nindex 086ff10280..83b2ecef56 100644\n--- a/revision.h\n+++ b/revision.h\n@@ -297,6 +297,7 @@ struct rev_info {\n \n \tstruct commit_list *previous_parents;\n \tconst char *break_bar;\n+\tconst char *break_revision_mark;\n \n \tstruct revision_sources *sources;\n \n-- \n2.29.2\n\n"},{"id":"414558","messageId":"xmqq7dobmfrq.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"20210117110337.429994-2-kmarek@pdinc.us","subject":"Re: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-17T21:10:01Z","receivedAt":"2021-01-17T21:11:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kyle Marek <kmarek@pdinc.us> writes:\n\n> This aids in identifying where an unrelated branch history starts when\n> using `git log --graph --oneline --all`\n>\n> Signed-off-by: Kyle Marek <kmarek@pdinc.us>\n> ---\n>  revision.c | 6 ++++--\n>  1 file changed, 4 insertions(+), 2 deletions(-)\n\nNo tests?\n\n> diff --git a/revision.c b/revision.c\n> index 9dff845bed..8556923de8 100644\n> --- a/revision.c\n> +++ b/revision.c\n> @@ -4191,9 +4191,11 @@ const char *get_revision_mark(const struct rev_info *revs, const struct commit *\n>  \t\t\treturn \"<\";\n>  \t\telse\n>  \t\t\treturn \">\";\n> -\t} else if (revs->graph)\n> +\t} else if (revs->graph) {\n> +\t\tif (!commit->parents)\n> +\t\t\treturn \"#\";\n>  \t\treturn \"*\";\n> -\telse if (revs->cherry_mark)\n> +\t} else if (revs->cherry_mark)\n>  \t\treturn \"+\";\n>  \treturn \"\";\n>  }\n\nHere is what I tried to come up with, but somehow the \"#\" marker is\nnot showing for me.\n\nThe \"counted plus --left-right\" tests stress why a single \"#\" is not\ngood enough.  I think the patch also needs to replace \"<\" and \">\"\nfor root commits that are left and right---in the tests, I used \"L\"\nto denote \"root that is on the left side\" (and \"R\" for the right\nside) instead of single \"#\", so that we do not to lose information.\n\nBy the way, as I already said in the original thread, I do not think\nthe '#' marking is a good idea; I'd rather see the root commit shown\nby shifting columns.\n\nAnyway, here is to test [1/2].\n\n t/t6020-rev-list-boundary.sh | 132 +++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 132 insertions(+)\n\ndiff --git i/t/t6020-rev-list-boundary.sh w/t/t6020-rev-list-boundary.sh\nnew file mode 100755\nindex 0000000000..f25e041951\n--- /dev/null\n+++ w/t/t6020-rev-list-boundary.sh\n@@ -0,0 +1,132 @@\n+#!/bin/sh\n+\n+test_description='rev-list/log boundary and root'\n+\n+. ./test-lib.sh\n+\n+test_expect_success 'setup' '\n+\ttest_commit A &&\n+\ttest_commit B &&\n+\tgit reset --hard A &&\n+\ttest_commit C &&\n+\n+\tgit checkout --orphan side &&\n+\tgit rm -fr . &&\n+\ttest_commit X &&\n+\ttest_commit Y &&\n+\n+\ttest_tick && git merge --allow-unrelated-histories -m \"M\" B &&\n+\ttest_tick && git merge -m \"N\" C &&\n+\ttest_commit Z\n+'\n+\n+test_expect_success 'log with boundary' '\n+\tgit log --graph --boundary --format='%s' ^A ^X Z >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t* Z\n+\t*   N\n+\t|\\  Q\n+\t| * C\n+\t* |   M\n+\t|\\ \\  Q\n+\t| * | B\n+\t| |/  Q\n+\t* | Y\n+\to | X\n+\t /  Q\n+\to A\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'log --left-right with symmetric boundary' '\n+\tgit log --graph --left-right --boundary --format='%s' B...C >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t> C\n+\t| < B\n+\t|/  Q\n+\to A\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'log --left-right with asymmetric boundary' '\n+\tgit log --graph --left-right --boundary --format='%s' ^A ^X Z >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t> Z\n+\t>   N\n+\t|\\  Q\n+\t| > C\n+\t> |   M\n+\t|\\ \\  Q\n+\t| > | B\n+\t| |/  Q\n+\t> | Y\n+\to | X\n+\t /  Q\n+\to A\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_failure 'log down to root' '\n+\tgit log --graph --format='%s' Z >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t* Z\n+\t*   N\n+\t|\\  Q\n+\t| * C\n+\t* |   M\n+\t|\\ \\  Q\n+\t| * | B\n+\t| |/  Q\n+\t| # A\n+\t* Y\n+\t# X\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_failure 'log down to root' '\n+\tgit log --graph --format='%s' B Y >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t* Y\n+\t# X\n+\t* B\n+\t# A\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_failure 'log that happens to show root' '\n+\tgit log --graph -3 --format='%s' B Y >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t* Y\n+\t# X\n+\t* B\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_failure 'log --left-right down to root' '\n+\tgit log --graph --left-right --format='%s' B...Y >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t> Y\n+\tR X\n+\t< B\n+\tL A\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_failure 'log --left-right that happens to show root' '\n+\tgit log --graph -3 --left-right --format='%s' B...Y >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t> Y\n+\tR X\n+\t< B\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_done\n"},{"id":"414561","messageId":"xmqq35yzmbf3.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"20210117110337.429994-2-kmarek@pdinc.us","subject":"Re: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-17T22:44:00Z","receivedAt":"2021-01-17T22:44:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kyle Marek <kmarek@pdinc.us> writes:\n\n> Subject: Re: [PATCH 1/2] revision: Denote root commits with '#'\n\nDowncase \"D\"; this will stand out in \"git shortlog --no-merges\" for\na wrong reason otherwise.\n\n> This aids in identifying where an unrelated branch history starts when\n> using `git log --graph --oneline --all`\n\nThis is triggerd only with --show-linear-break option, when combined\nwith [2/2]?  I think that is a bug introduced in the next step.\n\n> Signed-off-by: Kyle Marek <kmarek@pdinc.us>\n> ---\n>  revision.c | 6 ++++--\n>  1 file changed, 4 insertions(+), 2 deletions(-)\n>\n> diff --git a/revision.c b/revision.c\n> index 9dff845bed..8556923de8 100644\n> --- a/revision.c\n> +++ b/revision.c\n> @@ -4191,9 +4191,11 @@ const char *get_revision_mark(const struct rev_info *revs, const struct commit *\n>  \t\t\treturn \"<\";\n>  \t\telse\n>  \t\t\treturn \">\";\n> -\t} else if (revs->graph)\n> +\t} else if (revs->graph) {\n> +\t\tif (!commit->parents)\n> +\t\t\treturn \"#\";\n>  \t\treturn \"*\";\n> -\telse if (revs->cherry_mark)\n> +\t} else if (revs->cherry_mark)\n>  \t\treturn \"+\";\n>  \treturn \"\";\n>  }\n"},{"id":"414562","messageId":"xmqqsg6zkwa8.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"20210117110337.429994-3-kmarek@pdinc.us","subject":"Re: [PATCH 2/2] revision: implement --show-linear-break for --graph","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-17T22:56:15Z","receivedAt":"2021-01-17T22:57:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kyle Marek <kmarek@pdinc.us> writes:\n\n> where <barrier> sets rev_info.break_revision_mark, the revision mark\n> used for root commits.\n\nPlease make sure that the body of the proposed log message begins\nwith a full sentence, not as a continuation of a sentence that the\ntitle started (as a consequence, the title must be understandable\nwithout the help of the beginning part of the body, too).\n\n> Signed-off-by: Kyle Marek <kmarek@pdinc.us>\n> ---\n\n> diff --git a/revision.c b/revision.c\n> index 8556923de8..51deab2326 100644\n> --- a/revision.c\n> +++ b/revision.c\n> @@ -2402,10 +2402,12 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg\n>  \t\trevs->show_signature = 0;\n>  \t} else if (!strcmp(arg, \"--show-linear-break\")) {\n>  \t\trevs->break_bar = \"                    ..........\";\n> +\t\trevs->break_revision_mark = \"#\";\n>  \t\trevs->track_linear = 1;\n>  \t\trevs->track_first_time = 1;\n>  \t} else if (skip_prefix(arg, \"--show-linear-break=\", &optarg)) {\n>  \t\trevs->break_bar = xstrdup(optarg);\n> +\t\trevs->break_revision_mark = xstrdup(optarg);\n>  \t\trevs->track_linear = 1;\n>  \t\trevs->track_first_time = 1;\n>  \t} else if (skip_prefix(arg, \"--show-notes=\", &optarg) ||\n\nIn other words, revs->break_revision_mark is left NULL unless\n--show-linear-break is given.\n\n> @@ -4192,8 +4192,8 @@ const char *get_revision_mark(const struct rev_info *revs, const struct commit *\n>  \t\telse\n>  \t\t\treturn \">\";\n>  \t} else if (revs->graph) {\n> -\t\tif (!commit->parents)\n> -\t\t\treturn \"#\";\n> +\t\tif (revs->break_revision_mark && !commit->parents)\n> +\t\t\treturn revs->break_revision_mark;\n\nAnd that causes this to break.  Now \"--graph\" alone won't show '#'\nfor the root commits, despite that is what [1/2] wanted to do.\n\nHere is a fix-up, plus some minimum tests.  \n\nThe part to teach left-right codepath to show L/R is a fix-up to\n[1/2], not to this step.  You might want to change them to some\nleft/right punctuation letters, like () or [].\n\nThe other hunks in revision.c are fixes to step [2/2].\n\nI didn't test a custom --show-linear-break='My break line' in the\nattachedtest, so that it can be squashed into your [1/2] to test the\nfeature that step adds.  You should be able to add tests for that\nfeature in this step [2/2] on top.\n\nI still am skeptical that spending 3 more letters to denote roots is\nworth it, though.\n\n revision.c                   |  11 ++--\n t/t6020-rev-list-boundary.sh | 132 +++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 138 insertions(+), 5 deletions(-)\n\ndiff --git c/revision.c w/revision.c\nindex 33fbef5c08..55521c53af 100644\n--- c/revision.c\n+++ w/revision.c\n@@ -2402,7 +2402,6 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg\n \t\trevs->show_signature = 0;\n \t} else if (!strcmp(arg, \"--show-linear-break\")) {\n \t\trevs->break_bar = \"                    ..........\";\n-\t\trevs->break_revision_mark = \"#\";\n \t\trevs->track_linear = 1;\n \t\trevs->track_first_time = 1;\n \t} else if (skip_prefix(arg, \"--show-linear-break=\", &optarg)) {\n@@ -4219,12 +4218,14 @@ const char *get_revision_mark(const struct rev_info *revs, const struct commit *\n \t\treturn \"=\";\n \telse if (!revs || revs->left_right) {\n \t\tif (commit->object.flags & SYMMETRIC_LEFT)\n-\t\t\treturn \"<\";\n+\t\t\treturn commit->parents ? \"<\" : \"L\";\n \t\telse\n-\t\t\treturn \">\";\n+\t\t\treturn commit->parents ? \">\" : \"R\";\n \t} else if (revs->graph) {\n-\t\tif (revs->break_revision_mark && !commit->parents)\n-\t\t\treturn revs->break_revision_mark;\n+\t\tif (!commit->parents)\n+\t\t\treturn (revs->break_revision_mark \n+\t\t\t\t? revs->break_revision_mark\n+\t\t\t\t: \"#\");\n \t\treturn \"*\";\n \t} else if (revs->cherry_mark)\n \t\treturn \"+\";\ndiff --git c/t/t6020-rev-list-boundary.sh w/t/t6020-rev-list-boundary.sh\nnew file mode 100755\nindex 0000000000..35614e9baf\n--- /dev/null\n+++ w/t/t6020-rev-list-boundary.sh\n@@ -0,0 +1,132 @@\n+#!/bin/sh\n+\n+test_description='rev-list/log boundary and root'\n+\n+. ./test-lib.sh\n+\n+test_expect_success 'setup' '\n+\ttest_commit A &&\n+\ttest_commit B &&\n+\tgit reset --hard A &&\n+\ttest_commit C &&\n+\n+\tgit checkout --orphan side &&\n+\tgit rm -fr . &&\n+\ttest_commit X &&\n+\ttest_commit Y &&\n+\n+\ttest_tick && git merge --allow-unrelated-histories -m \"M\" B &&\n+\ttest_tick && git merge -m \"N\" C &&\n+\ttest_commit Z\n+'\n+\n+test_expect_success 'log with boundary' '\n+\tgit log --graph --boundary --format='%s' ^A ^X Z >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t* Z\n+\t*   N\n+\t|\\  Q\n+\t| * C\n+\t* |   M\n+\t|\\ \\  Q\n+\t| * | B\n+\t| |/  Q\n+\t* | Y\n+\to | X\n+\t /  Q\n+\to A\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'log --left-right with symmetric boundary' '\n+\tgit log --graph --left-right --boundary --format='%s' B...C >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t> C\n+\t| < B\n+\t|/  Q\n+\to A\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'log --left-right with asymmetric boundary' '\n+\tgit log --graph --left-right --boundary --format='%s' ^A ^X Z >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t> Z\n+\t>   N\n+\t|\\  Q\n+\t| > C\n+\t> |   M\n+\t|\\ \\  Q\n+\t| > | B\n+\t| |/  Q\n+\t> | Y\n+\to | X\n+\t /  Q\n+\to A\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'log down to root' '\n+\tgit log --graph --format='%s' Z >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t* Z\n+\t*   N\n+\t|\\  Q\n+\t| * C\n+\t* |   M\n+\t|\\ \\  Q\n+\t| * | B\n+\t| |/  Q\n+\t| # A\n+\t* Y\n+\t# X\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'log down to root' '\n+\tgit log --graph --format='%s' B Y >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t* Y\n+\t# X\n+\t* B\n+\t# A\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'log that happens to show root' '\n+\tgit log --graph -3 --format='%s' B Y >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t* Y\n+\t# X\n+\t* B\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'log --left-right down to root' '\n+\tgit log --graph --left-right --format='%s' B...Y >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t> Y\n+\tR X\n+\t< B\n+\tL A\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_success 'log --left-right that happens to show root' '\n+\tgit log --graph -3 --left-right --format='%s' B...Y >actual &&\n+\tsed -e \"s/Q$//\" >expect <<-\\EOF &&\n+\t> Y\n+\tR X\n+\t< B\n+\tEOF\n+\ttest_cmp expect actual\n+'\n+\n+test_done\n"},{"id":"414573","messageId":"xmqq35yzknbr.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"xmqqsg6zkwa8.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 2/2] revision: implement --show-linear-break for --graph","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-18T02:09:44Z","receivedAt":"2021-01-18T02:14:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> In other words, revs->break_revision_mark is left NULL unless\n> --show-linear-break is given.\n>\n>> @@ -4192,8 +4192,8 @@ const char *get_revision_mark(const struct rev_info *revs, const struct commit *\n>>  \t\telse\n>>  \t\t\treturn \">\";\n>>  \t} else if (revs->graph) {\n>> -\t\tif (!commit->parents)\n>> -\t\t\treturn \"#\";\n>> +\t\tif (revs->break_revision_mark && !commit->parents)\n>> +\t\t\treturn revs->break_revision_mark;\n>\n> And that causes this to break.  Now \"--graph\" alone won't show '#'\n> for the root commits, despite that is what [1/2] wanted to do.\n>\n> Here is a fix-up, plus some minimum tests.  \n\nHaving said all that, I do not mind if the new markings were\nactivated only when --show-linear-break option (or a separate new\noption) is given.  But if that is where we want to go, your [1/2]\nthat uses the new markings unconditionally is a regression.\n\nA better organization, if we wanted to have multiple and smaller\nsteps than a single whole thing, would be:\n\n [1/2] Introduce a new \"--mark-root-commits\" option, or abuse the\n       existing \"--show-linear-break\" option, and change \"*<>\"\n       marking used for commits to \"#LR\" (or whatever appropriate)\n       when the option is in effect.  Document the behaviour and add\n       tests.\n\n [2/2] Introduce \"--show-linear-break=<custom-value>\" option.\n       Document the behaviour and add tests.\n\nIf you apply [1/2] and [2/2] with the earlier fixes I sent, you'll\nsee many fallouts from existing tests, as the representation of the\nroot commit is changed unconditionally.  We view breakages of tests\nas a rough estimate of how badly end-user scripts could break, and\nthe picture was not very pretty.  And that is why I am suggesting\nthe above \"only do the new markings when asked, not unconditionally\"\napproach.\n\nI still am skeptical that spending 3 more letters to denote roots is\nworth it, though.\n\nThanks.\n"},{"id":"414585","messageId":"e0264a29-2112-f8c8-f066-2be445654d8e@pdinc.us","threadId":"54990","inReplyTo":"xmqq7dobmfrq.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Kyle Marek","fromEmail":"kmarek@pdinc.us","sentAt":"2021-01-18T07:56:22Z","receivedAt":"2021-01-18T07:57:10Z","isPatch":true,"sender":{"key":"kmarek@pdinc.us","avatar":null},"body":"On 1/17/21 4:10 PM, Junio C Hamano wrote:\n> Kyle Marek<kmarek@pdinc.us>  writes:\n>\n>> This aids in identifying where an unrelated branch history starts when\n>> using `git log --graph --oneline --all`\n>>\n>> Signed-off-by: Kyle Marek<kmarek@pdinc.us>\n>> ---\n>>   revision.c | 6 ++++--\n>>   1 file changed, 4 insertions(+), 2 deletions(-)\n> No tests?\n\nI'm not very familiar with the code base. I now see the t/README file.\n\n>> diff --git a/revision.c b/revision.c\n>> index 9dff845bed..8556923de8 100644\n>> --- a/revision.c\n>> +++ b/revision.c\n>> @@ -4191,9 +4191,11 @@ const char *get_revision_mark(const struct rev_info *revs, const struct commit *\n>>   \t\t\treturn \"<\";\n>>   \t\telse\n>>   \t\t\treturn \">\";\n>> -\t} else if (revs->graph)\n>> +\t} else if (revs->graph) {\n>> +\t\tif (!commit->parents)\n>> +\t\t\treturn \"#\";\n>>   \t\treturn \"*\";\n>> -\telse if (revs->cherry_mark)\n>> +\t} else if (revs->cherry_mark)\n>>   \t\treturn \"+\";\n>>   \treturn \"\";\n>>   }\n> Here is what I tried to come up with, but somehow the \"#\" marker is\n> not showing for me.\n>\n> The \"counted plus --left-right\" tests stress why a single \"#\" is not\n> good enough.  I think the patch also needs to replace \"<\" and \">\"\n> for root commits that are left and right---in the tests, I used \"L\"\n> to denote \"root that is on the left side\" (and \"R\" for the right\n> side) instead of single \"#\", so that we do not to lose information.\n>\n> By the way, as I already said in the original thread, I do not think\n> the '#' marking is a good idea; I'd rather see the root commit shown\n> by shifting columns.\n\nSorry, I wasn't subscribed to the list until Jason CC'd me on his \nrequest. I also wasn't aware of --left-right.\n\nI'll investigate the revision-mark shifting idea. I am concerned that it \nwould get complicated if a graph edge extends around a revision that \nneeds to be shifted, but I'm finding it difficult to produce this with \n--graph:\n\n*   8d82d0a (HEAD -> master) Merge branch 'o1'\n|\\\n| * 3479914 (o1) O1\n| * a674e07 O1        <-- root commit\n| * 2237b52 (t) T\n| * f525fa5 T\n|/\n* f15f936 A\n| * 9e289ed (u) U\n|/\n* ee911c8 initial     <-- root commit\n\nvs:\n\n*   8ee9b14 (HEAD -> master) Merge branch 'u'\n|\\\n| * ed1990f (u) U\n* |   277f31c Merge branch 'o1'\n|\\ \\\n| * | eaa71bb (o1) O1\n| * | 9203a43 O1      <-- root commit\n|  /\n| | * bc2c4d9 (t) T\n| | * 2d3c03b T\n| |/\n|/|\n* | 6a26183 A\n|/\n* da85ccf initial     <-- root commit\n  \n\nThoughts? Will git ever graph something like:\n\n*\n|\\\n| *\n* |\n|\\ \\\n| * | <-- root commit\n| * | <-- some head\n|/ /\n* /\n|/\n*     <-- root commit\n\n-- \n\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n-                                                               -\n- Kyle Marek                        PD Inc.http://www.pdinc.us  -\n- Jr. Developer                     10 West 24th Street #100    -\n- +1 (443) 269-1555 x361            Baltimore, Maryland 21218   -\n-                                                               -\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n"},{"id":"414586","messageId":"04c81462-3181-37d7-0109-4292040b84e9@pdinc.us","threadId":"54990","inReplyTo":"xmqq35yzknbr.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 2/2] revision: implement --show-linear-break for --graph","fromName":"Kyle Marek","fromEmail":"kmarek@pdinc.us","sentAt":"2021-01-18T07:56:24Z","receivedAt":"2021-01-18T07:57:36Z","isPatch":true,"sender":{"key":"kmarek@pdinc.us","avatar":null},"body":"On 1/17/21 9:09 PM, Junio C Hamano wrote:\n> Junio C Hamano<gitster@pobox.com>  writes:\n>\n>> In other words, revs->break_revision_mark is left NULL unless\n>> --show-linear-break is given.\n>>\n>>> @@ -4192,8 +4192,8 @@ const char *get_revision_mark(const struct rev_info *revs, const struct commit *\n>>>   \t\telse\n>>>   \t\t\treturn \">\";\n>>>   \t} else if (revs->graph) {\n>>> -\t\tif (!commit->parents)\n>>> -\t\t\treturn \"#\";\n>>> +\t\tif (revs->break_revision_mark && !commit->parents)\n>>> +\t\t\treturn revs->break_revision_mark;\n>> And that causes this to break.  Now \"--graph\" alone won't show '#'\n>> for the root commits, despite that is what [1/2] wanted to do.\n>>\n>> Here is a fix-up, plus some minimum tests.\n> Having said all that, I do not mind if the new markings were\n> activated only when --show-linear-break option (or a separate new\n> option) is given.  But if that is where we want to go, your [1/2]\n> that uses the new markings unconditionally is a regression.\n>\n> A better organization, if we wanted to have multiple and smaller\n> steps than a single whole thing, would be:\n>\n>   [1/2] Introduce a new \"--mark-root-commits\" option, or abuse the\n>         existing \"--show-linear-break\" option, and change \"*<>\"\n>         marking used for commits to \"#LR\" (or whatever appropriate)\n>         when the option is in effect.  Document the behaviour and add\n>         tests.\n>\n>   [2/2] Introduce \"--show-linear-break=<custom-value>\" option.\n>         Document the behaviour and add tests.\n>\n> If you apply [1/2] and [2/2] with the earlier fixes I sent, you'll\n> see many fallouts from existing tests, as the representation of the\n> root commit is changed unconditionally.  We view breakages of tests\n> as a rough estimate of how badly end-user scripts could break, and\n> the picture was not very pretty.  And that is why I am suggesting\n> the above \"only do the new markings when asked, not unconditionally\"\n> approach.\n\nSorry. I didn't make this clear. It is not an accident that patch 1 \ndenotes root commits unconditionally and patch 2 makes it optional. I \npresent two choices. If we prefer to unconditionally denote root \ncommits, patch 2 may be left out, otherwise, patch 1 should be squashed \naway.\n\nI didn't have an opinion towards either option, but you make a good \npoint about end-user scripts.\n\n> I still am skeptical that spending 3 more letters to denote roots is\n> worth it, though.\n\nMe too, but I think a user-defined mark needs to be a string to support \nUnicode characters.\n\n-- \n\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n-                                                               -\n- Kyle Marek                        PD Inc.http://www.pdinc.us  -\n- Jr. Developer                     10 West 24th Street #100    -\n- +1 (443) 269-1555 x361            Baltimore, Maryland 21218   -\n-                                                               -\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n"},{"id":"414613","messageId":"xmqqwnwajbuj.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"e0264a29-2112-f8c8-f066-2be445654d8e@pdinc.us","subject":"Re: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-18T19:15:16Z","receivedAt":"2021-01-18T19:52:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kyle Marek <kmarek@pdinc.us> writes:\n\n> I'll investigate the revision-mark shifting idea. I am concerned that\n> it would get complicated if a graph edge extends around a revision\n> that needs to be shifted,...\n\nThe \"current graph layout makes it harder to see where the root is\"\nproblem has a natural solution: fix the graph layout so that the\nroot is easily visible.\n\nI however think it is a much harder approach to solve than using a\ndifferent mark for root commits, and it is the reason why there have\nbeen at least a few attempts in the past that did essentially the\nsame patch as yours, plus the \"linear break\" which we accepted.\n\n> *   8d82d0a (HEAD -> master) Merge branch 'o1'\n> |\\\n> | * 3479914 (o1) O1\n> | * a674e07 O1        <-- root commit\n> | * 2237b52 (t) T\n> | * f525fa5 T\n> |/\n> * f15f936 A\n> | * 9e289ed (u) U\n> |/\n> * ee911c8 initial     <-- root commit\n>\n> vs:\n>\n> *   8ee9b14 (HEAD -> master) Merge branch 'u'\n> |\\\n> | * ed1990f (u) U\n> * |   277f31c Merge branch 'o1'\n> |\\ \\\n> | * | eaa71bb (o1) O1\n> | * | 9203a43 O1      <-- root commit\n> |  /\n> | | * bc2c4d9 (t) T\n> | | * 2d3c03b T\n> | |/\n> |/|\n> * | 6a26183 A\n> |/\n> * da85ccf initial     <-- root commit\n\nSorry, I am not quite sure what you are trying to illustrate with\nthe comparison between the above two.  The latter makes it clear\nthat 9203a43 and da85ccf do not have parents in the depicted part of\nthe history [*1*].\n\nIn the former one, does 2237b52 have no child in the depicted part of\nthe history, and is the problem that it appears as if it has a674e07\nas a child?  I wonder if we can just shift them, either:\n\n> *   8d82d0a (HEAD -> master) Merge branch 'o1'\n> |\\__\n> |   * 3479914 (o1) O1\n> |   * a674e07 O1        <-- root commit\n> | * 2237b52 (t) T\n> | * f525fa5 T\n> |/\n> * f15f936 A\n\nor\n\n> *   8d82d0a (HEAD -> master) Merge branch 'o1'\n> |\\\n> | * 3479914 (o1) O1\n> | * a674e07 O1        <-- root commit\n> |   * 2237b52 (t) T\n> | __* f525fa5 T\n> |/\n> * f15f936 A\n\nOr we could punt to show it with an extra blank line, although it is\nsuboptimial.\n\n> *   8d82d0a (HEAD -> master) Merge branch 'o1'\n> |\\\n> | * 3479914 (o1) O1\n> | * a674e07 O1        <-- root commit\n> |\n> | * 2237b52 (t) T\n> | * f525fa5 T\n> |/\n> * f15f936 A\n\n\n[Footnote]\n\n*1* Stepping back a bit, I think concentrating too much on \"is it\n    root?\" is a wrong way to think about the problem.  Suppose you\n    have two histories, e.g. (time flows from left to right; A and X\n    are roots)\n\n            A---B\n                 \\\n          X---Y---Z\n\n    and doing \"git log --graph --oneline Z\" would show A, B, X, Y\n    and Z.\n\n    If it benefits to show \"A\" (and \"X\") specially in the graph,\n    that would mean that the current algorithm would show some other\n    commit after showing A (probably X if it goes in chronological\n    order), and it probably is confusing because X is shown on the\n    same column as A, when there is no parent-child relationship\n    between them (A is root after all).\n\n    We are trying to highlight that A is not a child of anybody by\n    using '#' instead.\n\n    But in a slightly modified graph:\n\n          C\n         /\n        O---A---B\n                 \\\n          X---Y---Z\n\n    if you do \"git log --graph --oneline C..Z\", you should see the\n    same commits listed as above (A, B, X, Y and Z), and most likely\n    in the same order.\n\n    So special casing by \"Ah, A is a root commit, so let's show it\n    with '#'\" does not help, even though we are facing exactly the\n    same problem in the latter graph.\n\n    And the right way to look at it is \"does A have any parent in\n    the part of the history being shown?\", not \"does A have any\n    parent?\"  Then 'A' will get exactly the same treatment in the\n    two examples, and the visual problem that makes A appear as if\n    it has parent-child relationship with unrelated commit X goes\n    away.\n\n    \n"},{"id":"414618","messageId":"xmqqr1mij88k.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"xmqqwnwajbuj.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-18T20:33:15Z","receivedAt":"2021-01-18T20:34:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> [Footnote]\n>\n> *1* Stepping back a bit, I think concentrating too much on \"is it\n>     root?\" is a wrong way to think about the problem.  Suppose you\n>     have two histories, e.g. (time flows from left to right; A and X\n>     are roots)\n\nA shorter and more concrete example.  Start from an empty repository:\n\n\t$ git init\n\t$ git commit --allow-empty -m Aroot\n\t$ git checkout --orphan side\n\t$ git commit --allow-empty -m Xroot\n\t$ git log --all --graph --oneline\n        * a1f7cb2 (HEAD -> side) Xroot\n        * b6fb655 (master) Aroot\n\nThese depict two root commits, Aroot and Xroot, and no other\ncommits.  We do want to show that these two commits do not have\nparent-child relationship at all, and your (and a few proposals made\nby other in the past) solution was to show them both with \"#\".\n\nContinuing in the same repository:\n\n\t$ git checkout --orphan another\n\t$ git commit --allow-empty -m Oroot\n\t$ git commit --allow-empty -m A\n\t$ git log --graph --oneline ^another^ another side\n        * eddf116 (HEAD -> another) A\n        * a1f7cb2 (side) Xroot\n\nThese depict two commits, A and Xroot, and no other commits.  We\nalso want to show that these two commits do not have parent-child\nrelationship at all, but if we paint Xroot with \"#\", it still makes\nit appear that A is a child of Xroot.\n\n>     And the right way to look at it is \"does A have any parent in\n>     the part of the history being shown?\", not \"does A have any\n>     parent?\"  Then 'A' will get exactly the same treatment in the\n>     two examples, and the visual problem that makes A appear as if\n>     it has parent-child relationship with unrelated commit X goes\n>     away.\n\nSo the condition we saw in your patches, !commit->parents, which\nattempted to see if it was root, needs to be replaced with a helper\nfunction that checks if there is any parent that is shown in the\noutput.  Perhaps\n\n\tint no_interesting_parents(struct commit *commit)\n\t{\n\t\tstruct commit_list *parents = commit->parents;\n\n\t\twhile (parents) {\n\t\t\tif (!(parents->object.flags & UNINTERESTING))\n\t\t\t\treturn 0;\n\t\t\tparents = parents->next;\n\t\t}\n\t\treturn 1;\n\t}\n\nor something like that should serve as a replacement, i.e.\n\n\treturn !commit->parents ? \"#\" : \"*\";\n\nwould become\n\n\treturn no_interesting_parents(commit) ? \"#\" : \"*\";\n\nHmm?\n\n"},{"id":"414629","messageId":"xmqqmtx6j6wt.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"04c81462-3181-37d7-0109-4292040b84e9@pdinc.us","subject":"Re: [PATCH 2/2] revision: implement --show-linear-break for --graph","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-18T21:01:54Z","receivedAt":"2021-01-18T21:10:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kyle Marek <kmarek@pdinc.us> writes:\n\n> Me too, but I think a user-defined mark needs to be a string to\n> support Unicode characters.\n\nAhh, I didn't even consider making it user-defined.\n\nAs it seems a lot safer to make this an optional feature, it does\nsort-of make sense to let the letters used for root & left-root be\ncustomizable, and it does make sense to take a multi-byte character,\nbut I am not sure what implications it has if we allowed any string\nwithout ensuring that it occupies one display column.\n\n"},{"id":"414669","messageId":"04380a95-b8cf-f246-e496-dc469f617eb5@pdinc.us","threadId":"54990","inReplyTo":"xmqqmtx6j6wt.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 2/2] revision: implement --show-linear-break for --graph","fromName":"Kyle Marek","fromEmail":"kmarek@pdinc.us","sentAt":"2021-01-19T07:44:02Z","receivedAt":"2021-01-19T07:48:18Z","isPatch":true,"sender":{"key":"kmarek@pdinc.us","avatar":null},"body":"On 1/18/21 4:01 PM, Junio C Hamano wrote:\n> Kyle Marek <kmarek@pdinc.us> writes:\n>\n>> Me too, but I think a user-defined mark needs to be a string to\n>> support Unicode characters.\n> Ahh, I didn't even consider making it user-defined.\n>\n> As it seems a lot safer to make this an optional feature, it does\n> sort-of make sense to let the letters used for root & left-root be\n> customizable, and it does make sense to take a multi-byte character,\n> but I am not sure what implications it has if we allowed any string\n> without ensuring that it occupies one display column.\n\nDoes git, or a dependency library, have the ability to interpret TERM \nand locale to determine on-screen character count/size?\n\nIf not, maybe let users use multi-character strings, but call it misuse \nof the option that will mess offset that row of the --graph output until \nwe have something to determine on-screen size.\n\n-- \n\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n-                                                               -\n- Kyle Marek                        PD Inc. http://www.pdinc.us -\n- Jr. Developer                     10 West 24th Street #100    -\n- +1 (443) 269-1555 x361            Baltimore, Maryland 21218   -\n-                                                               -\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n"},{"id":"414672","messageId":"237aeef3-239f-bff4-fa17-5581092c8f51@pdinc.us","threadId":"54990","inReplyTo":"xmqqr1mij88k.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Kyle Marek","fromEmail":"kmarek@pdinc.us","sentAt":"2021-01-19T07:43:57Z","receivedAt":"2021-01-19T07:56:07Z","isPatch":true,"sender":{"key":"kmarek@pdinc.us","avatar":null},"body":"On 1/18/21 3:33 PM, Junio C Hamano wrote:\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> [Footnote]\n>>\n>> *1* Stepping back a bit, I think concentrating too much on \"is it\n>>      root?\" is a wrong way to think about the problem.  Suppose you\n>>      have two histories, e.g. (time flows from left to right; A and X\n>>      are roots)\n> A shorter and more concrete example.  Start from an empty repository:\n>\n> \t$ git init\n> \t$ git commit --allow-empty -m Aroot\n> \t$ git checkout --orphan side\n> \t$ git commit --allow-empty -m Xroot\n> \t$ git log --all --graph --oneline\n>          * a1f7cb2 (HEAD -> side) Xroot\n>          * b6fb655 (master) Aroot\n>\n> These depict two root commits, Aroot and Xroot, and no other\n> commits.  We do want to show that these two commits do not have\n> parent-child relationship at all, and your (and a few proposals made\n> by other in the past) solution was to show them both with \"#\".\n>\n> Continuing in the same repository:\n>\n> \t$ git checkout --orphan another\n> \t$ git commit --allow-empty -m Oroot\n> \t$ git commit --allow-empty -m A\n> \t$ git log --graph --oneline ^another^ another side\n>          * eddf116 (HEAD -> another) A\n>          * a1f7cb2 (side) Xroot\n>\n> These depict two commits, A and Xroot, and no other commits.  We\n> also want to show that these two commits do not have parent-child\n> relationship at all, but if we paint Xroot with \"#\", it still makes\n> it appear that A is a child of Xroot.\n>\n>>      And the right way to look at it is \"does A have any parent in\n>>      the part of the history being shown?\", not \"does A have any\n>>      parent?\"  Then 'A' will get exactly the same treatment in the\n>>      two examples, and the visual problem that makes A appear as if\n>>      it has parent-child relationship with unrelated commit X goes\n>>      away.\n> So the condition we saw in your patches, !commit->parents, which\n> attempted to see if it was root, needs to be replaced with a helper\n> function that checks if there is any parent that is shown in the\n> output.  Perhaps\n>\n> \tint no_interesting_parents(struct commit *commit)\n> \t{\n> \t\tstruct commit_list *parents = commit->parents;\n>\n> \t\twhile (parents) {\n> \t\t\tif (!(parents->object.flags & UNINTERESTING))\n> \t\t\t\treturn 0;\n> \t\t\tparents = parents->next;\n> \t\t}\n> \t\treturn 1;\n> \t}\n>\n> or something like that should serve as a replacement, i.e.\n>\n> \treturn !commit->parents ? \"#\" : \"*\";\n>\n> would become\n>\n> \treturn no_interesting_parents(commit) ? \"#\" : \"*\";\n>\n> Hmm?\n\nOkay, I see what you mean. Fixing --graph to avoid implying ancestry \nsounds like a better approach to me.\n\nThat being said, I spoke to Jason recently, and he expressed interest in \noptionally marking root commits so they are easy to search for in a \ngraph with something like /# in `less`. I see value in this, too.\n\nSo would you be open to my modifying of the patch in question (patch 1+2 \nsquashed, I guess) to instead use \"--mark-roots=<mark>\" to optionally \nmark root commits with a string <mark>, and pursue fixing the --graph \nrendering issue in another series?\n\nIf so, what would you like to see out of the --left-right issue? Maybe \n\"--mark-left-root=<mark>\" and \"--mark-right-root=<mark>\", so multi-byte \nstrings may be used? Can there be more than one root on either side? (so \nthe option would use a plural \"roots\" instead of \"root\"?)\n\n-- \n\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n-                                                               -\n- Kyle Marek                        PD Inc. http://www.pdinc.us -\n- Jr. Developer                     10 West 24th Street #100    -\n- +1 (443) 269-1555 x361            Baltimore, Maryland 21218   -\n-                                                               -\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n"},{"id":"414733","messageId":"xmqq1reginnq.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"237aeef3-239f-bff4-fa17-5581092c8f51@pdinc.us","subject":"Re: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-19T22:10:01Z","receivedAt":"2021-01-19T22:11:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kyle Marek <kmarek@pdinc.us> writes:\n\n>> So the condition we saw in your patches, !commit->parents, which\n>> attempted to see if it was root, needs to be replaced with a helper\n>> function that checks if there is any parent that is shown in the\n>> output.\n>> ...\n>> Hmm?\n>\n> Okay, I see what you mean. Fixing --graph to avoid implying ancestry\n> sounds like a better approach to me.\n\nSorry, I do not know how you drew that conclusion from my\ndescription.\n\nAll I meant to convey is \"roots are not special at all, commits that\ndo not have parents in the parts of the history shown are, and care\nmust be taken to ensure that they do not appear to have parents\".\n\nAnd the argument applies equally to either of two approaches.\nWhether the solution chosen is\n\n (1) to use special set of markers \"{#}\" for commits that do not\n     have parents in the displayed part of the history instead of\n     the usual \"<*>\", or\n\n (2) to stick to the normal set of markers \"<*>\" but shift the graph\n     to avoid false ancestry.\n\nwe shouldn't be special casing \"root commits\" just because they are\nroots.  Exactly the same issue exists for non-root commits whose\nparents are not shown in the output, if commits from unrelated\nancestry is drawn directly below them.\n\n> That being said, I spoke to Jason recently, and he expressed interest\n> in optionally marking root commits so they are easy to search for in a \n> graph with something like /# in `less`. I see value in this,\n\nI do not mind to denote the \"this commit may appear directly on top\nof another commit, but there is no ancestry\" situation with a\nspecial set of markers that is different from the usual \"<*>\" (for\nleft, normal and right) set.  I agree pagers are good ways to /search\nthings in the output.\n\n> So would you be open to my modifying of the patch in question (patch\n> 1+2 squashed, I guess) to instead use \"--mark-roots=<mark>\" to\n> optionally mark root commits with a string <mark>, and pursue fixing\n> the --graph rendering issue in another series?\n\nI do not mind if the graph rendering fix does not happen yet again;\nIIRC the past contributors couldn't implement it, either.\n\nI think this new feature should be made opt-in by introducing a new\noption (without giving it a configuration variable), with explicit\n\"--no-<option>\" supported to countermand a \"--<option>=#\" that may\nappear earlier on the command line (or prepare your scripts for\nlater introduction of such a configuration variable).\n\nI do find it troubling if the <option> has \"root\" in its name, and I\nwould find it even more troubling if the feature somehow treated\nroot commits specially but not other commits that do not have their\nparents shown.  It was the primary point I wanted to stress in the\nprevious two message [*1*].\n\nI am hoping that a single option can give three-tuple that replaces\nthe usual \"<*>\", with perhaps the default of \"{#}\" or something.\n\nI however offhand do not think of a way to make \"left root\" appear\nin the output, but because we'd need \"right root\" that looks\ndifferent from \">\" anyway, it may make sense to allow specifying\n\"left root\" just for symmetry.\n\n\n[Footnote]\n\n*1* But if we do not think of a good option name without the word\n    \"root\" in it, I might be talked into a name with \"root\", as long\n    as we clearly describe (1) that commits that has parents that\n    are not shown in the history are also shown with these letters,\n    and (2) that new contributors are welcome to try coming up with\n    a new name for the option to explain the behaviour better, but\n    are not welcome to argue that the option should special case\n    root commits only because the option is named with \"root\" in it.\n\n\n"},{"id":"414771","messageId":"460257a2-478a-eb4c-f6fa-b1cc55384cd5@pdinc.us","threadId":"54990","inReplyTo":"xmqq1reginnq.fsf@gitster.c.googlers.com","subject":"Re: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Kyle Marek","fromEmail":"kmarek@pdinc.us","sentAt":"2021-01-20T03:25:48Z","receivedAt":"2021-01-20T03:27:14Z","isPatch":true,"sender":{"key":"kmarek@pdinc.us","avatar":null},"body":"On 1/19/21 5:10 PM, Junio C Hamano wrote:\n> Kyle Marek <kmarek@pdinc.us> writes:\n>\n>>> So the condition we saw in your patches, !commit->parents, which\n>>> attempted to see if it was root, needs to be replaced with a helper\n>>> function that checks if there is any parent that is shown in the\n>>> output.\n>>> ...\n>>> Hmm?\n>> Okay, I see what you mean. Fixing --graph to avoid implying ancestry\n>> sounds like a better approach to me.\n> Sorry, I do not know how you drew that conclusion from my\n> description.\n>\n> All I meant to convey is \"roots are not special at all, commits that\n> do not have parents in the parts of the history shown are, and care\n> must be taken to ensure that they do not appear to have parents\".\n\nYeah, I guess I am confused. I thought \"Fixing --graph to avoid implying \nancestry\" was reaching the same point as \"care must be taken to ensure \nthat [commits without parents shown] do not appear to have parents\". (I \nwasn't just talking about root commits at that point)\n\n> And the argument applies equally to either of two approaches.\n> Whether the solution chosen is\n>\n>   (1) to use special set of markers \"{#}\" for commits that do not\n>       have parents in the displayed part of the history instead of\n>       the usual \"<*>\", or\n>\n>   (2) to stick to the normal set of markers \"<*>\" but shift the graph\n>       to avoid false ancestry.\n>\n> we shouldn't be special casing \"root commits\" just because they are\n> roots.  Exactly the same issue exists for non-root commits whose\n> parents are not shown in the output, if commits from unrelated\n> ancestry is drawn directly below them.\n\nI understand. Coming back to the \"root commit\" situation below.\n\n>> That being said, I spoke to Jason recently, and he expressed interest\n>> in optionally marking root commits so they are easy to search for in a\n>> graph with something like /# in `less`. I see value in this,\n> I do not mind to denote the \"this commit may appear directly on top\n> of another commit, but there is no ancestry\" situation with a\n> special set of markers that is different from the usual \"<*>\" (for\n> left, normal and right) set.  I agree pagers are good ways to /search\n> things in the output.\n>\n>> So would you be open to my modifying of the patch in question (patch\n>> 1+2 squashed, I guess) to instead use \"--mark-roots=<mark>\" to\n>> optionally mark root commits with a string <mark>, and pursue fixing\n>> the --graph rendering issue in another series?\n> I do not mind if the graph rendering fix does not happen yet again;\n> IIRC the past contributors couldn't implement it, either.\n>\n> I think this new feature should be made opt-in by introducing a new\n> option (without giving it a configuration variable), with explicit\n> \"--no-<option>\" supported to countermand a \"--<option>=#\" that may\n> appear earlier on the command line (or prepare your scripts for\n> later introduction of such a configuration variable).\n\nOkay\n\n> I do find it troubling if the <option> has \"root\" in its name, and I\n> would find it even more troubling if the feature somehow treated\n> root commits specially but not other commits that do not have their\n> parents shown.  It was the primary point I wanted to stress in the\n> previous two message [*1*].\n\nI'll come back to this below.\n\n> I am hoping that a single option can give three-tuple that replaces\n> the usual \"<*>\", with perhaps the default of \"{#}\" or something.\n\nI thought about that, but can we handle any of the three markers being \nmulti-byte characters?\n\n> I however offhand do not think of a way to make \"left root\" appear\n> in the output, but because we'd need \"right root\" that looks\n> different from \">\" anyway, it may make sense to allow specifying\n> \"left root\" just for symmetry.\n\nI'm thinking on that one. I need to learn more about --left-right. I \ndon't know how/when to use it yet.\n\n> [Footnote]\n>\n> *1* But if we do not think of a good option name without the word\n>      \"root\" in it, I might be talked into a name with \"root\", as long\n>      as we clearly describe (1) that commits that has parents that\n>      are not shown in the history are also shown with these letters,\n>      and (2) that new contributors are welcome to try coming up with\n>      a new name for the option to explain the behaviour better, but\n>      are not welcome to argue that the option should special case\n>      root commits only because the option is named with \"root\" in it.\n\nSo, on the root vs parents-not-shown commits issue:\n\nYou're right. Commits with their parents hidden by the range specifiers \nhave the same graphing issue as root commits.\n\nWhile root commits are not a special case in the sense that --graph \nmakes ancestor implications for more than just root commits, root \ncommits are a special case when we think about interpreting the presence \nof hidden lineage in --graph output.\n\nConsidering one of your examples:\n\n           C\n          /\n         O---A---B\n                  \\\n           X---Y---Z\n\nWhen graphing C..Z, git produces output like:\n\n*   0fbb0dc (HEAD -> z) Z\n|\\\n| * 11be529 (master) B\n| * 8dd1b85 A\n* 851a915 Y\n* 27d3ed0 (x) X\n\nWe cannot tell from the above graph alone that X is a root and A is not.\n\nSo I think it might be useful if I could do --mark-roots='#' \n--mark-hidden-lineage=$'\\u22ef' (Unicode Midline Horizontal Ellipsis) to \nproduce the following:\n\n*   0fbb0dc (HEAD -> z) Z\n|\\\n| * 11be529 (master) B\n| ⋯ 8dd1b85 A\n* 851a915 Y\n# 27d3ed0 (x) X\n\nAlternatively, it could be argued that --boundary can be used to \nindicate a hidden lineage, since root commits do not have boundary \ncommits listed below them. But --boundary draws one more commit than \nnecessary, and there still isn't an easy way to search for roots in the \npager.\n\nI understand that I am now leaving the original scope of the issue, but \nI think it is worth considering.\n\nOf course, I would also like to try fixing the original graphing issue \nin general.\n\nThoughts?\n\n-- \n\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n-                                                               -\n- Kyle Marek                        PD Inc. http://www.pdinc.us -\n- Jr. Developer                     10 West 24th Street #100    -\n- +1 (443) 269-1555 x361            Baltimore, Maryland 21218   -\n-                                                               -\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n\n"},{"id":"414776","messageId":"xmqqo8hkgl4h.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"460257a2-478a-eb4c-f6fa-b1cc55384cd5@pdinc.us","subject":"Re: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-20T06:47:42Z","receivedAt":"2021-01-20T06:50:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Kyle Marek <kmarek@pdinc.us> writes:\n\n> When graphing C..Z, git produces output like:\n>\n> *   0fbb0dc (HEAD -> z) Z\n> |\\\n> | * 11be529 (master) B\n> | * 8dd1b85 A\n> * 851a915 Y\n> * 27d3ed0 (x) X\n>\n> We cannot tell from the above graph alone that X is a root and A is not.\n\nI actually do not see that as a problem.  In the past several years,\nI've never needed to see \"log --graph\" output that goes all the way\ndown to the roots, unless I was playing with a toy repository in\norder to tweak and/or develop a feature in Git that draws the graph.\n\nBesides, such root commtis in real life projects would not say \"X\",\nbut something along the lines of \"my very initial commit\", which\nwould be much more \"/<search>\" friendly to pagers than \"#\".\n\nSo, no, sorry, but I do not buy \"root is more special\" at all.\n\nThanks.\n\n"},{"id":"414798","messageId":"01fd01d6ef3e$92e43b10$b8acb130$@pdinc.us","threadId":"54990","inReplyTo":"xmqqo8hkgl4h.fsf@gitster.c.googlers.com","subject":"RE: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Jason Pyeron","fromEmail":"jpyeron@pdinc.us","sentAt":"2021-01-20T15:11:47Z","receivedAt":"2021-01-20T15:23:35Z","isPatch":true,"sender":{"key":"jpyeron@pdinc.us","avatar":"https://gravatar.com/avatar/c2e53452caa53d940768a1ffc9cf76196d851b9b534b7a39cd39852a70a0508f?d=mp&s=160"},"body":"> -----Original Message-----\n> From: Junio C Hamano\n> Sent: Wednesday, January 20, 2021 1:48 AM\n> \n> Kyle Marek writes:\n> \n> > When graphing C..Z, git produces output like:\n> >\n> > *   0fbb0dc (HEAD -> z) Z\n> > |\\\n> > | * 11be529 (master) B\n> > | * 8dd1b85 A\n> > * 851a915 Y\n> > * 27d3ed0 (x) X\n> >\n> > We cannot tell from the above graph alone that X is a root and A is not.\n> \n> I actually do not see that as a problem.  In the past several years,\n> I've never needed to see \"log --graph\" output that goes all the way\n\nI respect your needs, but they conflict with others' needs, while this enhancement to resolve an ambiguity does not impede your needs and solves others' needs. Please do not impose your exclusive use cases upon everyone.\n\n> down to the roots, unless I was playing with a toy repository in\n\nI brought this issue up because several repositories in use have this issue. Two repositories immediately at hand have 35k+ and 2500+ commits each. These are repositories used by professionals and contain actual source code. ( I know your \"toy repository\" tone was not meant as an insult because I read your emails daily, Kyle may not have )\n\n> order to tweak and/or develop a feature in Git that draws the graph.\n> \n> Besides, such root commtis in real life projects would not say \"X\",\n> but something along the lines of \"my very initial commit\", which\n\nHere is where a fundamental (feature) issue of git rears its ugly head. You cannot fix the commit meta data (e.g. message) after the fact. Humans write the message, and it does not always write a message the is easily recognizable as such, no less easy to search.\n\n> would be much more \"/<search>\" friendly to pagers than \"#\".\n\nHere are some messages:\n\nbug 2252 test case (e.g. for tomcat 9 with unpackWARs=false)\nAdd migrate-from-blackfat.sql\nInitial commit from Create React App\nparrent pom\ninitial commit\nBase applet\nintial\nInitial commit\ninitial\nimport prod \nimport prod sql \nimport prod \nimport coop/dev \nimport prod CMIS.zip\n\n\nHere we have commits without the word initial, initial misspelled, or in different case.\n\nLet's not bike shed this issue. The left/right issues are a great catch from a peer review point of view.\n\nI'll ask the following questions, besides the left right and test case issues:\n\nWhat quality issues exists with the patch (e.g. bugs, strategy, etc)?\n\nHow can the proposed additional features be captured for future implementation?\n\nDo we want to continue discussion on option naming?\n\nAre there other questions to discuss?\n\nRespectfully,\n\nJason Pyeron\n\n"},{"id":"414866","messageId":"xmqq35yvff98.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"01fd01d6ef3e$92e43b10$b8acb130$@pdinc.us","subject":"Re: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-20T21:52:03Z","receivedAt":"2021-01-20T23:42:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Jason Pyeron\" <jpyeron@pdinc.us> writes:\n\n>> I actually do not see that as a problem.  In the past several years,\n>> I've never needed to see \"log --graph\" output that goes all the way\n>\n> I respect your needs, but they conflict with others' needs, while\n> this enhancement to resolve an ambiguity does not impede your\n> needs and solves others' needs.\n\nI am questioning if such \"needs\" really exist in the first place.\n\nAmong 35k+ commits in the example project, if you had more than a\nfew dozens of roots, then it may make sense to highlight them\ndifferently from ordinary commits whether they have parents in the\nshown part of the history.  It's like \"log --decorate\" shows branch\ntips marked specially.\n\nYes, I am saying that such a \"this is root\" marking, if it is\nvaluable, should go on a part of \"log --oneline\" output that is\nshown even without \"--graph\", just like we annotate the commit with\n\"(branch name)\" in the output, instead of painting the commit in the\ngraph by replacing the '*' node with something else.\n\nAnd how often do you really need to see commits near the root, say\nthe earliest 100 commits, in the 35k+ commit history?  Is it really\nnecessary to tell which among these 100 is the root?  What problem\ndoes it solve?  Perhaps I am reacting to your solution without\nseeing the problem you are trying to solve?  First, I took the\n\"replace <*> with {#}\" as a solution for \"parenthood becomes unclear\nin the --graph output\" problem, and pointed out that the solution\nfor that issue should apply to not just root commits but equally to\nthe ones above the boundary.\n\nBut it seems that I am hearing that it is not \"graph showing false\nparenthood\" problem that you were trying to solve, but \"I want to\nsee root differently for unspecified reason\".\n\nI am asking why, and if the reason is because there are nontrivial\nnumber of them sprinkled throughout the history, I am offering my\nopinion that something like how we show the commits at the tips of\nbranches and tagged ones would be a better model than changing the\nletter used for the node in the graph.\n\n> Here are some messages:\n>\n> bug 2252 test case (e.g. for tomcat 9 with unpackWARs=false)\n> Add migrate-from-blackfat.sql\n> Initial commit from Create React App\n> parrent pom\n> initial commit\n> Base applet\n> intial\n> Initial commit\n> initial\n> import prod \n> import prod sql \n> import prod \n> import coop/dev \n> import prod CMIS.zip\n\nYou seem to have problems with not just root commits ;-)\nHow many of these 5 \"initial\" commits are root?\n\n> I'll ask the following questions, besides the left right and test case issues:\n>\n> What quality issues exists with the patch (e.g. bugs, strategy, etc)?\n\nBy strategy I take that you mean design.  We've been talking about\nit, right?  Until that gets more or less settled, line-by-line bug\nhunting tends to become a waste of time, and I haven't had a chance\nto afford extra review bandwidth to dedicate to this topic.\n\nNow the problem being solved seems to be changing, so I am not sure\nhow close to be \"done\" the posted patch is to the real solution.\nSorry.\n"},{"id":"414874","messageId":"009a01d6ef80$326572d0$97305870$@pdinc.us","threadId":"54990","inReplyTo":"xmqq35yvff98.fsf@gitster.c.googlers.com","subject":"RE: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Jason Pyeron","fromEmail":"jpyeron@pdinc.us","sentAt":"2021-01-20T23:01:33Z","receivedAt":"2021-01-21T00:57:20Z","isPatch":true,"sender":{"key":"jpyeron@pdinc.us","avatar":"https://gravatar.com/avatar/c2e53452caa53d940768a1ffc9cf76196d851b9b534b7a39cd39852a70a0508f?d=mp&s=160"},"body":"Summary: --graph used with --oneline sometimes produces ambiguous output when more than one commit has no parents and are not yet merged\n\n> From: Junio C Hamano\n> Sent: Wednesday, January 20, 2021 4:52 PM\n> \n> \"Jason Pyeron\" writes:\n> \n> >> I actually do not see that as a problem.  In the past several years,\n> >> I've never needed to see \"log --graph\" output that goes all the way\n> >\n> > I respect your needs, but they conflict with others' needs, while\n> > this enhancement to resolve an ambiguity does not impede your\n> > needs and solves others' needs.\n> \n> I am questioning if such \"needs\" really exist in the first place.\n> \n> Among 35k+ commits in the example project, if you had more than a\n> few dozens of roots, then it may make sense to highlight them\n> differently from ordinary commits whether they have parents in the\n> shown part of the history.  It's like \"log --decorate\" shows branch\n> tips marked specially.\n\nThat could work too.\n\n> \n> Yes, I am saying that such a \"this is root\" marking, if it is\n> valuable, should go on a part of \"log --oneline\" output that is\n> shown even without \"--graph\", just like we annotate the commit with\n\nI do not have any preferences beyond not \"being lied to by git graph\".\n\n| * 22222\n| * 11111\n| * 33333\n| * 44444\n\nImplies that 11111 and 33333 have a parent / child relationship.\n\nQuoting the man page, \"--graph Draw a text-based graphical representation of the commit history on the left hand side of the output. This may cause extra lines to be printed in between commits, in order for the graph history to be drawn properly\", would be preferable to add blank lines.\n\n> \"(branch name)\" in the output, instead of painting the commit in the\n> graph by replacing the '*' node with something else.\n> \n> And how often do you really need to see commits near the root, say\n> the earliest 100 commits, in the 35k+ commit history?  Is it really\n> necessary to tell which among these 100 is the root?  \n\nYes, and the assumption that they are at the beginning is flawed too.\n\n$ git log --oneline --graph --all | cat -n | egrep $(git rev-list --max-parents=0 --all | cut -c 1-8 | tr '\\n' '|' | head -c -1)\n    87  | | * be2c70b7 bug 2252 test case (e.g. for tomcat 9 with unpackWARs=false)\n  2161  | | * 8ef73128 Add migrate-from-blackfat.sql\n  2164  | | * 5505e019 initial\n  2235  | | | | | | | | | | | | | * 83337c67 intial\n  2921  | | | | * ca14dc49 Initial commit\n  2931  | | | * cbdce824 initial commit\n  2963  | | * 8f1828c1 Base applet\n  2971  | * 658af21f parrent pom\n  3026  * 8356af31 Initial commit from Create React App\n\ngit log --oneline --graph produces 3026 lines in this example.\n\n> What problem does it solve?  \n\nAvoiding confusion and non-compliance with the man page, which wastes human's time.\n\n> Perhaps I am reacting to your solution without\n> seeing the problem you are trying to solve?  First, I took the\n> \"replace <*> with {#}\" as a solution for \"parenthood becomes unclear\n> in the --graph output\" problem, and pointed out that the solution\n> for that issue should apply to not just root commits but equally to\n> the ones above the boundary.\n> \n\nI have no objection to that either as it neither helps or hinders the solution to the real and initial issue.\n\n> But it seems that I am hearing that it is not \"graph showing false\n> parenthood\" problem that you were trying to solve, \n\nIt is that graph is implying false parenthood. There was no intention for that (only) issue to morph.\n\n> but \"I want to\n> see root differently for unspecified reason\".\n\nThere is only one reason, the same reason that prompted the original email. Adjacent commits in the --graph formatted output were connected when they are actually not connected.\n\nTo quote earlier > From: Junio C Hamano\n> Sent: Thursday, January 14, 2021 8:12 PM\n> > | | | *  5505e019c2 2014-07-09 initial xxxxxx@xxxx\n> > | | |\n> > | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n> > | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n> >\n> ... is not so great in that it wastes a line, and the break\n> won't be as noticeable when --graph is *not* used with --oneline.\n\nNo, because there would be no line connecting it.\n\n| | | Date:   Tue Sep\n| | |\n| | |     Added defau\n| | |\n| | * commit 5505e019\n| |   Author: xxxx\n| |   Date:   Wed Jul\n| |\n| |       initial\n| |\n| | * commit 3e658f40\n| | | Author: xxxx\n| | | Date:   Tue Sep\n| | |\n| | |     Added defau\n| | |\n| | * commit ad148aaf\n| | | Author: xxxx\n| | | Date:   Tue Sep\n| | |\n| | |     Added defau\n| | |\n\nAnd to quote earlier > From: Junio C Hamano\n> Sent: Thursday, January 14, 2021 8:12 PM\n> > | | | #  5505e019c2 2014-07-09 initial xxxxxx@xxxx\n> > | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n> > | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n> This latter variant won't work.  Imagine we are showing --left-right\n> for example.  Which side does '#' belong to?\n\nThere was no concerns or aversions about left/right. It was later clarified that being able to use the pagers search would be nice.\n\n> \n> I am asking why, and if the reason is because there are nontrivial\n> number of them sprinkled throughout the history, I am offering my\n> opinion that something like how we show the commits at the tips of\n> branches and tagged ones would be a better model than changing the\n> letter used for the node in the graph.\n\nHappy to take that solution too, but does it fix the bug in the graph when used with --oneline? And don’t misunderstand me, this is a bug in --graph with --oneline.\n\n> \n> > Here are some messages:\n> >\n> > bug 2252 test case (e.g. for tomcat 9 with unpackWARs=false)\n> > Add migrate-from-blackfat.sql\n> > Initial commit from Create React App\n> > parrent pom\n> > initial commit\n> > Base applet\n> > intial\n> > Initial commit\n> > initial\n> > import prod\n> > import prod sql\n> > import prod\n> > import coop/dev\n> > import prod CMIS.zip\n> \n> You seem to have problems with not just root commits ;-)\n> How many of these 5 \"initial\" commits are root?\n\n100%, it was from:\n\ngit log --oneline $(git rev-list --max-parents=0 --all) | cut -c 10-\n\n> \n> > I'll ask the following questions, besides the left right and test case issues:\n> >\n> > What quality issues exists with the patch (e.g. bugs, strategy, etc)?\n> \n> By strategy I take that you mean design.  We've been talking about\n> it, right?  Until that gets more or less settled, line-by-line bug\n> hunting tends to become a waste of time, and I haven't had a chance\n> to afford extra review bandwidth to dedicate to this topic.\n> \n> Now the problem being solved seems to be changing, so I am not sure\n> how close to be \"done\" the posted patch is to the real solution.\n> Sorry.\n\nThere was no intention for change, but adjustments were made based on feedback. For example, quoting earlier > From: Junio C Hamano\n> Sent: Thursday, January 14, 2021 8:12 PM\n> It would be great to show it more like this:\n> \n>  | | |   * 5505e019c2 2014-07-09 initial xxxxxx@xxxx\n>  | | | *  3e658f4085 2019-09-10 (wiki/wip-citest, origin/wip-citest) Added defau\n>  | | | *  ad148aafe6 2019-09-10 Added default CI/CD Jenkinsfile (from f7daf088)\n> \n\n> From: Junio C Hamano\n> Sent: Tuesday, January 19, 2021 5:10 PM\n> \n> I do not mind if the graph rendering fix does not happen yet again;\n> IIRC the past contributors couldn't implement it, either.\n\nThis was a good idea, but not readily feasible.\n\nSo to close the loop, I would love to support the creation and integration of a patch to ensure \"graph history s/to be/is/ drawn properly\" and not lying to the reader of the graph about the ancestry.\n\nAnd thank you for spending time on this thread, I think we can find a feasible and usable solution.\n\n"},{"id":"415073","messageId":"xmqqh7n74jdt.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"009a01d6ef80$326572d0$97305870$@pdinc.us","subject":"Re: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-23T18:07:26Z","receivedAt":"2021-01-23T18:08:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Jason Pyeron\" <jpyeron@pdinc.us> writes:\n\n> Summary: --graph used with --oneline sometimes produces ambiguous\n> output when more than one commit has no parents and are not yet\n> merged\n> ...\n>> \"(branch name)\" in the output, instead of painting the commit in the\n>> graph by replacing the '*' node with something else.\n>> \n>> And how often do you really need to see commits near the root, say\n>> the earliest 100 commits, in the 35k+ commit history?  Is it really\n>> necessary to tell which among these 100 is the root?  \n>\n> Yes, and the assumption that they are at the beginning is flawed too.\n>\n> $ git log --oneline --graph --all | cat -n | egrep $(git rev-list --max-parents=0 --all | cut -c 1-8 | tr '\\n' '|' | head -c -1)\n>     87  | | * be2c70b7 bug 2252 test case (e.g. for tomcat 9 with unpackWARs=false)\n>   2161  | | * 8ef73128 Add migrate-from-blackfat.sql\n>   2164  | | * 5505e019 initial\n>   2235  | | | | | | | | | | | | | * 83337c67 intial\n>   2921  | | | | * ca14dc49 Initial commit\n>   2931  | | | * cbdce824 initial commit\n>   2963  | | * 8f1828c1 Base applet\n>   2971  | * 658af21f parrent pom\n>   3026  * 8356af31 Initial commit from Create React App\n>\n> git log --oneline --graph produces 3026 lines in this example.\n\nHmph.  Are you saying that you have 3000+ root commits in the 35k+\nhistory?\n\nWhether we add '[root]' decoration to the true roots (like\n'(branchname)' decoration we add to branch tips), or painted '*' in\na different color (like '#'), you do not have to look for 'initial',\nso having that many roots will not be a problem per-se with respect\nto the \"log\" output, but there must be something strange going on.\n\nI am not going to ask you why you need so many roots, because I\nsuspect that I will regret asking ;-).\n\nBy the way, I sense that your problem description is flip-flopping\nagain and I can no longer keep track of.  The way I read the message\nI got from Kyle was, even when a graph has two commits that have no\nparents in the visible part of the history, either Kyle wanted (or\nKyle got an impression after talking to you that you wanted) to see\nthese differently if one of them is a root and the other is non-root\n(but happens to have none of its parents shown due to A..B range).\nAnd that is why I started asking how meaningful to special case only\n\"root\".\n\nNow the message from you I am responding to in the \"Sumary\" above\nsays that it is not \"root\" but is about the placement of graph\nnodes.\n\nSo, I dunno, with changing the description of the goalpost.  Now it\nis that \"root\" is so not special at all and we only care about that\nthe a commit, none of whose parents are in the part of the shown\nhistory, is shown in such a way that the user can tell that any\nunrelated commits shown in the graph near it are not parents of such\na commit?  Or do you still want to show such a commit in two ways,\none for root and one for the ones above the boundary?\n"},{"id":"415105","messageId":"057b01d6f1db$c46d7d50$4d4877f0$@pdinc.us","threadId":"54990","inReplyTo":"xmqqh7n74jdt.fsf@gitster.c.googlers.com","subject":"RE: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Jason Pyeron","fromEmail":"jpyeron@pdinc.us","sentAt":"2021-01-23T23:02:04Z","receivedAt":"2021-01-23T23:03:01Z","isPatch":true,"sender":{"key":"jpyeron@pdinc.us","avatar":"https://gravatar.com/avatar/c2e53452caa53d940768a1ffc9cf76196d851b9b534b7a39cd39852a70a0508f?d=mp&s=160"},"body":"> -----Original Message-----\n> From: Junio C Hamano <gitster@pobox.com>\n> Sent: Saturday, January 23, 2021 1:07 PM\n> \n> \"Jason Pyeron\" writes:\n> \n> > Summary: --graph used with --oneline sometimes produces ambiguous\n> > output when more than one commit has no parents and are not yet\n> > merged\n> > ...\n> >> \"(branch name)\" in the output, instead of painting the commit in the\n> >> graph by replacing the '*' node with something else.\n> >>\n> >> And how often do you really need to see commits near the root, say\n> >> the earliest 100 commits, in the 35k+ commit history?  Is it really\n> >> necessary to tell which among these 100 is the root?\n> >\n> > Yes, and the assumption that they are at the beginning is flawed too.\n> >\n> > $ git log --oneline --graph --all | cat -n | egrep $(git rev-list --max-parents=0 --all | cut -c 1-8\n> | tr '\\n' '|' | head -c -1)\n> >     87  | | * be2c70b7 bug 2252 test case (e.g. for tomcat 9 with unpackWARs=false)\n> >   2161  | | * 8ef73128 Add migrate-from-blackfat.sql\n> >   2164  | | * 5505e019 initial\n> >   2235  | | | | | | | | | | | | | * 83337c67 intial\n> >   2921  | | | | * ca14dc49 Initial commit\n> >   2931  | | | * cbdce824 initial commit\n> >   2963  | | * 8f1828c1 Base applet\n> >   2971  | * 658af21f parrent pom\n> >   3026  * 8356af31 Initial commit from Create React App\n> >\n> > git log --oneline --graph produces 3026 lines in this example.\n> \n> Hmph.  Are you saying that you have 3000+ root commits in the 35k+\n> history?\n> \n\nI think you misread the specific example of 9 roots in 3026 commits, distributed throughout history.\n\n> Whether we add '[root]' decoration to the true roots (like\n> '(branchname)' decoration we add to branch tips), or painted '*' in\n> a different color (like '#'), you do not have to look for 'initial',\n> so having that many roots will not be a problem per-se with respect\n> to the \"log\" output, but there must be something strange going on.\n> \n> I am not going to ask you why you need so many roots, because I\n> suspect that I will regret asking ;-).\n> \n> By the way, I sense that your problem description is flip-flopping\n> again and I can no longer keep track of.  The way I read the message\n> I got from Kyle was, even when a graph has two commits that have no\n> parents in the visible part of the history, either Kyle wanted (or\n> Kyle got an impression after talking to you that you wanted) to see\n> these differently if one of them is a root and the other is non-root\n> (but happens to have none of its parents shown due to A..B range).\n> And that is why I started asking how meaningful to special case only\n> \"root\".\n> \n\nI may be having trouble with my writing, apologies.\n\nHere is the issue (bug):\n\n1. I never want to see a commit implied to be the parent of an unrelated commit.\n2. I never want to see a commit implied to be the child of an unrelated commit.\n\n--graph --oneline is broken with regards to the man page and my desire to not be confused by the implication of relationship for inappropriately connected nodes on the graph.\n\n| | * 1234567 commit child of 2345678\n| | * 2345678 the first commit, having no parent\n| | * 9876543 an unrelated commit and child of 8765432\n| | * 8765432 ...\n\n> Now the message from you I am responding to in the \"Sumary\" above\n> says that it is not \"root\" but is about the placement of graph\n> nodes.\n> \n\nOne and the same issue. Placing an * directly above another * is the issue.\n\nSolution #1\n\n| | * 1234567 commit child of 2345678\n| | # 2345678 the first commit, having no parent\n| | * 9876543 an unrelated commit and child of 8765432\n| | * 8765432 ...\n\nOr\n\nSolution #2\n\n| | * 1234567 commit child of 2345678\n| | * 2345678 the first commit, having no parent\n| |\n| | * 9876543 an unrelated commit and child of 8765432\n| | * 8765432 ...\n\nOr\n\nSolution #3\n\n| | * 1234567 commit child of 2345678\n| | \\\n| |  * 2345678 the first commit, having no parent\n| | * 9876543 an unrelated commit and child of 8765432\n| | * 8765432 ...\n\nAll of these solutions will solve the bug. #1 seems to be the easiest and becomes searchable. You have indicated that #3 others have failed to do so. #2 is very much aligned to the --graph without --oneline\n\n> So, I dunno, with changing the description of the goalpost.  Now it\n> is that \"root\" is so not special at all and we only care about that\n> the a commit, none of whose parents are in the part of the shown\n> history, is shown in such a way that the user can tell that any\n> unrelated commits shown in the graph near it are not parents of such\n> a commit?  Or do you still want to show such a commit in two ways,\n> one for root and one for the ones above the boundary?\n\nA commit without a parent is special - it has no parent. This means it has no history beyond that point. Something special happened at that time - the birth of new source code in source control.\n\nHopefully, I have cleared up the ambiguous wording.\n\n"},{"id":"415107","messageId":"xmqq7do32p6q.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"057b01d6f1db$c46d7d50$4d4877f0$@pdinc.us","subject":"Re: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-23T23:45:01Z","receivedAt":"2021-01-23T23:45:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Jason Pyeron\" <jpyeron@pdinc.us> writes:\n\n> One and the same issue. Placing an * directly above another * is the issue.\n\nOK, I re-read the messages in the thread, and it appears that this\npart from Kyle\n\n>>>   \n>>>             C\n>>>            /\n>>>           O---A---B\n>>>                    \\\n>>>             X---Y---Z\n>>>   \n>>>   When graphing C..Z, git produces output like:\n>>>   \n>>>   *   0fbb0dc (HEAD -> z) Z\n>>>   |\\\n>>>   | * 11be529 (master) B\n>>>   | * 8dd1b85 A\n>>>   * 851a915 Y\n>>>   * 27d3ed0 (x) X\n>>>   \n>>>   We cannot tell from the above graph alone that X is a root and A is not.\n\nwas the only thing that argued that A and X (if the graph drawing\nhappend to place an unrelated commit immediately below it) should be\ndrawn differently so that you can tell X (root) and A (non root)\napart.\n\nAnd you are saying (and it seems that you have consistently been\nsaying) that it is OK to draw A and X (again if other unrelated\ncommits were immediately drawn below them) the same way.  So I guess\nall is well.  We do not have to use more 6 different symbols (\"{#}\"\nto show commit above boundary, three more to show roots) but need to\nintroduce only three, if we were to go with the Solution #1 route.\n\nIt seems to me that Solution #2 is a special case of Solution #3 ;-)\nThey are both direct answers to the \"graph drawn incorrectly can\nimply ancestry that does not exist\" problem.\n\nAdding the \"--decorate-roots\" option that annotates the root commits\nin the \"git log\" output can still be done, but that is an orthogonal\nissue.  It does solve, together with any one of three options you\npresented, the issue Kyle brought up, I would think.\n\nThanks.\n"},{"id":"415108","messageId":"00a801d6f1e4$2b693140$823b93c0$@pdinc.us","threadId":"54990","inReplyTo":"xmqq7do32p6q.fsf@gitster.c.googlers.com","subject":"RE: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Jason Pyeron","fromEmail":"jpyeron@pdinc.us","sentAt":"2021-01-24T00:02:13Z","receivedAt":"2021-01-24T00:03:10Z","isPatch":true,"sender":{"key":"jpyeron@pdinc.us","avatar":"https://gravatar.com/avatar/c2e53452caa53d940768a1ffc9cf76196d851b9b534b7a39cd39852a70a0508f?d=mp&s=160"},"body":"> From: Junio C Hamano\n> Sent: Saturday, January 23, 2021 6:45 PM\n> \n> \"Jason Pyeron\" writes:\n> \n> > One and the same issue. Placing an * directly above another * is the issue.\n> \n> OK, I re-read the messages in the thread, and it appears that this\n> part from Kyle\n> \n\nAdded more of the context below.\n\n> >>>   While root commits are not a special case in the sense that --graph \n> >>>   makes ancestor implications for more than just root commits, root \n> >>>   commits are a special case when we think about interpreting the presence \n> >>>   of hidden lineage in --graph output.\n> >>>   \n> >>>   Considering one of your examples:\n> >>>\n> >>>             C\n> >>>            /\n> >>>           O---A---B\n> >>>                    \\\n> >>>             X---Y---Z\n> >>>\n> >>>   When graphing C..Z, git produces output like:\n> >>>\n> >>>   *   0fbb0dc (HEAD -> z) Z\n> >>>   |\\\n> >>>   | * 11be529 (master) B\n> >>>   | * 8dd1b85 A\n> >>>   * 851a915 Y\n> >>>   * 27d3ed0 (x) X\n> >>>\n> >>>   We cannot tell from the above graph alone that X is a root and A is not.\n\nThis was a side track down the left right issue. I personally feel that using the left right features is a buyer beware situation.\n\n> \n> was the only thing that argued that A and X (if the graph drawing\n> happend to place an unrelated commit immediately below it) should be\n> drawn differently so that you can tell X (root) and A (non root)\n> apart.\n> \n> And you are saying (and it seems that you have consistently been\n> saying) that it is OK to draw A and X (again if other unrelated\n\nI am neither saying or not saying that - partial graph issues are outside of my concerns. Kyle was attempting to reconcile comments on this list about partial graph rendering when his patch was submitted.\n\n> commits were immediately drawn below them) the same way.  So I guess\n> all is well.  We do not have to use more 6 different symbols (\"{#}\"\n> to show commit above boundary, three more to show roots) but need to\n> introduce only three, if we were to go with the Solution #1 route.\n\nHonestly, I do not care about the <>{}. Whatever makes sense.\n\n> \n> It seems to me that Solution #2 is a special case of Solution #3 ;-)\n> They are both direct answers to the \"graph drawn incorrectly can\n> imply ancestry that does not exist\" problem.\n> \n> Adding the \"--decorate-roots\" option that annotates the root commits\n> in the \"git log\" output can still be done, but that is an orthogonal\n> issue.  It does solve, together with any one of three options you\n> presented, the issue Kyle brought up, I would think.\n> \n\nYes, adding --decorate-roots to add more wide descriptive text before the message would do it, but it is the worst solution #4.\n\n> Thanks.\n\n"},{"id":"415190","messageId":"xmqqblddzekb.fsf@gitster.c.googlers.com","threadId":"54990","inReplyTo":"00a801d6f1e4$2b693140$823b93c0$@pdinc.us","subject":"Re: [PATCH 1/2] revision: Denote root commits with '#'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-01-25T07:00:20Z","receivedAt":"2021-01-25T07:09:58Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Jason Pyeron\" <jpyeron@pdinc.us> writes:\n\n>> It seems to me that Solution #2 is a special case of Solution #3 ;-)\n>> They are both direct answers to the \"graph drawn incorrectly can\n>> imply ancestry that does not exist\" problem.\n>> \n>> Adding the \"--decorate-roots\" option that annotates the root commits\n>> in the \"git log\" output can still be done, but that is an orthogonal\n>> issue.  It does solve, together with any one of three options you\n>> presented, the issue Kyle brought up, I would think.\n>\n> Yes, adding --decorate-roots to add more wide descriptive text\n> before the message would do it, but it is the worst solution #4.\n\nI said that \"--decorate-roots\" is a solution to an orthogonal issue.\n\nLet's recall the C..Z example that shows A (non-root) and X (root)\nin several messages back.  Either can be drawn with unrelated commit\nimmediately below them, depending on the topology of other commits\n(imagine there is another commit M that is not related to any of the\ncommits connected to A or Z, and it is given to \"git log C..Z M\"; if\nwe draw C..Z part first and then draw O after it, M would most\nlikely come immediately after X.\n\n(history: time flows left to right)\n\n          C\n         /\n        O---A---B\n                 \\\n          X---Y---Z\n\n        M\n\n(log --graph output: time flows bottom to top)\n\n    *   0fbb0dc (HEAD -> z) Z\n    |\\\n    | * 11be529 (master) B\n    | * 8dd1b85 A\n    * 851a915 Y\n    * 27d3ed0 [root] X\n    * 1111111 M\n\nNow, the earlier C..Z example I happened to draw B and A first\nbefore drawing Y and X, but if we swap the merge order of Z, it is\nlikely that the graph output would draw Y and X and then B and A.\n\"git log C..Z M\" in such a history would likely to show M directly\nbelow A (non-root).\n\n    *   0fbb0dc (HEAD -> z) Z\n    |\\\n    | * 851a915 Y\n    | * 27d3ed0 [root] X\n    * 11be529 (master) B\n    * 8dd1b85 A\n    * 1111111 M\n\nIn short, the [root] annotation does not, and it is not meant to,\nsolve the \"misleading graph\" issue.\n\nIt only solves \"root is special, with or without --graph\" issue\n(such an issue may or may not exist).\n"}]}