Cross Merges don't render correctly in `dolt log --graph`
- Dominant language
- Go
- Stars
- 24.4k
- Forks
- 873
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 120
Description
Using the following script to create data and commits, the view printed by `dolt log --graph brA brB brC` doesn't show the fact that there is a cross merge between A and B. Attached to the issue is the graphviz representation of this graph.
```sql
CREATE TABLE A (pk INT PRIMARY KEY);
CREATE TABLE B (pk INT PRIMARY KEY);
CREATE TABLE C (pk INT PRIMARY KEY);
CALL DOLT_COMMIT('-Am', 'empty tables');
CALL DOLT_CHECKOUT('-b', 'brA', 'main');
INSERT INTO A VALUES (1),(2),(3);
CALL DOLT_COMMIT('-am', 'insert into A while on brA');
CALL DOLT_CHECKOUT('-b', 'brB', 'main');
INSERT INTO B VALUES (10),(20),(30);
CALL DOLT_COMMIT('-am', 'insert into B while on brB');
CALL DOLT_CHECKOUT('-b', 'brC', 'brB');
INSERT INTO C VALUES (100),(200),(300);
CALL DOLT_COMMIT('-am', 'insert into C while on brC');
CALL DOLT_CHECKOUT('brA');
SET @A_initial = (SELECT DOLT_HASHOF('HEAD'));
CALL DOLT_MERGE('--no-ff', 'brB');
CALL DOLT_CHECKOUT('brB');
CALL DOLT_MERGE('--no-ff', @A_initial);
```
```sh
$ dolt log --graph brA brB brC
* commit 91ibt5633u32cpeb366knqlsv3n26jlt(brB)
|\ Merge: pbbc2c18e9grgikvq9k0tbhhmct1ltdv gdhhot2n64tcpbhm1ungom6mjaimeel9
| | Author: root
| | Date: Mon May 19 11:53:09 -0700 2025
| |
| | Merge branch 'gdhhot2n64tcpbhm1ungom6mjaimeel9' into brB
| |
| * commit e7ovtovs41p9fnuc5anbliep3dlnbsqq(brA)
| | Merge: gdhhot2n64tcpbhm1ungom6mjaimeel9 pbbc2c18e9grgikvq9k0tbhhmct1ltdv
| | Author: root
| | Date: Mon May 19 11:53:09 -0700 2025
| |
| | Merge branch 'brB' into brA
| |
| | * commit sqi866cmq1neveh9enc58br14goqn4th(brC)
| | | Author: root
| | | Date: Mon May 19 11:53:09 -0700 2025
| |/
| / insert into C while on brC
|/|
* | commit pbbc2c18e9grgikvq9k0tbhhmct1ltdv
| | Author: root
| | Date: Mon May 19 11:53:09 -0700 2025
| |
| | insert into B while on brB
| |
| * commit gdhhot2n64tcpbhm1ungom6mjaimeel9
| | Author: root
| | Date: Mon May 19 11:53:09 -0700 2025
| |
| | insert into A while on brA
|/
* commit nqtjb4obq9fqe19pdkcrqsusqig7e6o9(HEAD -> main)
| Author: root
| Date: Mon May 19 11:53:09 -0700 2025
|
| empty tables
|
* commit 70g621fsrtnu6jbdqofhtfgdfq7jmlma
Author: macneale
Date: Mon May 19 11:52:59 -0700 2025
Initialize data repository
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the graph with the SQL setup in the issue, then run `dolt log --graph brA brB brC` and compare it with the attached Graphviz representation. Trace the log graph rendering entry point and verify that the cross merge between brA and brB is represented correctly in the command output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, go
- Domain
- cli, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100