Skip to content
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

histdb-sync results in error: cannot rebase: You have unstaged changes. #129

Open
jheidbrink opened this issue Mar 29, 2022 · 2 comments
Open

Comments

@jheidbrink
Copy link

jheidbrink commented Mar 29, 2022

I'm using histdb Git rev 30797f0.

When running histdb-sync, I'm getting

error: cannot rebase: You have unstaged changes.
error: Please commit or stash them.

I ran it again with set -x, and the relevant logs are:

+(anon):11> _histdb_stop_sqlite_pipe
+_histdb_stop_sqlite_pipe:1> [[ -n 11 ]]
+_histdb_stop_sqlite_pipe:2> print -nu11
+(anon):12> git commit -am history
[master 79eb3d9] history
 1 file changed, 0 insertions(+), 0 deletions(-)
+(anon):12> git pull --no-edit
Initializing Keybase... done.
Syncing with Keybase... done.
error: cannot rebase: You have unstaged changes.
error: Please commit or stash them.
+(anon):13> _histdb_start_sqlite_pipe
+_histdb_start_sqlite_pipe:1> local PIPE=/tmp/zsh2G3k4o
+_histdb_start_sqlite_pipe:2> setopt local_options no_notify no_monitor
+_histdb_start_sqlite_pipe:3> mkfifo /tmp/zsh2G3k4o
+_histdb_start_sqlite_pipe:5> sysopen -w -o cloexec -u HISTDB_FD -- /tmp/zsh2G3k4o
+_histdb_start_sqlite_pipe:4> sqlite3 -batch -noheader /home/jan/.histdb/zsh-history.db
+_histdb_start_sqlite_pipe:6> rm /tmp/zsh2G3k4o
+_histdb_start_sqlite_pipe:7> zstat -A HISTDB_INODE +inode /home/jan/.histdb/zsh-history.db

So it looks like right after committing and before pulling, something (probably zsh-histdb itself) changes zsh-history.db. I assume _histdb_stop_sqlite_pipe is meant to prevent precisely that? Not sure how to reproduce this, but I can help debugging if someone tells me how ;)

@jheidbrink
Copy link
Author

btw I rebooted, and got

~: histdb-sync
truncating WAL
fatal: confused by unstable object source data for 9125a2218f5286ae9cf06c0c5898c86cf58d9517

I only got this once though, and afterwards it's again

~/.histdb: histdb-sync                                                                                                                                                              [± master]
truncating WAL
[master 0abee61] history
 1 file changed, 0 insertions(+), 0 deletions(-)
error: cannot pull with rebase: You have unstaged changes.
error: please commit or stash them.

@jheidbrink
Copy link
Author

Update: It works now, not sure why.

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

No branches or pull requests

1 participant