From: Kyle Marek Date: Wed, 20 Jan 2021 03:25:48 GMT Subject: Re: [PATCH 1/2] revision: Denote root commits with '#' Message-ID: <460257a2-478a-eb4c-f6fa-b1cc55384cd5@pdinc.us> In-Reply-To: On 1/19/21 5:10 PM, Junio C Hamano wrote: > Kyle Marek writes: > >>> So the condition we saw in your patches, !commit->parents, which >>> attempted to see if it was root, needs to be replaced with a helper >>> function that checks if there is any parent that is shown in the >>> output. >>> ... >>> Hmm? >> Okay, I see what you mean. Fixing --graph to avoid implying ancestry >> sounds like a better approach to me. > Sorry, I do not know how you drew that conclusion from my > description. > > All I meant to convey is "roots are not special at all, commits that > do not have parents in the parts of the history shown are, and care > must be taken to ensure that they do not appear to have parents". Yeah, I guess I am confused. I thought "Fixing --graph to avoid implying ancestry" was reaching the same point as "care must be taken to ensure that [commits without parents shown] do not appear to have parents". (I wasn't just talking about root commits at that point) > And the argument applies equally to either of two approaches. > Whether the solution chosen is > > (1) to use special set of markers "{#}" for commits that do not > have parents in the displayed part of the history instead of > the usual "<*>", or > > (2) to stick to the normal set of markers "<*>" but shift the graph > to avoid false ancestry. > > we shouldn't be special casing "root commits" just because they are > roots. Exactly the same issue exists for non-root commits whose > parents are not shown in the output, if commits from unrelated > ancestry is drawn directly below them. I understand. Coming back to the "root commit" situation below. >> That being said, I spoke to Jason recently, and he expressed interest >> in optionally marking root commits so they are easy to search for in a >> graph with something like /# in `less`. I see value in this, > I do not mind to denote the "this commit may appear directly on top > of another commit, but there is no ancestry" situation with a > special set of markers that is different from the usual "<*>" (for > left, normal and right) set. I agree pagers are good ways to /search > things in the output. > >> So would you be open to my modifying of the patch in question (patch >> 1+2 squashed, I guess) to instead use "--mark-roots=" to >> optionally mark root commits with a string , and pursue fixing >> the --graph rendering issue in another series? > I do not mind if the graph rendering fix does not happen yet again; > IIRC the past contributors couldn't implement it, either. > > I think this new feature should be made opt-in by introducing a new > option (without giving it a configuration variable), with explicit > "--no-