GeezerVison is showing github.com — Prepare v2.0.0 (#88) · filhodanuvem/gitql@d936e68
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/workflows/ci.yml +2-3Lines changed: 2 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -3,7 +3,7 @@ on: [push] | 3 | 3 | jobs: | 4 | 4 | build-linux: | 5 | 5 | name: Build linux | 6 | | - runs-on: ubuntu-latest | | 6 | + runs-on: ubuntu-18.04 | 7 | 7 | steps: | 8 | 8 | - name: Set up Go 1.12 | 9 | 9 | uses: actions/setup-go@v1 | | 35 | 35 |
| 36 | 36 | build-mac: | 37 | 37 | name: Build mac | 38 | | - runs-on: macos-latest | | 38 | + runs-on: macOS-10.14 | 39 | 39 | steps: | 40 | 40 | - name: Set up Go 1.12 | 41 | 41 | uses: actions/setup-go@v1 | | 90 | 90 | TARGET_OS_ARCH: windows/amd64 | 91 | 91 | run: | | 92 | 92 | choco install ninja vcredist2017 | 93 | | - set PATH=%HOMEDRIVE%\mingw64\bin;%PATH% | 94 | 93 | make build | 95 | 94 | .\gitql.exe -v | 96 | 95 |
| |
Collapse file Copy file name to clipboardExpand all lines: cmd.go +14-11Lines changed: 14 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,14 +16,15 @@ import ( | 16 | 16 | "github.com/pkg/errors" | 17 | 17 | ) | 18 | 18 |
| 19 | | -const Version = "Gitql 1.6.0" | | 19 | +const Version = "Gitql 2.0.0" | 20 | 20 |
| 21 | 21 | type Gitql struct { | 22 | 22 | Path string `short:"p" default:"."` | 23 | | - Version bool `short:"v"` | 24 | | - Isinteractive bool `short:"i"` | 25 | | - ShowTables bool `long:"show-tables"` | 26 | | - TypeFormat string `long:"type" default:"table"` | | 23 | + Help bool `short:"h" long:"help"` | | 24 | + Version bool `short:"v" long:"version"` | | 25 | + Isinteractive bool `short:"i" long:"interactive"` | | 26 | + ShowTables bool `short:"s" long:"show-tables"` | | 27 | + TypeFormat string `short:"f" long:"type" default:"table"` | 27 | 28 | Query string | 28 | 29 | } | 29 | 30 |
| @@ -125,10 +126,11 @@ func (cmd *Gitql) parse(argv []string) error { | 125 | 126 | args, err := p.ParseArgs(argv) | 126 | 127 |
| 127 | 128 | if err != nil { | | 129 | + os.Stderr.Write(cmd.usage()) | 128 | 130 | return err | 129 | 131 | } | 130 | 132 |
| 131 | | - if !cmd.Isinteractive && !cmd.Version && !cmd.ShowTables && len(args) == 0 { | | 133 | + if cmd.Help || (!cmd.Isinteractive && !cmd.Version && !cmd.ShowTables && len(args) == 0) { | 132 | 134 | os.Stderr.Write(cmd.usage()) | 133 | 135 | return errors.New("invalid command line options") | 134 | 136 | } | @@ -144,14 +146,15 @@ func (cmd Gitql) usage() []byte { | 144 | 146 | Usage: gitql [flags] [args] | 145 | 147 |
| 146 | 148 | Flags: | 147 | | - -i Enter to interactive mode | 148 | | - -p string | | 149 | + -i --interactive Enter to interactive mode | | 150 | + -p --path string | 149 | 151 | The (optional) path to run gitql (default ".") | 150 | | - --show-tables | | 152 | + -s --show-tables | 151 | 153 | Show all tables | 152 | | - --type string | | 154 | + -f --type string | 153 | 155 | The output type format {table|json} (default "table") | 154 | | - -v The version of gitql | | 156 | + -v --version The version of gitql | | 157 | + -h --help this help | 155 | 158 | Arguments: | 156 | 159 | sql: A query to run | 157 | 160 | `) | |
Collapse file Copy file name to clipboardExpand all lines: runtime/reference.go +3-7Lines changed: 3 additions & 7 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | package runtime | 2 | 2 |
| 3 | 3 | import ( | 4 | | - "strconv" | 5 | 4 | "log" | | 5 | + "strconv" | 6 | 6 |
| 7 | | - "github.com/cloudson/git2go" | | 7 | + git "github.com/cloudson/git2go" | 8 | 8 | "github.com/cloudson/gitql/parser" | 9 | 9 | ) | 10 | 10 |
| @@ -53,7 +53,7 @@ func walkReferences(n *parser.NodeProgram, visitor *RuntimeVisitor) (*TableData, | 53 | 53 | if s.Count { | 54 | 54 | newRow := make(tableRow) | 55 | 55 | // counter was started from 1! | 56 | | - newRow[COUNT_FIELD_NAME] = strconv.Itoa(counter-1) | | 56 | + newRow[COUNT_FIELD_NAME] = strconv.Itoa(counter - 1) | 57 | 57 | counter = 2 | 58 | 58 | rows = append(rows, newRow) | 59 | 59 | } | @@ -98,10 +98,6 @@ func metadataReference(identifier string, object *git.Reference) string { | 98 | 98 | return REFERENCE_TYPE_BRANCH | 99 | 99 | } | 100 | 100 |
| 101 | | - if object.IsRemote() { | 102 | | - return REFERENCE_TYPE_REMOTE | 103 | | - } | 104 | | - | 105 | 101 | if object.IsTag() { | 106 | 102 | return REFERENCE_TYPE_TAG | 107 | 103 | } | |
Collapse file Copy file name to clipboardExpand all lines: runtime/runtime.go -14Lines changed: 0 additions & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,7 +16,6 @@ import ( | 16 | 16 | const ( | 17 | 17 | WALK_COMMITS = 1 | 18 | 18 | WALK_REFERENCES = 2 | 19 | | - WALK_REMOTES = 3 | 20 | 19 | ) | 21 | 20 |
| 22 | 21 | const ( | @@ -47,7 +46,6 @@ type GitBuilder struct { | 47 | 46 | currentWalkType uint8 | 48 | 47 | currentCommit *git.Commit | 49 | 48 | currentReference *git.Reference | 50 | | - currentRemote *git.Remote | 51 | 49 | walk *git.RevWalk | 52 | 50 | } | 53 | 51 |
| @@ -116,8 +114,6 @@ func findWalkType(n *parser.NodeProgram) uint8 { | 116 | 114 | switch s.Tables[0] { | 117 | 115 | case "commits": | 118 | 116 | builder.currentWalkType = WALK_COMMITS | 119 | | - case "remotes": | 120 | | - builder.currentWalkType = WALK_REMOTES | 121 | 117 | case "refs", "tags", "branches": | 122 | 118 | builder.currentWalkType = WALK_REFERENCES | 123 | 119 | } | @@ -248,10 +244,6 @@ func (g *GitBuilder) setReference(object *git.Reference) { | 248 | 244 | g.currentReference = object | 249 | 245 | } | 250 | 246 |
| 251 | | -func (g *GitBuilder) setRemote(object *git.Remote) { | 252 | | - g.currentRemote = object | 253 | | -} | 254 | | - | 255 | 247 | func (g *GitBuilder) WithTable(tableName string, alias string) error { | 256 | 248 | err := g.isValidTable(tableName) | 257 | 249 | if err != nil { | @@ -295,12 +287,6 @@ func PossibleTables() map[string][]string { | 295 | 287 | "type", | 296 | 288 | "hash", | 297 | 289 | }, | 298 | | - "remotes": { | 299 | | - "name", | 300 | | - "url", | 301 | | - "push_url", | 302 | | - "owner", | 303 | | - }, | 304 | 290 | "tags": { | 305 | 291 | "name", | 306 | 292 | "full_name", | |
Collapse file Copy file name to clipboardExpand all lines: tables.md -8Lines changed: 0 additions & 8 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,14 +14,6 @@ Gitql [](https://travis | 14 | 14 | | message | | 15 | 15 | | full_message | | 16 | 16 |
| 17 | | -| remotes | | 18 | | -| ---------| | 19 | | -| name | | 20 | | -| url | | 21 | | -| push_url | | 22 | | -| owner | | 23 | | - | 24 | | - | 25 | 17 | | tags | | 26 | 18 | | ---------| | 27 | 19 | | name | | |
|