1
0
Fork 0
mirror of synced 2024-06-01 14:51:11 -04:00
Commit graph

20 commits

Author SHA1 Message Date
Eric Nielsen d259e19dd8 Don't need to use array[@] ouside double quotes
In  double  quotes,  array  elements  are put into separate words when
using `"${(@)array}"` or `"${array[@]}"`. See zshexpn(1).

Also according to the Zsh documentation, these forms preserve empty
elements of the array.
2018-11-19 19:43:21 -05:00
Eric Nielsen f11bb607c5 [git] Update git-branch-delete-interactive
so we don't suggest deleting remote branches when `git rev-parse`
failed. For example, it could fail if a remote tracking branch is gone.
2018-04-25 19:20:51 -05:00
Eric Nielsen d371d80af2
Unify the for syntax
For short single commands, prefer a one-liner `for` with the zsh syntax:
```
for x (foo bar) print ${x}
```
Otherwise just place `; do` on the same line as the POSIX `for ... in`:
```
for x in foo bar; do
  print ${x}
done
```

Closes #268
2018-04-25 08:59:19 -05:00
Eric Nielsen 8655867ca2 [git] Add completion for gbx and gbX
that use the git-branch-delete-interactive function.

Thanks to @Mikachu for helping with the completion function
implementation over the #zsh chat.

Closes #265
2018-04-13 15:13:43 -05:00
Eric Nielsen 926627652f [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
2018-02-23 09:28:10 +01:00
Eric Nielsen 451e51bd88 [git] Add git-branch-delete-interactive
that prompts if upstream remote branch(es) should be deleted too. As
with `git branch`, the function supports multiple branches as params,
and also the `-r`/`--remotes` param. Update `gbx` and `gbX` to use this
function.

Also update `git-stash-clear-interactive` to have multiple tests instead
of multiple nested `if`/`then`/`fi`. (Simpler syntax, IMHO)
2018-02-05 10:44:59 -05:00
Eric Nielsen 0a7451999e [git] Review all functions but ones using git fsck
as there are multiple solutions to list the lost commits and stashes,
but I could not find reliable ones. See
https://stackoverflow.com/q/89332/2654518.
Well, the current `git-commit-lost` and `git-stash-dropped`
implementations don't accurately work at least on the repositories I'm
working with.

The `git-hub` functions where removed at dcc3265, but aliases and docs
remained. Remove these.

Remove line break from `_git_log_oneline_format`, so it really occupies
one line. And change date format in `glG` output from committer date
(`%cd`) to relative author date (`%ar`) to conform with other formats.

Refactor remaining functions. Most of the changes refer to using the
already existing git error messages and return codes, instead of having
code that creates that. (Error messages for 'not in a git repository'
where not even consistent among functions, and there's were I started
this...)
The most drastic changes can be seen in `git-root`, then in `git-dir`
and `git-stash-clear-interactive`.
2018-01-10 10:25:25 -05:00
Eric Nielsen 9de30b97b1 Remove is-true function
that was only being used in the `git` and `git-info` modules to check
the output of `git rev-parse --is-inside-work-tree`. The code depending
on this function was already changed.

Closes #163
2017-04-11 17:50:09 -07:00
Eric Nielsen b34a75e4d8 Remove git dependency on is-true function
The function is currently only being used for checking the result of
`git rev-parse --is-inside-work-tree`. Checking for the return code of
the command is enough.
2017-04-11 17:50:07 -07:00
Sebastian S 449634a99e git-commit-list: fix typo
command is written with two m, not three.

Closes #156
2017-03-29 12:57:05 -07:00
Eric Nielsen c7b2232378 Inline is-true function body, as other functions
defined in Zim. Instead of creating an additional `is-true() { }`
function scope.

Closes #148
2017-03-27 13:56:45 -07:00
Eric Nielsen c1b02c06d0 Remove git_prompt_info and parse_git_dirty
as they were only being used by gitster prompt theme and kept for
Oh-My-Zsh compatibility. The newly introduced git-info module (inspired
by the git-info Prezto function) provides a more powerful
implementation than the Oh-My-Zsh inspired git_prompt_info.

Updated gitster to use the git-info module.

Closes #124
2017-01-19 05:10:19 -08:00
Matt Hamilton 0c1aa6e133 [git] fix some functions
* remove unneeded explination and authorship comments (as it's
noted in the README.md)

* s/git/command git/ (see issue #30)

* add is-true function, as it is required by a few other functions.
2016-02-04 15:33:12 -05:00
KoharaKazuya b23f7ec6d9 [prompt] fix gitster local var
separate declaration and initialization of local array variable

Closes #21
2016-01-12 09:03:21 -05:00
Matt Hamilton dcc3265987 remove git-hub functions 2015-12-19 09:49:11 -05:00
Matt Hamilton a1a56ac63f use consistent variable style 2015-12-19 09:48:29 -05:00
Matt Hamilton 08c9987b38 symlink git_current_branch to git-branch-current 2015-12-19 09:42:09 -05:00
Matt Hamilton f2f0346864 add git_current_branch for theme compatibility 2015-12-18 10:57:19 -05:00
Matt Hamilton 3e6785c993 add oh-my-zsh theme compatibility git funcs 2015-12-18 09:45:36 -05:00
Matt Hamilton 3a62391e0e initial commit 2015-12-15 00:12:17 -05:00