-
Notifications
You must be signed in to change notification settings - Fork 35
Editing Commits
We can edit the SQL commands used to generate a commit.
This is useful for conflict resolution before merging or rebasing branches.
The whole process is atomic, even when modifying many commits at once.
Setting all the commands for a given commit:
pragma branch_log --set {commit} {commands}
Adding new commands to a commit:
pragma branch_log --add {commit} {commands}
Deleting commands from a commit:
pragma branch_log --del {commit} {command_list}
Where commands
are formatted as either:
- separated by
;
- in netstring format
And command_list
is a list of command ids (position based, base 1) separated by commas
Setting these 2 SQL commands as the generators of commit 12 at the master branch:
pragma branch_log --set master.12 INSERT INTO t1 VALUES ('test');UPDATE t2 SET active=0
pragma branch_log --set master.12 30:INSERT INTO t1 VALUES ('test'),22:UPDATE t2 SET active=0,
Adding these 2 commands to the commit 12 at the master branch:
pragma branch_log --add master.12 INSERT INTO t1 VALUES ('test');UPDATE t2 SET active=0
pragma branch_log --add master.12 30:INSERT INTO t1 VALUES ('test'),22:UPDATE t2 SET active=0,
Deleting commands 2 and 4 from commit 15 at the master branch:
pragma branch_log --del master.15 2,4
This can be used to implement an interactive rebase
In this case the commands need to be formatted as netstrings:
pragma branch_log --set master.12 {netstr} master.13 {netstr} master.14 {netstr} ...