-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add map with branches and dimensions to diagram (fixes #155) #156
base: master
Are you sure you want to change the base?
Conversation
This would be helpful, but what would you think about adding these numbers around the boundaries of the diagram output itself? For example, maybe something like
or
If every fifth commit, plus the last one in each direction, has its number displayed alongside the diagram, then there's plenty of room for 9999 commits on the horizontal axis. On the vertical axis, one could either reserve enough room for, say, 4-digit numbers, or dynamically determine the maximum number length needed and reserve that much space. It's trickier to implement but I think it would be more intuitive and make it easy to read numbers off of the diagram. |
I am interested in rebases. I don't really get the "merge frontiers" graph. If I understand it right, the rebase process is pushing the branch from left to right towards master end. Because of simplicity the "frontier" can be omitted, and middle pieces of the diagram that don't touch the current merge can be cut out. The ideal diagram looks like this.
And maybe replace question marks with spaces. |
Basically, any merge to the left and up from the "merge frontier" is assumed to be doable without conflicts (given the conflicts that have already been resolved by the user), whereas the merges below and to the right of it are still to be processed. I personally find the merge frontier useful even in the case of rebases.
Kindof. It currently really follows the same algorithm as for merges, though that could be simplified, as alluded to here. I suggest keeping the issues separate: (1) adding some kind of key or axis labels for the numbers (e.g., this PR), and (2) other proposed changes to the |
I like graphs in #101. They clarify things a lot. The "merge frontier" shows how far a certain commit can be pushed left without any commits down attached to it. I would name it Speaking of frontier.. although I moved the conditional block that prints the legend for it, there is really no way to make this option false. Lines 3698 to 3699 in 4b6550d
Back to PR, I see three threads here. (0) adding "minimap" to the right of legend I would just add the minimap that gives information about numbers and branches. With the rebase over 131 commits in master the main diagram is already unreadable. because it doesn't fit the screen. As I can't really read the graph, the minimap becomes a substitution for missing status command. |
If you pipe it to |
The full command would be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be an improvement, but I think axes would be even nicer. What do you think of #157?
gitimerge.py
Outdated
'Key: Map:\n' | ||
) | ||
sys.stdout.write( | ||
' * = merge done manually o-0-1-2..-%(len1)d %(tip1)s\n' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this is going to look strange if there are fewer than 3 commits on the horizontal axis or fewer than 2 on the vertical axis; for example:
o-0-1-2..2
Even this looks a little bit weird (though acceptable):
o-0-1-2..3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This needs to be calculated. I may be able to do this in a few hours. Although I may go offline for a week or two at any moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhagger fixed in the last commit.
Map:
o-0-1 single-dockerfile
1
..
235
upstream/master
Key: Map: * = merge done manually o-0-1-2..-131 upstream/master . = merge done automatically 1 # = conflict that is currently blocking progress .. @ = merge was blocked but has been resolved 11 ? = no merge recorded eliaszs/feature/individual_account |,-,+ = rectangles forming current merge frontier
Co-authored-by: Michael Haggerty <[email protected]>
Rebased only. Haven't fixed the label yet. Need some example repo to test with commands how to get it into the proper "in the process" state. |
Map: o-0-1 single-dockerfile 1 .. 235 upstream/master And if there are more than 4. Map: o-0-1-2..4 single-dockerfile 1 .. 235 upstream/master
Current render. ✗ ~/git-imerge/gitimerge.py diagram
0 5 10 15 20 25 30 32
| | | | | | | |
0 - ********************************* - origin/master
*??.???.*??????.????????????????|
*??.???..??????.????????????????|
*??......??????..---------------+
*??.*.*..??????.*#???????????????
5 - *---------------+????????????????
|
for-non-static
Key: Map:
* = merge done manually o-0-1-2..32 origin/master
. = merge done automatically 1
# = conflict that is currently blocking progress ..
@ = merge was blocked but has been resolved 5
? = no merge recorded for-non-static
|,-,+ = rectangles forming current merge frontier |
Just a small style suggestion: how about "rotating" the
|
@waldyrious yep, looks a little better now. ) |
This adds a minimap with dimensions and branch names to
diagram
output to clarify what goes where,