Skip to content

Prepare TrackLayout for usage#13

Merged
peso merged 24 commits into
git-bahn:masterfrom
peso:tracklayout
Jul 8, 2026
Merged

Prepare TrackLayout for usage#13
peso merged 24 commits into
git-bahn:masterfrom
peso:tracklayout

Conversation

@peso

@peso peso commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Implement the most critical functions to demo the new API on gitui

peso added 10 commits July 8, 2026 10:05
Mark branch range and relations as used for layout

This means they should move from track.rs to layout.rs
at some point.
This makes it easier to read the high level function.
Give general introduction and mention future and legacy functions.
A new API for print_graph (only) will be added,
so it is important that the curent API is properly
named to disinguish them.
Text Formatting must be optional, so provide new functions that
return data at a lower level.
@peso
peso force-pushed the tracklayout branch 2 times, most recently from 9cf4b42 to ff4ec63 Compare July 8, 2026 08:41
@peso

peso commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

One step closer to #6

peso added 14 commits July 8, 2026 17:44
Document terms used throughout Gleisbau.

Describe how branch assignment works
This is intended for internal usage only
This field defines the start and end row used for layout of
a branch.

Add a flag to indicate if the track continues outside what is
visualized. The old version used An Option<usize> where None
meant undetermined.

The new representation has the benefit that it can always be
drawn, even if we know that it should be continued.
Some visualsations need to know where last visible commit
was, which was not possible with the old structure.
This means the parent is outside the layout range.
Just ignore it, or make a line all the way to the bottom
for the current branch visualisation.

Each such parent should have a line terminating outside
range. which can be a 1-char marker or a line.
Logging is a debugging tool which usually generates lots
of data, but this change only adds call notification at
important API points at tracing level.
Explain what inserts are and how they fit in the algorithm.
As layout is a subset of the full topology, we need to
take the start offset into account.

index_map previously mapped from (absolute commit index)
to (grid row)

Now it maps from (commit index relative to layout)
to (grid row)
For edge layouts, it may occur that it lists too many commits.
I assume it never goes before commit 0.
For those fake commit-index, return an empty inserts value.
Apparently there are two locations that create the Grid
- legacy code
- new code

Maybe I should adapt get_inserts so it computes grid heigt?
Maybe a separate function to compute needed height
from inserts and text heights.
@peso
peso merged commit 17af6f7 into git-bahn:master Jul 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant