dolt icon indicating copy to clipboard operation
dolt copied to clipboard

Command Line working sets become a working set for every branch after starting a server

Open timsehn opened this issue 2 years ago • 0 comments

test-working-set-cli-server-interaction $ dolt init
Successfully initialized dolt data repository.
test-working-set-cli-server-interaction $ dolt sql -q "create table test (pk int, c1 int, primary key(pk))"
test-working-set-cli-server-interaction $ dolt commit -am "made table"
commit 07imodm4q2lc2gh3roi4a4ndipkur6gc (HEAD -> main) 
Author: Tim Sehn <[email protected]>
Date:  Thu Jun 16 11:14:28 -0700 2022

        made table

test-working-set-cli-server-interaction $ dolt sql -q "insert into test values (0,0)"
Query OK, 1 row affected
test-working-set-cli-server-interaction $ dolt sql -q "select * from test"
+----+----+
| pk | c1 |
+----+----+
| 0  | 0  |
+----+----+
test-working-set-cli-server-interaction $ dolt sql-client
# Welcome to the Dolt MySQL client.
# Statements must be terminated with ';'.
# "exit" or "quit" (or Ctrl-D) to exit.
mysql> use test_working_set_cli_server_interaction;
mysql> select active_branch();
+-----------------+
| active_branch() |
+-----------------+
| test-follow     |
+-----------------+
mysql> select * from test;
+----+----+
| pk | c1 |
+----+----+
| 0  | 0  |
+----+----+
mysql> call dolt_checkout('main');
+--------+
| status |
+--------+
| 0      |
+--------+
mysql> select * from test;
+----+----+
| pk | c1 |
+----+----+
| 0  | 0  |
+----+----+
mysql>  

I think the correct behavior is to have the server examine the currently checked out branch and have the working set apply to that branch. Alternatively, we can have the server ignore working and stage changes on the command line. I think the first option is better.

timsehn avatar Jun 16 '22 18:06 timsehn