-
-
Notifications
You must be signed in to change notification settings - Fork 526
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
Rewrite the dolt show
implementation.
#8239
Conversation
@nicktobey DOLT
|
@coffeegoddd DOLT
|
cd31973
to
727049a
Compare
@nicktobey DOLT
|
@coffeegoddd DOLT
|
93eeb97
to
b36f3d4
Compare
@nicktobey DOLT
|
@coffeegoddd DOLT
|
26043fd
to
f132884
Compare
@nicktobey DOLT
|
@coffeegoddd DOLT
|
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.
This is definitely better than what we started with. I'm OK to ship this, but I do think we would be well served to seperate out the admin interactions from the common user requirements. Ultimately dolt show
should be fully executable over SQL.
go/cmd/dolt/commands/show.go
Outdated
continue | ||
} else { | ||
// Hash is a commit | ||
err = printCommit(queryist, sqlCtx, opts, commitInfo) |
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 naming of the functions in this file could be updated to be more expressive of what they are doing. printCommit
is actually performing some calls over the queryist, while printRawValue
is only operating on local files. With some much packed into "print" functions, it makes it hard to read the code.
I think a larger change which would make sense would to separate out the local dEnv cases. Put those in another command. Leaves much less cognitive overhead about how this command actually operates.
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.
Renamed to "fetchAndPrintCommit"
As discussed offline, I totally agree about separating out the low-level admin and high-level user functionality of this command. But this is better than before and fixes multiple issues. It's a step in the right direction. |
@nicktobey DOLT
|
dolt show
had an issue where it would not correctly display the SerialMessage for commits if provided with a hash. This came about as part of a refactor to makedolt show
not depend on theenv.DoltEnv
object, when only exists on locally running servers, and not when connected to a remote server. Unfortunately, it looks like that refactor didn't actually remove the dependency either, asDoltEnv
was still used in every possible invocation ofdolt show
To get it working, I essentially rewrote the implementation of
dolt show
in such a way that it now actually only usesDoltEnv
when it can't get the necessary information from a running server: Basically, if we need to display SerialMessages or resolve branch names, we still rely on a locally running server. This can likely be improved in the future. But calls likedolt show #hash
should now work against remote servers.