From 73f14eeec586238855135d257739e555a7677a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Wed, 30 Dec 2020 07:23:13 +0700 Subject: [PATCH] git-credentials: rename to git-credential-gopass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With this rename, we can use "gopass" as a git-credential, no need to have the hackery of invoke another shell. Signed-off-by: Đoàn Trần Công Danh --- .goreleaser.yml | 6 +++--- Makefile | 8 ++++---- README.md | 2 +- cmd/git-credential-gopass/.gitignore | 1 + .../git-credential.go | 2 +- .../git-credential_test.go | 0 .../main.go | 8 ++++---- cmd/gopass-git-credentials/.gitignore | 1 - 8 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 cmd/git-credential-gopass/.gitignore rename cmd/{gopass-git-credentials => git-credential-gopass}/git-credential.go (99%) rename cmd/{gopass-git-credentials => git-credential-gopass}/git-credential_test.go (100%) rename cmd/{gopass-git-credentials => git-credential-gopass}/main.go (88%) delete mode 100644 cmd/gopass-git-credentials/.gitignore diff --git a/.goreleaser.yml b/.goreleaser.yml index 6c4a352afd..f1829b0e7e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -38,9 +38,9 @@ builds: - 6 - 7 mod_timestamp: '{{ .CommitTimestamp }}' - - id: gopass-git-credentials - dir: cmd/gopass-git-credentials - binary: gopass-git-credentials + - id: git-credential-gopass + dir: cmd/git-credential-gopass + binary: git-credential-gopass flags: - -trimpath - -tags=netgo diff --git a/Makefile b/Makefile index 92dca09fac..906f8b754f 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ export GO111MODULE=on OK := $(shell tput setaf 6; echo ' [OK]'; tput sgr0;) all: build completion -build: $(GOPASS_OUTPUT) gopass-git-credentials gopass-hibp gopass-jsonapi gopass-summon-provider +build: $(GOPASS_OUTPUT) git-credential-gopass gopass-hibp gopass-jsonapi gopass-summon-provider completion: $(BASH_COMPLETION_OUTPUT) $(FISH_COMPLETION_OUTPUT) $(ZSH_COMPLETION_OUTPUT) travis: sysinfo crosscompile build install fulltest codequality completion full travis-osx: sysinfo build install test completion full @@ -75,9 +75,9 @@ $(GOPASS_OUTPUT): $(GOFILES_BUILD) @$(GO) build -o $@ $(BUILDFLAGS) @printf '%s\n' '$(OK)' -gopass-git-credentials: $(GOFILES_BUILD) +git-credential-gopass: $(GOFILES_BUILD) @echo -n ">> BUILD, version = $(GOPASS_VERSION)/$(GOPASS_REVISION), output = $@" - @cd cmd/gopass-git-credentials && $(GO) build -o gopass-git-credentials $(BUILDFLAGS) + @cd cmd/git-credential-gopass && $(GO) build -o git-credential-gopass $(BUILDFLAGS) @printf '%s\n' '$(OK)' gopass-hibp: $(GOFILES_BUILD) @@ -99,7 +99,7 @@ install: all install-completion @echo -n ">> INSTALL, version = $(GOPASS_VERSION)" @install -m 0755 -d $(DESTDIR)$(BINDIR) @install -m 0755 $(GOPASS_OUTPUT) $(DESTDIR)$(BINDIR)/gopass - @install -m 0755 cmd/gopass-git-credentials/gopass-git-credentials $(DESTDIR)$(BINDIR)/gopass-git-credentials + @install -m 0755 cmd/git-credential-gopass/git-credential-gopass $(DESTDIR)$(BINDIR)/git-credential-gopass @install -m 0755 cmd/gopass-hibp/gopass-hibp $(DESTDIR)$(BINDIR)/gopass-hibp @install -m 0755 cmd/gopass-jsonapi/gopass-jsonapi $(DESTDIR)$(BINDIR)/gopass-jsonapi @install -m 0755 cmd/gopass-summon-provider/gopass-summon-provider $(DESTDIR)$(BINDIR)/gopass-summon-provider diff --git a/README.md b/README.md index 9ccf9a5f83..34ec41fe32 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ gopass is developed in the open. Here are some of the channels we use to communi - [gopassbridge](https://github.com/gopasspw/gopassbridge): Browser plugin for Firefox, Chrome and other Chromium based browsers - [kubectl gopass](https://github.com/gopasspw/kubectl-gopass): Kubernetes / kubectl plugin to support reading and writing secrets directly from/to gopass. - [gopass alfred](https://github.com/gopasspw/gopass-alfred): Alfred workflow to use gopass from the Alfred Mac launcher -- [`gopass-git-credentials`](https://github.com/gopasspw/gopass/tree/master/cmd/gopass-git-credentials): Integrate gopass as an git-credential helper +- [`git-credential-gopass`](https://github.com/gopasspw/gopass/tree/master/cmd/git-credential-gopass): Integrate gopass as an git-credential helper - [`gopass-hibp`](https://github.com/gopasspw/gopass/tree/master/cmd/gopass-hibp): haveibeenpwned.com leak checker - [`gopass-jsonapi`](https://github.com/gopasspw/gopass/tree/master/cmd/gopass-jsonapi): native messaging for browser plugins, e.g. gopassbridge - [`terraform-provider-gopass`](https://github.com/camptocamp/terraform-provider-pass): a Terraform provider to interact with gopass diff --git a/cmd/git-credential-gopass/.gitignore b/cmd/git-credential-gopass/.gitignore new file mode 100644 index 0000000000..43fc5dafe2 --- /dev/null +++ b/cmd/git-credential-gopass/.gitignore @@ -0,0 +1 @@ +git-credential-gopass diff --git a/cmd/gopass-git-credentials/git-credential.go b/cmd/git-credential-gopass/git-credential.go similarity index 99% rename from cmd/gopass-git-credentials/git-credential.go rename to cmd/git-credential-gopass/git-credential.go index 7fdf03309b..03d0e00f80 100644 --- a/cmd/gopass-git-credentials/git-credential.go +++ b/cmd/git-credential-gopass/git-credential.go @@ -243,7 +243,7 @@ func (s *gc) Configure(c *cli.Context) error { if flags == 0 { log.Println("No target given, assuming --global.") } - cmd := exec.CommandContext(ctx, "git", "config", flag, "credential.helper", `"!gopass-git-credentials $@"`) + cmd := exec.CommandContext(ctx, "git", "config", flag, "credential.helper", "gopass") cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr return cmd.Run() diff --git a/cmd/gopass-git-credentials/git-credential_test.go b/cmd/git-credential-gopass/git-credential_test.go similarity index 100% rename from cmd/gopass-git-credentials/git-credential_test.go rename to cmd/git-credential-gopass/git-credential_test.go diff --git a/cmd/gopass-git-credentials/main.go b/cmd/git-credential-gopass/main.go similarity index 88% rename from cmd/gopass-git-credentials/main.go rename to cmd/git-credential-gopass/main.go index c3b7a05e88..5ebd1c9818 100644 --- a/cmd/gopass-git-credentials/main.go +++ b/cmd/git-credential-gopass/main.go @@ -13,7 +13,7 @@ import ( ) const ( - name = "gopass-git-credentials" + name = "git-credential-gopass" ) var ( @@ -59,10 +59,10 @@ func main() { app := cli.NewApp() app.Name = name app.Version = version - app.Usage = `Use "!gopass-git-credentials $@" as git's credential.helper` + app.Usage = `Use "gopass" as git's credential.helper` app.Description = "" + "This command allows you to cache your git-credentials with gopass." + - "Activate by using `git config --global credential.helper \"!gopass-git-credentials $@\"`" + "Activate by using `git config --global credential.helper gopass" app.EnableBashCompletion = true app.Commands = []*cli.Command{ { @@ -85,7 +85,7 @@ func main() { }, { Name: "configure", - Description: "This command configures gopass-git-credential as git's credential.helper", + Description: "This command configures git-credential-gopass as git's credential.helper", Action: gc.Configure, Flags: []cli.Flag{ &cli.BoolFlag{ diff --git a/cmd/gopass-git-credentials/.gitignore b/cmd/gopass-git-credentials/.gitignore deleted file mode 100644 index fb9333c016..0000000000 --- a/cmd/gopass-git-credentials/.gitignore +++ /dev/null @@ -1 +0,0 @@ -gopass-git-credentials