changelog shortlog graph tags branches files raw bz2 zip gz help > public > fish-completions / changeset: initial commit, for gitless 0.8.6

changeset 0: 56168281ef84
author: Gunnar Zötl <>
date: Fri, 24 Aug 2018 10:41:20 +0200
files: Makefile
description: initial commit, for gitless 0.8.6
     1.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2+++ b/Makefile	Fri Aug 24 10:41:20 2018 +0200
     1.3@@ -0,0 +1,7 @@
     1.5+	echo "the only valid target is install"
     1.8+	mkdir -p ~/.config/fish/completions
     1.9+	cp ~/.config/fish/completions
    1.10+	chmod 664 ~/.config/fish/completions/
     2.1--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2+++ b/	Fri Aug 24 10:41:20 2018 +0200
     2.3@@ -0,0 +1,185 @@
     2.4+# fish completion for gl (gitless)
     2.6+set -x __fish_gl_command_list track untrack status diff commit branch tag checkout merge resolve fuse remote publish switch init history
     2.8+function __fish_gl_commands
     2.9+    for command in $__fish_gl_command_list
    2.10+        switch $command
    2.11+            case "track"
    2.12+                printf "$command\tstart tracking changes to files\n"
    2.13+            case "untrack"
    2.14+                printf "$command\tstop tracking changes to files\n"
    2.15+            case "status"
    2.16+                printf "$command\tshow status of the repo\n"
    2.17+            case "diff"
    2.18+                printf "$command\tshow changes to files\n"
    2.19+            case "commit"
    2.20+                printf "$command\tsave changes to the local repository\n"
    2.21+            case "branch"
    2.22+                printf "$command\tlist, create, delete, or edit branches\n"
    2.23+            case "tag"
    2.24+                printf "$command\tlist, create, or delete tags\n"
    2.25+            case "checkout"
    2.26+                printf "$command\tcheckout committed versions of files\n"
    2.27+            case "merge"
    2.28+                printf "$command\tmerge the divergent changes of one branch onto another\n"
    2.29+            case "resolve"
    2.30+                printf "$command\tmark files with conflicts as resolved\n"
    2.31+            case "fuse"
    2.32+                printf "$command\tfuse the divergent changes of a branch onto the current branch\n"
    2.33+            case "remote"
    2.34+                printf "$command\tlist, create, edit or delete remotes\n"
    2.35+            case "publish"
    2.36+                printf "$command\tpublish commits upstream\n"
    2.37+            case "switch"
    2.38+                printf "$command\tswitch branches\n"
    2.39+            case "init"
    2.40+                printf "$command\tcreate an empty Gitless's repository or create one from an existing remote repository\n"
    2.41+            case "history"
    2.42+                printf "$command\tshow commit history\n"
    2.43+        end
    2.44+    end
    2.47+function __fish_gl_get_command
    2.48+    set -l cmdline (commandline -poc)
    2.49+    if [ (count $cmdline) -gt 1 ]
    2.50+        for command in $__fish_gl_command_list
    2.51+            if [ "$cmdline[2]" = "$command" ]
    2.52+                echo $cmdline[2]
    2.53+                return 0
    2.54+            end
    2.55+        end
    2.56+    end
    2.57+    return 1
    2.60+function __fish_gl_is_command --argument-names cmd
    2.61+    if set -l token (__fish_gl_get_command)
    2.62+        if [ "$token" = "$cmd" ]
    2.63+            return 0
    2.64+        end
    2.65+    end
    2.66+    return 1
    2.69+function __fish_gl_needs_command
    2.70+    not __fish_gl_get_command > /dev/null
    2.73+function __fish_gl_list_tracked
    2.77+function __fish_gl_list_untracked
    2.78+    set -l output (gl status)
    2.79+    set -l state 0
    2.80+    for line in $output
    2.81+        if [ $state -eq 0 ]
    2.82+            if string match -q -r "Untracked" "$line"
    2.83+                set state 1
    2.84+            end
    2.85+        else if [ $state -eq 1 ]
    2.86+            if string match -q -r '^\s*$' "$line"
    2.87+                set state 2
    2.88+            end
    2.89+        else if string match -q -v 'There are no untracked files to list' "$line"
    2.90+            and string match -q -v -r '^\s*$' "$line"
    2.91+        echo 1
    2.92+            string replace -r '^\s+(.+)$' '$1' "$line"
    2.93+        else
    2.94+        echo 2
    2.95+            break
    2.96+        end
    2.97+    end
    2.98+    echo
   2.101+function __fish_gl_list_tags
   2.102+    set -l output (gl tag)
   2.103+    for line in $output
   2.104+        if string match -q -r '^\s{4}.+\s+tags [0-9a-f]{7,8}' "$line"
   2.105+            string replace -r '^\s+(.*\w)\s+tags [0-9a-f]{7,8} (.+)$' '$1\t$2' "$line"
   2.106+        end
   2.107+    end
   2.110+function __fish_gl_list_branches
   2.111+    set -l output (gl branch)
   2.112+    for line in $output
   2.113+        if string match -q -r '^\s{4}\*?\s+.+' "$line"
   2.114+            string replace -r '^\s+\*?\s+(.*\w)\s+\((.+)\)$' '$1\t$2' "$line"
   2.115+        end
   2.116+    end
   2.119+function __fish_gl_list_remotes
   2.120+    set -l output (gl remote)
   2.121+    for line in $output
   2.122+        if string match -q -r '^\s{4}.+ \(maps to' "$line"
   2.123+            string replace -r '^\s+(.+) \(maps to (.+)\)$' '$1\t$2' "$line"
   2.124+        end
   2.125+    end
   2.128+# global options
   2.129+complete -c gl -s h -l help -d "show help message and quit"
   2.130+complete -c gl -l version -d "show version number and exit"
   2.132+# subcommands
   2.133+complete -c gl -n "__fish_gl_needs_command" -x -a "(__fish_gl_commands)"
   2.135+# track
   2.136+complete -c gl -n "__fish_gl_is_command track" -r -f -a "(__fish_gl_list_untracked)"
   2.137+# untrack
   2.138+complete -c gl -n "__fish_gl_is_command untrack" -r #-f -a "(__fish_gl_list_tracked)"
   2.139+# status
   2.140+#complete -c gl -n "__fish_gl_is_command status" -f -a "(__fish_gl_list_tracked)"
   2.141+# diff
   2.142+complete -c gl -n "__fish_gl_is_command diff" -d "only these files" #-f -a "(__fish_gl_list_tracked)"
   2.143+complete -c gl -n "__fish_gl_is_command diff" -s e -l exclude -d "exclude files" #-f -a "(__fish_gl_list_tracked)"
   2.144+complete -c gl -n "__fish_gl_is_command diff" -s i -l include -d "include files" #-f -a "(__fish_gl_list_tracked)"
   2.145+# commit
   2.146+complete -c gl -n "__fish_gl_is_command commit" -s m -l message -f -d "commit message"
   2.147+complete -c gl -n "__fish_gl_is_command commit" -d "only these files" #-f -a "(__fish_gl_list_tracked)"
   2.148+complete -c gl -n "__fish_gl_is_command commit" -s e -l exclude -d "exclude files" #-f -a "(__fish_gl_list_tracked)"
   2.149+complete -c gl -n "__fish_gl_is_command commit" -s i -l include -d "include files" #-f -a "(__fish_gl_list_tracked)"
   2.150+complete -c gl -n "__fish_gl_is_command commit" -s p -l partial -d "partial commit"
   2.151+# branch
   2.152+complete -c gl -n "__fish_gl_is_command branch" -s r -l remote -f -d "also list remote branches"
   2.153+complete -c gl -n "__fish_gl_is_command branch" -s v -l verbose -f -d "be verbose"
   2.154+complete -c gl -n "__fish_gl_is_command branch" -s c -l create -f -d "create branch"
   2.155+complete -c gl -n "__fish_gl_is_command branch" -o dp -l divergent-point -f -d "commit from where to branch out"
   2.156+complete -c gl -n "__fish_gl_is_command branch" -s d -l delete -f -a "(__fish_gl_list_branch)" -d "delete branch"
   2.157+complete -c gl -n "__fish_gl_is_command branch" -o sh -l set-head -f -d "set head of the current branch"
   2.158+complete -c gl -n "__fish_gl_is_command branch" -o su -l set-upstream -f -d "set upstream branch of the current branch"
   2.159+complete -c gl -n "__fish_gl_is_command branch" -o uu -l unset-upstream -f -d "unset upstream branch of the current branch"
   2.160+# tag
   2.161+complete -c gl -n "__fish_gl_is_command tag" -s r -l remote -f -d "also list remote tags"
   2.162+complete -c gl -n "__fish_gl_is_command tag" -s c -l create -f -d "create tag"
   2.163+complete -c gl -n "__fish_gl_is_command tag" -o ci -l commit -f -d "the commit to tag"
   2.164+complete -c gl -n "__fish_gl_is_command tag" -s d -l delete -r -f -a "(__fish_gl_list_tags)" -d "delete tag"
   2.165+# checkout
   2.166+complete -c gl -n "__fish_gl_is_command checkout" -o cp -l commit-point -f -d "commit point to check out files at"
   2.167+# merge
   2.168+complete -c gl -n "__fish_gl_is_command merge" -s a -l abort -f -d "abort merge in progress"
   2.169+# resolve
   2.170+#complete -c gl -n "__fish_gl_is_command resolve" -f -a "(__fish_gl_list_tracked)"
   2.171+# fuse
   2.172+complete -c gl -n "__fish_gl_is_command fuse" -s o -l only -f -d "only these commits"
   2.173+complete -c gl -n "__fish_gl_is_command fuse" -s e -l exclude -f -d "exclude these commits"
   2.174+complete -c gl -n "__fish_gl_is_command fuse" -o ip -l insertion-point -f -d "insert divergent changes after the given commit"
   2.175+complete -c gl -n "__fish_gl_is_command fuse" -s a -l abort -f -d "abort fuse in progress"
   2.176+# remote
   2.177+complete -c gl -n "__fish_gl_is_command remote" -s c -l create -f -d "create remote"
   2.178+complete -c gl -n "__fish_gl_is_command remote" -s d -l delete -f -a "(__fish_gl_list_remotes)" -d "delete remote"
   2.179+# publish
   2.180+# switch
   2.181+complete -c gl -n "__fish_gl_is_command switch" -o mo -l move-over -f -d "move uncommitted changes to other branch"
   2.182+# init
   2.183+complete -c gl -n "__fish_gl_is_command init" -f -a "https://" -d "url of repo to clone"
   2.184+# history
   2.185+complete -c gl -n "__fish_gl_is_command history" -s v -l verbose -f -d "be verbose"
   2.186+complete -c gl -n "__fish_gl_is_command history" -s l -l limit -f -d "limit number of commits displayed"
   2.187+complete -c gl -n "__fish_gl_is_command history" -s c -l compact -f -d "output in compact format"
   2.188+complete -c gl -n "__fish_gl_is_command history" -s b -l branch -f -d "branch to show history of"