1
0
Fork 0
mirror of synced 2024-11-22 15:25:34 -05:00

[git] Breaking changes in aliases and functions

Rename `gpS` (mnemonic "pretty-signature") and `glS` ("log-signature")
to `gcv` ("commit-verify") and `glv` ("log-verify") respectivelly,
so `v` is used to verify signatures, and `s`/`S` is used to sign.

Remove `git-commit-lost` and `git-stash-dropped`, as this could be
probably joined into one function that shows all lost commits, including
lost stashes, and also because there seems to be many different ways to
do this, as discussed in https://stackoverflow.com/q/89332/2654518.
An answer worth noting is https://stackoverflow.com/a/6455586/2654518.
If someone is using this, let's discuss on a new solution...

Remove Oh-My-Zsh compatibility from `git-branch-current`, and delete
`git_current_branch`. This compatibility was already partially broken at
c1b02c0, when we also updated the gitster prompt theme. Now this
function fails when in 'detached HEAD' state (is was returning the
commit hash in this state), which is what we would expect from the use
we make of it.

Closes #244
This commit is contained in:
Eric Nielsen 2018-01-11 16:00:05 -05:00
parent 6465970530
commit 926627652f
6 changed files with 6 additions and 48 deletions

View file

@ -43,8 +43,8 @@ Aliases
commits.
- `gcR` removes the *HEAD* commit.
- `gcs` shows one or more objects (blobs, trees, tags and commits).
- `gcl` lists lost commits.
- `gcS` commits with GPG signature.
- `gcv` verifies the GPG signature of commits.
### Conflict
@ -104,7 +104,7 @@ Aliases
- `glG` displays the graph log with authors and dates.
- `glb` displays the brief commit log.
- `glc` displays the commit count for each contributor in descending order.
- `glS` displays the log verifying the GPG signature of commits.
- `glv` displays the log verifying the GPG signature of commits.
### Merge
@ -152,7 +152,6 @@ Aliases
- `gsx` drops a stashed state.
- `gsX` drops all the stashed states.
- `gsl` lists stashed states.
- `gsL` lists dropped stashed states.
- `gsd` displays changes between the stash and its original parent.
- `gsp` removes and applies a single stashed state from the stash list.
- `gsr` recovers a given stashed state.
@ -219,12 +218,10 @@ Functions
---------
- `git-branch-current` displays the current branch.
- `git-commit-lost` lists lost commits.
- `git-dir` displays the path to the Git directory.
- `git-ignore-add` adds any arguments to the .gitignore in the project root.
- `git-root` displays the path to the working tree root.
- `git-stash-clear-interactive` asks for confirmation before clearing the stash.
- `git-stash-dropped` lists dropped stashed states.
- `git-stash-recover` recovers given dropped stashed states.
- `git-submodule-move` moves a submodule.
- `git-submodule-remove` removes a submodule.

View file

@ -1 +0,0 @@
git_current_branch

View file

@ -0,0 +1,2 @@
# vim:et sts=2 sw=2 ft=zsh
command git symbolic-ref -q --short HEAD

View file

@ -1,13 +0,0 @@
if ! command git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
print "${0}: not a repository work tree: ${PWD}" >&2
return 1
fi
command git fsck 2> /dev/null \
| grep "^dangling commit" \
| awk '{print $3}' \
| command git log \
--date-order \
--no-walk \
--stdin \
--pretty=format:${_git_log_oneline_format}

View file

@ -1,15 +0,0 @@
if ! command git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
print "${0}: not a repository work tree: ${PWD}" >&2
return 1
fi
command git fsck --unreachable 2> /dev/null \
| grep 'commit' \
| awk '{print $3}' \
| command git log \
--pretty=format:${_git_log_oneline_format} \
--extended-regexp \
--grep="${1:-(WIP )?[Oo]n [^:]+:}" \
--merges \
--no-walk \
--stdin

View file

@ -1,10 +0,0 @@
# vim:et sts=2 sw=2 ft=zsh
# slightly modified git_current_branch from oh-my-zsh for theme compatibility
local ref
ref=$(command git symbolic-ref -q --short HEAD 2>/dev/null)
local -i ret=${?}
if (( ret )); then
(( ret == 128 )) && return # no git repo.
ref=$(command git rev-parse --short HEAD 2>/dev/null) || return
fi
print ${ref}

View file

@ -45,9 +45,8 @@ alias gcP='git cherry-pick --no-commit'
alias gcr='git revert'
alias gcR='git reset "HEAD^"'
alias gcs='git show --pretty=format:"${_git_log_medium_format}"'
alias gcl='git-commit-lost'
alias gcS='git commit -S'
alias gpS='git show --pretty=short --show-signature'
alias gcv='git verify-commit'
# Conflict (C)
alias gCl='git --no-pager diff --diff-filter=U --name-only'
@ -102,7 +101,7 @@ alias glg='git log --topo-order --all --graph --pretty=format:"${_git_log_onelin
alias glG='git log --topo-order --all --graph --pretty=format:"${_git_log_fullgraph_format}"'
alias glb='git log --topo-order --pretty=format:"${_git_log_brief_format}"'
alias glc='git shortlog --summary --numbered'
alias glS='git log --topo-order --show-signature --pretty=format:"${_git_log_medium_format}"'
alias glv='git log --topo-order --show-signature --pretty=format:"${_git_log_medium_format}"'
# Merge (m)
alias gm='git merge'
@ -143,7 +142,6 @@ alias gsa='git stash apply'
alias gsx='git stash drop'
alias gsX='git-stash-clear-interactive'
alias gsl='git stash list'
alias gsL='git-stash-dropped'
alias gsd='git stash show --patch --stat'
alias gsp='git stash pop'
alias gsr='git-stash-recover'