Compare commits

..

1 Commits

Author SHA1 Message Date
f2b8731770 Add aliases for working with autosquash rebases
* Rename the `squash` alias to `prepare` to repurpose it.
* Change `squash` alias to `git commit --squash=<commit>`.
* Add `fixup` alias to `git commit --fixup=<commit>`.
* Set the `rebase.autoSquash` config option to `true`.
2018-08-13 12:15:13 +01:00
5 changed files with 2 additions and 18 deletions

View File

@ -3,7 +3,5 @@
- symlink:
- {src: config, dst: ~/.gitconfig}
- {src: _git-changes, dst: ~/.local/share/zsh/site-functions/_git-changes}
- {src: _git-fixup, dst: ~/.local/share/zsh/site-functions/_git-fixup}
- {src: _git-squash, dst: ~/.local/share/zsh/site-functions/_git-squash}
- repo:
- git@code.infektor.net:benie/config.git

View File

@ -43,8 +43,6 @@ rely on the shell to function. The following aliases extend the default
[Git][git] completions.
* `git changes` completions for the branch name to compare with are provided.
* `git fixup`/`git squash` completions for recent commits to fixup/squash are
provided.
[git]: https://git-scm.com
[aliases]: https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases

View File

@ -1,6 +0,0 @@
#compdef git-fixup
#description Prepare a commit for fixup during autosquash rebase.
_arguments '1: :__git_recent_commits'
# vim: ft=zsh

View File

@ -1,6 +0,0 @@
#compdef git-squash
#description Prepare a commit for squashing during autosquash rebase.
_arguments '1: :__git_recent_commits'
# vim: ft=zsh

4
config
View File

@ -5,8 +5,8 @@
unstage = reset -q HEAD --
amend = commit --amend
fixup = !sh -c 'git commit --fixup=$1' --
squash = !sh -c 'git commit --squash=$1' --
fixup = commit --fixup
squash = commit --squash
prepare = rebase -i --fork-point
list = branch