Skip to content

Commit

Permalink
Rename binary to git-lazy-commit (#16)
Browse files Browse the repository at this point in the history
Instead of providing a binary called git-lzc, which, while convenient,
is not descriptive and shows a bias for what the shortcut should be,
the binary is now called git-lazy-commit.

For convenience, `git lzc` is now documented as a suggested alias.

Resolves #15
  • Loading branch information
spenserblack authored Jun 14, 2023
1 parent 4082b1e commit e2f6c91
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 20 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Built assets
git-lzc
git-lzc-*
!/cmd/git-lzc
git-lazy-commit
git-lazy-commit-*
!/cmd/git-lazy-commit
/dist/
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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/
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:

```
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion cmd/git-lzc/lzc.go → cmd/git-lazy-commit/lazycommit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.`,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit e2f6c91

Please sign in to comment.