I'd been looking at the `log` man page, rather than the rebase 
<https://git-scm.com/docs/git-rebase#_description>man page!

A the moment it's not possible.

It might become possible if (big if):

   1. there was a way of labelling all commits with single letter labels, 
   and limiting the size to the screen width. (with two dashes and a single 
   char you only get ~26 steps across the graph, fits [A-Z] though;-)
   2. A mode that simply provides those labels A-Z, a-z etc
   3. List the label key (if required) mapping the label to the oid or any 
   of the other formats.
   4. Maybe could have a 2 digit `Trunc` option that didn't use ellipsis 
   for shortening the hash for a 2 digit oid label .
   5. rework of the algorithm (currently one line per `*` commit) to allow 
   many commits in the same (now) column.

Could make a nice little [extendable] project.

Try `git log --graph --format="%<(4,trunc)%h=2" -16` to see the current 
`trunc` 2 dot ellipsis that could be dropped if a hard `Trunc` was added, 
and probably an `Ltrunc` to get the last N chars.


On Tuesday, October 18, 2022 at 4:26:33 PM UTC+1 amine.ab...@gmail.com 
wrote:

> I've pasted the example I would like to output from `git log` in my 
> original post. If you say that is hand-crafted then that basically leaves 
> me with no choice but to either hand craft things myself as well or accept 
> the output of ` git log --graph --format="%(describe:tags=true)" --all` 
> however horrific it may look.
>
> If you know of a quick/effective way to generate horizontal graphs of 
> revision histories from real repositories then I'd love to hear about it. 
> My preference is using `git log` but based on what I've seen so far the 
> orientation (horizontal/vertical) or the standard output cannot be 
> controlled. 
>
>
>
>
> On Friday, October 14, 2022 at 2:46:46 PM UTC+2 philip...@iee.email wrote:
>
>> Hi Amine,
>>
>> Would you be able to provide a link to any particular example that you 
>> felt may have been formatted via `git log` or similar.
>> Likely places are via the //git-scm.com/doc 
>> <https://git-scm.com/docs/git-log> site, and/or (even better) via 
>> /git.git/Documentation/ 
>> <https://github.com/git/git/blob/master/Documentation/git-log.txt> 's 
>> files (especially with line number selection;-).
>>
>> I suspect that the examples will have been hand crafted as a 
>> retrospective that tries to look nice on the doc pages, rather than 
>> represent a real output.
>>
>> That said, it doesn't mean it can't be done (or extended to do it). 
>>
>> [Aside: Things like the hex oid (instead of tag) could be 
>> extended/simplified to use 10 bits of oid, as the first two hex digits 
>> (bits 0-7 counting from msb), and capitalised based on bits 8 & 11 of the 
>> oid (i.e. third char is 0-7/8-f, and even/odd). Or something like that 
>> (just realise 0-9 can't be capitalised easily, doh!). Very compact, low 
>> chance of collision. ]
>>
>> On Friday, October 14, 2022 at 12:08:18 PM UTC+1 amine.ab...@gmail.com 
>> wrote:
>>
>>> Suppose I have a small local repo which I have set up exactly as 
>>> follows, following the docs <https://git-scm.com/docs/git-rebase> for 
>>> rebasing with Git :
>>>
>>>           A---B---C topic
>>>          /
>>>     D---E---F---G master
>>>
>>> I tag each commit with its respective letter, D, E or F for example.
>>>
>>> I would like to construct a git log command which would provide me with 
>>> exactly the log shown above. So it should look like a graph, should show 
>>> only the tagged commit, show the commit tag instead of hash sequence and 
>>> show the branch name at the tip of each branch.
>>>
>>> I was able to build up part of this as follows:
>>>
>>> git log --graph --format="%(describe:tags=true)" --all
>>>
>>> There are still a couple of issues, namely:
>>>
>>>    - The graph is not horizontal 
>>>    - The branch names are not shown at the tips of the branches 
>>>
>>> Is there anyway to get git log to generate the output I’m looking for? 
>>> If not then I’d be curious to know how logs in the official documentation 
>>> were generated?
>>> ​
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/da1c5d24-8278-4f02-a176-c450113a040an%40googlegroups.com.

Reply via email to