GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Prepare v2.0.0 (#88) · filhodanuvem/gitql@d936e68

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • ci.yml
  • cmd.go
  • runtime
    • reference.go
    • runtime.go
  • tables.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/ci.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/ci.yml
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on: [push]
33
jobs:
44
build-linux:
55
name: Build linux
6-
runs-on: ubuntu-latest
6+
runs-on: ubuntu-18.04
77
steps:
88
- name: Set up Go 1.12
99
uses: actions/setup-go@v1
@@ -35,7 +35,7 @@ jobs:
3535

3636
build-mac:
3737
name: Build mac
38-
runs-on: macos-latest
38+
runs-on: macOS-10.14
3939
steps:
4040
- name: Set up Go 1.12
4141
uses: actions/setup-go@v1
@@ -90,7 +90,6 @@ jobs:
9090
TARGET_OS_ARCH: windows/amd64
9191
run: |
9292
choco install ninja vcredist2017
93-
set PATH=%HOMEDRIVE%\mingw64\bin;%PATH%
9493
make build
9594
.\gitql.exe -v
9695
Collapse file

‎cmd.go‎

Copy file name to clipboardExpand all lines: cmd.go
+14-11Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ import (
1616
"github.com/pkg/errors"
1717
)
1818

19-
const Version = "Gitql 1.6.0"
19+
const Version = "Gitql 2.0.0"
2020

2121
type Gitql struct {
2222
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"`
2728
Query string
2829
}
2930

@@ -125,10 +126,11 @@ func (cmd *Gitql) parse(argv []string) error {
125126
args, err := p.ParseArgs(argv)
126127

127128
if err != nil {
129+
os.Stderr.Write(cmd.usage())
128130
return err
129131
}
130132

131-
if !cmd.Isinteractive && !cmd.Version && !cmd.ShowTables && len(args) == 0 {
133+
if cmd.Help || (!cmd.Isinteractive && !cmd.Version && !cmd.ShowTables && len(args) == 0) {
132134
os.Stderr.Write(cmd.usage())
133135
return errors.New("invalid command line options")
134136
}
@@ -144,14 +146,15 @@ func (cmd Gitql) usage() []byte {
144146
Usage: gitql [flags] [args]
145147
146148
Flags:
147-
-i Enter to interactive mode
148-
-p string
149+
-i --interactive Enter to interactive mode
150+
-p --path string
149151
The (optional) path to run gitql (default ".")
150-
--show-tables
152+
-s --show-tables
151153
Show all tables
152-
--type string
154+
-f --type string
153155
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
155158
Arguments:
156159
sql: A query to run
157160
`)
Collapse file

‎runtime/reference.go‎

Copy file name to clipboardExpand all lines: runtime/reference.go
+3-7Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package runtime
22

33
import (
4-
"strconv"
54
"log"
5+
"strconv"
66

7-
"github.com/cloudson/git2go"
7+
git "github.com/cloudson/git2go"
88
"github.com/cloudson/gitql/parser"
99
)
1010

@@ -53,7 +53,7 @@ func walkReferences(n *parser.NodeProgram, visitor *RuntimeVisitor) (*TableData,
5353
if s.Count {
5454
newRow := make(tableRow)
5555
// counter was started from 1!
56-
newRow[COUNT_FIELD_NAME] = strconv.Itoa(counter-1)
56+
newRow[COUNT_FIELD_NAME] = strconv.Itoa(counter - 1)
5757
counter = 2
5858
rows = append(rows, newRow)
5959
}
@@ -98,10 +98,6 @@ func metadataReference(identifier string, object *git.Reference) string {
9898
return REFERENCE_TYPE_BRANCH
9999
}
100100

101-
if object.IsRemote() {
102-
return REFERENCE_TYPE_REMOTE
103-
}
104-
105101
if object.IsTag() {
106102
return REFERENCE_TYPE_TAG
107103
}
Collapse file

‎runtime/runtime.go‎

Copy file name to clipboardExpand all lines: runtime/runtime.go
-14Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
const (
1717
WALK_COMMITS = 1
1818
WALK_REFERENCES = 2
19-
WALK_REMOTES = 3
2019
)
2120

2221
const (
@@ -47,7 +46,6 @@ type GitBuilder struct {
4746
currentWalkType uint8
4847
currentCommit *git.Commit
4948
currentReference *git.Reference
50-
currentRemote *git.Remote
5149
walk *git.RevWalk
5250
}
5351

@@ -116,8 +114,6 @@ func findWalkType(n *parser.NodeProgram) uint8 {
116114
switch s.Tables[0] {
117115
case "commits":
118116
builder.currentWalkType = WALK_COMMITS
119-
case "remotes":
120-
builder.currentWalkType = WALK_REMOTES
121117
case "refs", "tags", "branches":
122118
builder.currentWalkType = WALK_REFERENCES
123119
}
@@ -248,10 +244,6 @@ func (g *GitBuilder) setReference(object *git.Reference) {
248244
g.currentReference = object
249245
}
250246

251-
func (g *GitBuilder) setRemote(object *git.Remote) {
252-
g.currentRemote = object
253-
}
254-
255247
func (g *GitBuilder) WithTable(tableName string, alias string) error {
256248
err := g.isValidTable(tableName)
257249
if err != nil {
@@ -295,12 +287,6 @@ func PossibleTables() map[string][]string {
295287
"type",
296288
"hash",
297289
},
298-
"remotes": {
299-
"name",
300-
"url",
301-
"push_url",
302-
"owner",
303-
},
304290
"tags": {
305291
"name",
306292
"full_name",
Collapse file

‎tables.md‎

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 numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ Gitql [![Build Status](https://travis-ci.org/cloudson/gitql.png)](https://travis
1414
| message |
1515
| full_message |
1616

17-
| remotes |
18-
| ---------|
19-
| name |
20-
| url |
21-
| push_url |
22-
| owner |
23-
24-
2517
| tags |
2618
| ---------|
2719
| name |

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.