-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
GitHub proxy part 6.5: tsh git ssh/clone/config #50044
Conversation
4aeabc8
to
fd571b3
Compare
a5cb9a6
to
97bbddf
Compare
fc0459d
to
0e0f74f
Compare
go.mod
Outdated
@@ -100,6 +100,7 @@ require ( | |||
github.com/fxamacker/cbor/v2 v2.7.0 | |||
github.com/ghodss/yaml v1.0.0 | |||
github.com/gizak/termui/v3 v3.1.0 | |||
github.com/go-git/go-git/v5 v5.12.0 |
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.
go-git
will be used for the teleport
as well.
local mac build tsh
increased about 200k (out of 106MB) after importing it.
0e0f74f
to
f21c24c
Compare
f21c24c
to
9d38794
Compare
🤖 Vercel preview here: https://docs-1vdax8b5f-goteleport.vercel.app/docs |
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.
Can you add some context to the implementation choice, i.e, shelling out to git
binaries versus using go-git
? There are some pros and cons to both and it would be beneficial to hear your reasoning; perhaps worth documenting it in the package itself, too?
On that note, I wonder if we should start splitting the tsh subcommands into their own packages.
We are using git
command line interface as the API, which makes it hard to spot any potential mistakes. We don't have infrastructure for this yet, but having an end-to-end suite of tests (including a real github repo and docker image with git
) would be amazing.
All those shell invocations makes me wonder about Windows. Can you check if tsh.exe
works as intended? (My build command: BUILDDIR=build-win FIDO2=no ARCH=amd64 OS=windows make build-win/tsh && mv build-win/tsh build-win/tsh.exe
)
using
It still relies on
Added to TODO list (#48762).
I think it should work without issue. I will give it a shot later and submit a separate issue to track it if it doesn't work. |
friendly ping @smallinsky @r0mant |
|
||
func (c *gitConfigCommand) run(cf *CLIConf) error { | ||
// Make sure we are in a Git dir. | ||
err := execGitWithStdoutAndStderr(cf, io.Discard, io.Discard, "rev-parse", "--is-inside-work-tree") |
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.
The --is-inside-work-tree
return true or false:
--is-inside-work-tree
When the current working directory is inside the work tree of the repository print "true", otherwise "false".
Just want to ensure that we want to rely on command error and not handle the "false" case ?
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 don't see the false
getting printed:
stevehuang@mac ~ $ git rev-parse --is-inside-work-tree
fatal: not a git repository (or any of the parent directories): .git
The fatal
error is sent to stderr. Same on my mac or my ec2 linux machine.
55f3f8e
to
683d82a
Compare
related:
examples: