|
@@ -1,13 +1,13 @@
|
|
|
# GitNow — Speed up your Git workflow. 🐠
|
|
|
# https://github.com/joseluisq/gitnow
|
|
|
|
|
|
-function __gitnow_install -e paket_install
|
|
|
+function __gitnow_install -e gitnow_install
|
|
|
echo (gitnow -v)" is installed and ready to use!"
|
|
|
echo "Just run the `gitnow` command if you want explore the API."
|
|
|
end
|
|
|
|
|
|
-function __gitnow_uninstall -e paket_uninstall
|
|
|
- echo "GitNow is uninstalled successfully."
|
|
|
+function __gitnow_uninstall -e gitnow_uninstall
|
|
|
+ echo "GitNow was uninstalled successfully."
|
|
|
end
|
|
|
|
|
|
function gitnow -d "Gitnow: Speed up your Git workflow. 🐠" -a xversion
|
|
@@ -374,8 +374,11 @@ function move -d "GitNow: Switch from current branch to another but stashing unc
|
|
|
|
|
|
# Fetch branch from remote
|
|
|
if test -n "$v_upstream"
|
|
|
- command git fetch (__gitnow_current_remote) $v_branch
|
|
|
- set v_fetched 1
|
|
|
+ set -l v_remote (__gitnow_current_remote)
|
|
|
+ command git fetch $v_remote $v_branch:refs/remotes/$v_remote/$v_branch
|
|
|
+ command git checkout --track $v_remote/$v_branch
|
|
|
+ commandline -f repaint
|
|
|
+ return
|
|
|
end
|
|
|
|
|
|
set -l v_found (__gitnow_check_if_branch_exist $v_branch)
|
|
@@ -424,28 +427,35 @@ function logs -d "Gitnow: Shows logs in a fancy way"
|
|
|
return
|
|
|
end
|
|
|
|
|
|
- set -l args HEAD
|
|
|
+ set -l v_max_commits "80"
|
|
|
+ set -l v_args
|
|
|
+
|
|
|
+ for v in $argv
|
|
|
+ switch $v
|
|
|
+ case -h --help
|
|
|
+ echo "NAME"
|
|
|
+ echo " Gitnow: logs - Show logs in a fancy way (first $v_max_commits commits by default)"
|
|
|
+ echo "EXAMPLES"
|
|
|
+ echo " logs [git log options]"
|
|
|
+ echo "EXTRA OPTIONS:"
|
|
|
+ echo " -h, --help Show information about the options for this command"
|
|
|
+ return
|
|
|
+ case -\*
|
|
|
+ case '*'
|
|
|
+ set v_args $argv
|
|
|
+ break
|
|
|
+ end
|
|
|
+ end
|
|
|
|
|
|
- if test -n "$argv"
|
|
|
- set args $argv
|
|
|
+ if test -n "$v_args"
|
|
|
+ set v_max_commits
|
|
|
+ else
|
|
|
+ set v_max_commits "-$v_max_commits"
|
|
|
end
|
|
|
|
|
|
- LC_ALL=C command git log $args --color --graph \
|
|
|
- --pretty=format:"%Cred%h%C(reset) -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%an%C(reset) %C(brightmagenta dim)###%GK###%C(reset)%C(brightblack)@@%G?@@%C(reset)" --abbrev-commit \
|
|
|
- | LC_ALL=C command sed -E 's/@@@@//' \
|
|
|
- | LC_ALL=C command sed -E 's/@@([^"]*)@@/ (\1)/' \
|
|
|
- | LC_ALL=C command sed -E "s/###([^\"]*)###([^\"]*)\(G\)/"(command tput setaf 2)"\1/" \
|
|
|
- | LC_ALL=C command sed -E 's/###([^"]*)###/\1/' \
|
|
|
- | LC_ALL=C command sed -E 's/\(B\)/(bad signature)/' \
|
|
|
- | LC_ALL=C command sed -E 's/\(U\)/(good unknown validity signature)/' \
|
|
|
- | LC_ALL=C command sed -E 's/\(X\)/(good expired signature)/' \
|
|
|
- | LC_ALL=C command sed -E 's/\(Y\)/(good signature with expired key)/' \
|
|
|
- | LC_ALL=C command sed -E 's/\(R\)/(good signature with revoked key)/' \
|
|
|
- | LC_ALL=C command sed -E 's/\(E\)/(No checked signature)/' \
|
|
|
- | LC_ALL=C command sed -E 's/\(N\)//' \
|
|
|
+ LC_ALL=C command git log $v_max_commits $v_args --color --graph \
|
|
|
+ --pretty=format:"%C(red)%h%C(reset)%C(yellow)%d%Creset %s %C(green italic)(%cr)%C(reset) %C(blue)%an%C(reset) %C(white dim)%GK %C(reset)" --abbrev-commit \
|
|
|
| command less -R
|
|
|
-
|
|
|
- commandline -f repaint
|
|
|
end
|
|
|
|
|
|
function tag -d "Gitnow: Tag commits following Semver"
|