aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSladyn <gunnerforlife00@gmail.com>2019-03-01 20:00:07 +0530
committerSladyn <gunnerforlife00@gmail.com>2019-03-02 23:06:55 +0530
commitbeecd2dbe449e551d08668adf0b8ace427d09c49 (patch)
tree6b7f517508cc0dc9cc8a9ae83d7017c0b0581254
parent43e56692e832bcb4ef39f745ec9fbaf7360052de (diff)
downloadgit-bug-beecd2dbe449e551d08668adf0b8ace427d09c49.tar.gz
Made requested changes
Made changes to the doc files and remaining areas which required updation.
-rw-r--r--bug/snapshot.go8
-rw-r--r--cache/bug_excerpt.go29
-rw-r--r--cache/query.go4
-rw-r--r--cache/query_test.go3
-rw-r--r--commands/ls.go6
-rw-r--r--doc/queries.md10
-rw-r--r--input/input.go1
7 files changed, 29 insertions, 32 deletions
diff --git a/bug/snapshot.go b/bug/snapshot.go
index 46618ebd..83b94416 100644
--- a/bug/snapshot.go
+++ b/bug/snapshot.go
@@ -34,14 +34,6 @@ func (snap *Snapshot) HumanId() string {
return FormatHumanID(snap.id)
}
-// Deprecated:should be moved in UI code
-func (snap *Snapshot) Summary() string {
- return fmt.Sprintf("C:%d L:%d",
- len(snap.Comments)-1,
- len(snap.Labels),
- )
-}
-
// Return the last time a bug was modified
func (snap *Snapshot) LastEditTime() time.Time {
if len(snap.Operations) == 0 {
diff --git a/cache/bug_excerpt.go b/cache/bug_excerpt.go
index eae90f5a..86424a0a 100644
--- a/cache/bug_excerpt.go
+++ b/cache/bug_excerpt.go
@@ -23,16 +23,11 @@ type BugExcerpt struct {
CreateUnixTime int64
EditUnixTime int64
- Title string
- Status bug.Status
- NoOfComments int
- Labels []bug.Label
-
- // If author is identity.Bare, LegacyAuthor is set
- // If author is identity.Identity, AuthorId is set and data is deported
- // in a IdentityExcerpt
- LegacyAuthor LegacyAuthorExcerpt
- AuthorId string
+ Title string
+ Status bug.Status
+ Author identity.Interface
+ LenComments int
+ Labels []bug.Label
CreateMetadata map[string]string
}
@@ -53,22 +48,10 @@ func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) *BugExcerpt {
Title: snap.Title,
Status: snap.Status,
Labels: snap.Labels,
- NoOfComments: len(snap.Comments),
+ LenComments: len(snap.Comments),
CreateMetadata: b.FirstOp().AllMetadata(),
}
- switch snap.Author.(type) {
- case *identity.Identity:
- e.AuthorId = snap.Author.Id()
- case *identity.Bare:
- e.LegacyAuthor = LegacyAuthorExcerpt{
- Login: snap.Author.Login(),
- Name: snap.Author.Name(),
- }
- default:
- panic("unhandled identity type")
- }
-
return e
}
diff --git a/cache/query.go b/cache/query.go
index 6ffa6510..39815d32 100644
--- a/cache/query.go
+++ b/cache/query.go
@@ -60,6 +60,10 @@ func ParseQuery(query string) (*Query, error) {
f := LabelFilter(qualifierQuery)
result.Label = append(result.Label, f)
+ case "title":
+ f := TitleFilter(qualifierQuery)
+ result.Label = append(result.Title, f)
+
case "no":
err := result.parseNoFilter(qualifierQuery)
if err != nil {
diff --git a/cache/query_test.go b/cache/query_test.go
index 29d2f585..2d7ee8e1 100644
--- a/cache/query_test.go
+++ b/cache/query_test.go
@@ -22,6 +22,9 @@ func TestQueryParse(t *testing.T) {
{"label:hello", true},
{`label:"Good first issue"`, true},
+ {"title:Bug titleOne", true},
+ {`title:"Bug titleTwo"`, true},
+
{"sort:edit", true},
{"sort:unknown", false},
}
diff --git a/commands/ls.go b/commands/ls.go
index e40f3542..7dbac96e 100644
--- a/commands/ls.go
+++ b/commands/ls.go
@@ -55,11 +55,15 @@ func runLsBug(cmd *cobra.Command, args []string) error {
authorFmt := fmt.Sprintf("%-15.15s", b.Author.Name)
fmt.Printf("%s %s\t%s\t%s\tC:%d L:%d\n",
+<<<<<<< HEAD
colors.Cyan(b.HumanId()),
+=======
+ colors.Cyan(b.Id),
+>>>>>>> Made requested changes
colors.Yellow(b.Status),
titleFmt,
colors.Magenta(authorFmt),
- b.NoOfComments,
+ b.LenComments,
len(b.Labels),
)
}
diff --git a/doc/queries.md b/doc/queries.md
index 93135070..424e0d31 100644
--- a/doc/queries.md
+++ b/doc/queries.md
@@ -42,6 +42,16 @@ You can filter based on the bug's label.
| `label:LABEL` | `label:prod` matches bugs with the label `prod` |
| | `label:"Good first issue"` matches bugs with the label `Good first issue` |
+### Filtering by title
+
+You can filter based on the bug's title.
+
+| Qualifier | Example |
+| --- | --- |
+| `title:TITLE` | `title:Critical` matches bugs with the title `Critical` |
+| | `title:"Typo in string"` matches bugs with the title `Typo in string` |
+
+
### Filtering by missing feature
You can filter bugs based on the absence of something.
diff --git a/input/input.go b/input/input.go
index c36b9046..789373b0 100644
--- a/input/input.go
+++ b/input/input.go
@@ -193,6 +193,7 @@ const queryTemplate = `%s
#
# - status:open, status:closed
# - author:<query>
+# - title:<title>
# - label:<label>
# - no:label
#