diff --git a/.gitignore b/.gitignore index 6c1b30f..133639c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Built assets -git-lzc -git-lzc-* -!/cmd/git-lzc +git-lazy-commit +git-lazy-commit-* +!/cmd/git-lazy-commit +/dist/ diff --git a/Makefile b/Makefile index 58f6ae2..cdab0ff 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,16 @@ FILES = $(shell find -type f -name '*.go') DISTRIBUTIONS = darwin-amd64 linux-amd64 windows-amd64 openbsd-amd64 freebsd-amd64 netbsd-amd64 linux-386 windows-386 openbsd-386 freebsd-386 netbsd-386 -targets = $(foreach distribution,$(DISTRIBUTIONS),dist/git-lzc-$(distribution)$(if $(findstring windows,$(distribution)),.exe)) +targets = $(foreach distribution,$(DISTRIBUTIONS),dist/git-lazy-commit-$(distribution)$(if $(findstring windows,$(distribution)),.exe)) -git-lzc: $(FILES) go.mod go.sum - go build ./cmd/git-lzc/ +git-lazy-commit: $(FILES) go.mod go.sum + go build ./cmd/git-lazy-commit/ -$(targets): dist/git-lzc-%: $(FILES) go.mod go.sum - GOOS=$(word 1, $(subst -, ,$*)) GOARCH=$(word 1, $(subst ., ,$(word 2, $(subst -, ,$*)))) go build -o $@ ./cmd/git-lzc/ +$(targets): dist/git-lazy-commit-%: $(FILES) go.mod go.sum + GOOS=$(word 1, $(subst -, ,$*)) GOARCH=$(word 1, $(subst ., ,$(word 2, $(subst -, ,$*)))) go build -o $@ ./cmd/git-lazy-commit/ .PHONY: all all: $(targets) .PHONY: install -install: git-lzc - cp git-lzc /usr/local/bin/ +install: git-lazy-commit + cp git-lazy-commit /usr/local/bin/ diff --git a/README.md b/README.md index 7f7d49a..2b2b163 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,12 @@ Be lazy and just commit ## Description -This provides the `git lzc` command. This command can be used +This provides the `git lazy-commit` command. This command can be used in situations where you don't really care about choosing which changes to track or writing your commit message -- you just want to commit your work. -By its nature, `git lzc` can very easily add accidental changes +By its nature, `git lazy-commit` can very easily add accidental changes to the git history if the user isn't careful. So, while this tool may be appealing to git beginners, its target audience is actually experienced git users who know when they want to break @@ -23,13 +23,13 @@ the rules for creating good commits. ### Staged Changes If you have staged changes (`git add path/to/file`), then -`git lzc` will commit those staged changes. If you *do not* -have any staged changes, then `git lzc` will commit *all* changes, +`git lazy-commit` will commit those staged changes. If you *do not* +have any staged changes, then `git lazy-commit` will commit *all* changes, **including untracked files** (so be careful!). ### Commit Messages -`git lzc` will write your commit message for you. If you've changed +`git lazy-commit` will write your commit message for you. If you've changed a single file, the commit message will look like this: ``` @@ -77,6 +77,15 @@ Invoke-WebRequest "https://raw.githubusercontent.com/spenserblack/git-lazy-commi ### From GitHub Releases Download the appropriate executable from the [release assets][latest-release], -rename it to `git-lzc`, and add it to a location in `PATH`. +rename it to `git-lazy-commit`, and add it to a location in `PATH`. + +## Suggested Alias + +`git lazy-commit` can be annoying to type frequently, so you can create an alias +so that you only need to call `git lzc`. + +```shell +git config --global alias.lzc lazy-commit +``` [latest-release]: https://github.com/spenserblack/git-lazy-commit/releases/latest diff --git a/cmd/git-lzc/lzc.go b/cmd/git-lazy-commit/lazycommit.go similarity index 95% rename from cmd/git-lzc/lzc.go rename to cmd/git-lazy-commit/lazycommit.go index 27a2b77..a56bf58 100644 --- a/cmd/git-lzc/lzc.go +++ b/cmd/git-lazy-commit/lazycommit.go @@ -9,7 +9,7 @@ import ( ) var rootCmd = &cobra.Command{ - Use: "git-lzc", + Use: "git-lazy-commit", Short: "Lazy Commit generates commit messages for you", Long: `Lazy Commit checks your git status, stages files if they're all unstaged, and generates a commit message for you.`, diff --git a/cmd/git-lzc/main.go b/cmd/git-lazy-commit/main.go similarity index 100% rename from cmd/git-lzc/main.go rename to cmd/git-lazy-commit/main.go diff --git a/install.ps1 b/install.ps1 index 3c7cff7..d99fbd2 100644 --- a/install.ps1 +++ b/install.ps1 @@ -7,4 +7,4 @@ if ($Env:PROCESSOR_ARCHITECTURE -eq "x86") { $arch = "amd64" } -Invoke-WebRequest -OutFile "$Env:ProgramFiles\Git\usr\bin\git-lzc.exe" -Uri "https://github.com/spenserblack/git-lazy-commit/releases/latest/download/git-lzc-windows-$arch.exe" +Invoke-WebRequest -OutFile "$Env:ProgramFiles\Git\usr\bin\git-lazy-commit.exe" -Uri "https://github.com/spenserblack/git-lazy-commit/releases/latest/download/git-lazy-commit-windows-$arch.exe" diff --git a/install.sh b/install.sh index 1df23e9..e65dd3d 100755 --- a/install.sh +++ b/install.sh @@ -31,5 +31,5 @@ else exit 1 fi -sudo wget -O "$INSTALL_DIR/git-lzc" "https://github.com/spenserblack/git-lazy-commit/releases/latest/download/git-lzc-$OS-$ARCH" -sudo chmod +x "$INSTALL_DIR/git-lzc" +sudo wget -O "$INSTALL_DIR/git-lazy-commit" "https://github.com/spenserblack/git-lazy-commit/releases/latest/download/git-lazy-commit-$OS-$ARCH" +sudo chmod +x "$INSTALL_DIR/git-lazy-commit"