From 43e56692e832bcb4ef39f745ec9fbaf7360052de Mon Sep 17 00:00:00 2001 From: Sladyn Date: Thu, 28 Feb 2019 02:49:35 +0530 Subject: [PATCH 1/8] ls.go:`git bug ls` should be faster Added `Title` to BugExcerpt Added `TitleFilter` to `filter.go` Used BugExcerpt in `ls` command to improve performance. Closes https://github.com/MichaelMure/git-bug/issues/98 --- cache/bug_excerpt.go | 8 ++++++-- cache/filter.go | 16 ++++++++++++++++ cache/repo_cache.go | 9 +++++++++ commands/ls.go | 31 +++++++++++++++---------------- 4 files changed, 46 insertions(+), 18 deletions(-) diff --git a/cache/bug_excerpt.go b/cache/bug_excerpt.go index fd06e51b192e8a2997def3ebae321e0e01904272..eae90f5a46b8c7d28e9611417f9dfdc9aff52a22 100644 --- a/cache/bug_excerpt.go +++ b/cache/bug_excerpt.go @@ -23,8 +23,10 @@ type BugExcerpt struct { CreateUnixTime int64 EditUnixTime int64 - Status bug.Status - Labels []bug.Label + 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 @@ -48,8 +50,10 @@ func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) *BugExcerpt { EditLamportTime: b.EditLamportTime(), CreateUnixTime: b.FirstOp().GetUnixTime(), EditUnixTime: snap.LastEditUnix(), + Title: snap.Title, Status: snap.Status, Labels: snap.Labels, + NoOfComments: len(snap.Comments), CreateMetadata: b.FirstOp().AllMetadata(), } diff --git a/cache/filter.go b/cache/filter.go index 022a8ff25a058824ac21f59d36ba28c8f07c1824..a4254f2e562bbbf925e585e949d4c1603b3c2f9f 100644 --- a/cache/filter.go +++ b/cache/filter.go @@ -55,6 +55,17 @@ func LabelFilter(label string) Filter { } } +// TitleFilter return a Filter that match a title +func TitleFilter(title string) Filter { + return func(excerpt *BugExcerpt) bool { + if strings.Contains(excerpt.Title, title) { + return true + } + return false + } + +} + // NoLabelFilter return a Filter that match the absence of labels func NoLabelFilter() Filter { return func(repoCache *RepoCache, excerpt *BugExcerpt) bool { @@ -67,6 +78,7 @@ type Filters struct { Status []Filter Author []Filter Label []Filter + Title []Filter NoFilters []Filter } @@ -88,6 +100,10 @@ func (f *Filters) Match(repoCache *RepoCache, excerpt *BugExcerpt) bool { return false } + if match := f.andMatch(f.Title, excerpt); !match { + return false + } + return true } diff --git a/cache/repo_cache.go b/cache/repo_cache.go index 2b0fa360592cb71bc7d574f765c00290515508a0..fd5d086516a3ae3387351e430d4e9e2396531070 100644 --- a/cache/repo_cache.go +++ b/cache/repo_cache.go @@ -386,6 +386,15 @@ func (c *RepoCache) ResolveBug(id string) (*BugCache, error) { return cached, nil } +// ResolveBugExcerpt retrieve a BugExcerpt matching the exact given id +func (c *RepoCache) ResolveBugExcerpt(id string) (*BugExcerpt, error) { + e, ok := c.excerpts[id] + if !ok { + return nil, bug.ErrBugNotExist + } + + return e, nil +} // ResolveBugExcerpt retrieve a BugExcerpt matching the exact given id func (c *RepoCache) ResolveBugExcerpt(id string) (*BugExcerpt, error) { diff --git a/commands/ls.go b/commands/ls.go index 75b7ceaf6ea61167e987d99844b340a4a9ad6321..e40f3542b5b85c0a04e3238825bd11fe52040a49 100644 --- a/commands/ls.go +++ b/commands/ls.go @@ -5,7 +5,6 @@ import ( "strings" "github.com/MichaelMure/git-bug/cache" - "github.com/MichaelMure/git-bug/identity" "github.com/MichaelMure/git-bug/util/colors" "github.com/MichaelMure/git-bug/util/interrupt" "github.com/spf13/cobra" @@ -14,6 +13,7 @@ import ( var ( lsStatusQuery []string lsAuthorQuery []string + lsTitleQuery []string lsLabelQuery []string lsNoQuery []string lsSortBy string @@ -45,30 +45,22 @@ func runLsBug(cmd *cobra.Command, args []string) error { allIds := backend.QueryBugs(query) for _, id := range allIds { - b, err := backend.ResolveBug(id) + b, err := backend.ResolveBugExcerpt(id) if err != nil { return err } - snapshot := b.Snapshot() - - var author identity.Interface - - if len(snapshot.Comments) > 0 { - create := snapshot.Comments[0] - author = create.Author - } - // truncate + pad if needed - titleFmt := fmt.Sprintf("%-50.50s", snapshot.Title) - authorFmt := fmt.Sprintf("%-15.15s", author.DisplayName()) + titleFmt := fmt.Sprintf("%-50.50s", b.Title) + authorFmt := fmt.Sprintf("%-15.15s", b.Author.Name) - fmt.Printf("%s %s\t%s\t%s\t%s\n", + fmt.Printf("%s %s\t%s\t%s\tC:%d L:%d\n", colors.Cyan(b.HumanId()), - colors.Yellow(snapshot.Status), + colors.Yellow(b.Status), titleFmt, colors.Magenta(authorFmt), - snapshot.Summary(), + b.NoOfComments, + len(b.Labels), ) } @@ -87,6 +79,11 @@ func lsQueryFromFlags() (*cache.Query, error) { query.Status = append(query.Status, f) } + for _, title := range lsTitleQuery { + f := cache.TitleFilter(title) + query.Title = append(query.Title, f) + } + for _, author := range lsAuthorQuery { f := cache.AuthorFilter(author) query.Author = append(query.Author, f) @@ -156,6 +153,8 @@ func init() { "Filter by author") lsCmd.Flags().StringSliceVarP(&lsLabelQuery, "label", "l", nil, "Filter by label") + lsCmd.Flags().StringSliceVarP(&lsTitleQuery, "title", "t", nil, + "Filter by title") lsCmd.Flags().StringSliceVarP(&lsNoQuery, "no", "n", nil, "Filter by absence of something. Valid values are [label]") lsCmd.Flags().StringVarP(&lsSortBy, "by", "b", "creation", From beecd2dbe449e551d08668adf0b8ace427d09c49 Mon Sep 17 00:00:00 2001 From: Sladyn Date: Fri, 1 Mar 2019 20:00:07 +0530 Subject: [PATCH 2/8] Made requested changes Made changes to the doc files and remaining areas which required updation. --- bug/snapshot.go | 8 -------- cache/bug_excerpt.go | 29 ++++++----------------------- cache/query.go | 4 ++++ cache/query_test.go | 3 +++ commands/ls.go | 6 +++++- doc/queries.md | 10 ++++++++++ input/input.go | 1 + 7 files changed, 29 insertions(+), 32 deletions(-) diff --git a/bug/snapshot.go b/bug/snapshot.go index 46618ebddc77750dcd81ac1f79ff2e16ca929a8a..83b94416fe8616a2e29d3f1370e53c51aecb893e 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 eae90f5a46b8c7d28e9611417f9dfdc9aff52a22..86424a0a95067426affb7e3dc877a20e80f421a1 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 6ffa65103cf607ee32cd772797c76ca56b1fc06b..39815d32d14112a3a7e02bdb031162317fd15047 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 29d2f585a4f436ddbd1e71b5a2772f2adfcd399c..2d7ee8e1d8896a29f92126d0979804588327ecbc 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 e40f3542b5b85c0a04e3238825bd11fe52040a49..7dbac96e8c490ceaf33f970593d31104d863df54 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 93135070c3f70d4890f4fa1d72623bfb0bff3b79..424e0d3183fd7a67a3e334b0d576f04eaabf5f41 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 c36b9046db15192717b920f0f5c73dc8491827e0..789373b0855f0a536496791175afbfc808022a7d 100644 --- a/input/input.go +++ b/input/input.go @@ -193,6 +193,7 @@ const queryTemplate = `%s # # - status:open, status:closed # - author: +# - title: # - label:<label> # - no:label # From e825525a08f3370abd8c05802df09613c421fcb2 Mon Sep 17 00:00:00 2001 From: Sladyn <gunnerforlife00@gmail.com> Date: Fri, 1 Mar 2019 20:14:15 +0530 Subject: [PATCH 3/8] Fixed filter.go GolangCI complained about an if return else return statement which is fixed in this commit. --- cache/filter.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cache/filter.go b/cache/filter.go index a4254f2e562bbbf925e585e949d4c1603b3c2f9f..dc134260da06afd45367636fc16a9e121984a762 100644 --- a/cache/filter.go +++ b/cache/filter.go @@ -58,12 +58,8 @@ func LabelFilter(label string) Filter { // TitleFilter return a Filter that match a title func TitleFilter(title string) Filter { return func(excerpt *BugExcerpt) bool { - if strings.Contains(excerpt.Title, title) { - return true - } - return false + return strings.Contains(excerpt.Title, title) } - } // NoLabelFilter return a Filter that match the absence of labels From 0c42a7c33ef02cdb72b110b65e36e0e426c19359 Mon Sep 17 00:00:00 2001 From: Sladyn <gunnerforlife00@gmail.com> Date: Fri, 1 Mar 2019 20:37:19 +0530 Subject: [PATCH 4/8] Rectified Tests --- cache/query_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache/query_test.go b/cache/query_test.go index 2d7ee8e1d8896a29f92126d0979804588327ecbc..f34b3e6ad7fb8a3255a500a6a2dbbe06822adcd9 100644 --- a/cache/query_test.go +++ b/cache/query_test.go @@ -22,7 +22,7 @@ func TestQueryParse(t *testing.T) { {"label:hello", true}, {`label:"Good first issue"`, true}, - {"title:Bug titleOne", true}, + {"title:titleOne", true}, {`title:"Bug titleTwo"`, true}, {"sort:edit", true}, From f1d5ca4ff4e8f20f21e2cdc65fe854d6f9c16fee Mon Sep 17 00:00:00 2001 From: Sladyn <gunnerforlife00@gmail.com> Date: Sat, 2 Mar 2019 23:58:15 +0530 Subject: [PATCH 5/8] Rebased and updated. --- cache/bug_excerpt.go | 25 +++++++++++++++++++++---- cache/filter.go | 4 ++-- cache/repo_cache.go | 9 --------- commands/ls.go | 6 +----- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/cache/bug_excerpt.go b/cache/bug_excerpt.go index 86424a0a95067426affb7e3dc877a20e80f421a1..a50d8c66d1587a4218464a320e006a5a906daebc 100644 --- a/cache/bug_excerpt.go +++ b/cache/bug_excerpt.go @@ -23,11 +23,16 @@ type BugExcerpt struct { CreateUnixTime int64 EditUnixTime int64 - Title string Status bug.Status - Author identity.Interface - LenComments int Labels []bug.Label + Title string + LenComments int + + // 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 CreateMetadata map[string]string } @@ -45,13 +50,25 @@ func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) *BugExcerpt { EditLamportTime: b.EditLamportTime(), CreateUnixTime: b.FirstOp().GetUnixTime(), EditUnixTime: snap.LastEditUnix(), - Title: snap.Title, Status: snap.Status, Labels: snap.Labels, + Title: snap.Title, 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/filter.go b/cache/filter.go index dc134260da06afd45367636fc16a9e121984a762..a5aca8fbc0e1fc2388b1430765c8dcd113a95945 100644 --- a/cache/filter.go +++ b/cache/filter.go @@ -57,7 +57,7 @@ func LabelFilter(label string) Filter { // TitleFilter return a Filter that match a title func TitleFilter(title string) Filter { - return func(excerpt *BugExcerpt) bool { + return func(repo *RepoCache, excerpt *BugExcerpt) bool { return strings.Contains(excerpt.Title, title) } } @@ -96,7 +96,7 @@ func (f *Filters) Match(repoCache *RepoCache, excerpt *BugExcerpt) bool { return false } - if match := f.andMatch(f.Title, excerpt); !match { + if match := f.andMatch(f.Title, repoCache, excerpt); !match { return false } diff --git a/cache/repo_cache.go b/cache/repo_cache.go index fd5d086516a3ae3387351e430d4e9e2396531070..2b0fa360592cb71bc7d574f765c00290515508a0 100644 --- a/cache/repo_cache.go +++ b/cache/repo_cache.go @@ -386,15 +386,6 @@ func (c *RepoCache) ResolveBug(id string) (*BugCache, error) { return cached, nil } -// ResolveBugExcerpt retrieve a BugExcerpt matching the exact given id -func (c *RepoCache) ResolveBugExcerpt(id string) (*BugExcerpt, error) { - e, ok := c.excerpts[id] - if !ok { - return nil, bug.ErrBugNotExist - } - - return e, nil -} // ResolveBugExcerpt retrieve a BugExcerpt matching the exact given id func (c *RepoCache) ResolveBugExcerpt(id string) (*BugExcerpt, error) { diff --git a/commands/ls.go b/commands/ls.go index 7dbac96e8c490ceaf33f970593d31104d863df54..75819f1a733f7d098264b921954344d6575ad69e 100644 --- a/commands/ls.go +++ b/commands/ls.go @@ -52,14 +52,10 @@ func runLsBug(cmd *cobra.Command, args []string) error { // truncate + pad if needed titleFmt := fmt.Sprintf("%-50.50s", b.Title) - authorFmt := fmt.Sprintf("%-15.15s", b.Author.Name) + authorFmt := fmt.Sprintf("%-15.15s", b.LegacyAuthor.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), From 6fee8a44429339ba59004fc7506571b8876eae4a Mon Sep 17 00:00:00 2001 From: Sladyn <gunnerforlife00@gmail.com> Date: Sun, 3 Mar 2019 10:38:33 +0530 Subject: [PATCH 6/8] Commit to chane the description of function --- cache/filter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache/filter.go b/cache/filter.go index a5aca8fbc0e1fc2388b1430765c8dcd113a95945..fe6d200a08580f870e554c85871571c7e819cd6e 100644 --- a/cache/filter.go +++ b/cache/filter.go @@ -55,7 +55,7 @@ func LabelFilter(label string) Filter { } } -// TitleFilter return a Filter that match a title +// TitleFilter return a Filter that match if the title contains the given pattern func TitleFilter(title string) Filter { return func(repo *RepoCache, excerpt *BugExcerpt) bool { return strings.Contains(excerpt.Title, title) From 0e5550a27b7d9b8beb1418588ca5c9c12f4437c5 Mon Sep 17 00:00:00 2001 From: Sladyn <gunnerforlife00@gmail.com> Date: Sun, 3 Mar 2019 10:43:06 +0530 Subject: [PATCH 7/8] Fixed doc/queries.md --- doc/queries.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/queries.md b/doc/queries.md index 424e0d3183fd7a67a3e334b0d576f04eaabf5f41..224b59a0e32065b118eba422e77efdd81cc55c91 100644 --- a/doc/queries.md +++ b/doc/queries.md @@ -46,10 +46,10 @@ You can filter based on the bug's label. 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` | +| Qualifier | Example | +| --- | --- | +| `title:TITLE` | `title:Critical` matches bugs with a title containing `Critical` | +| | `title:"Typo in string"` matches bugs with a title containing `Typo in string` | ### Filtering by missing feature From 408654514ea813933f45d383d949611d138084e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= <batolettre@gmail.com> Date: Sun, 3 Mar 2019 15:23:20 +0100 Subject: [PATCH 8/8] cache: make the title filter case insensitive --- cache/filter.go | 9 ++++++--- cache/filter_test.go | 34 ++++++++++++++++++++++++++++++++++ doc/man/git-bug-ls.1 | 4 ++++ doc/md/git-bug_ls.md | 1 + misc/bash_completion/git-bug | 3 +++ 5 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 cache/filter_test.go diff --git a/cache/filter.go b/cache/filter.go index fe6d200a08580f870e554c85871571c7e819cd6e..b6872508c8d8418c9ae9cb00c740659e426e216a 100644 --- a/cache/filter.go +++ b/cache/filter.go @@ -55,10 +55,13 @@ func LabelFilter(label string) Filter { } } -// TitleFilter return a Filter that match if the title contains the given pattern -func TitleFilter(title string) Filter { +// TitleFilter return a Filter that match if the title contains the given query +func TitleFilter(query string) Filter { return func(repo *RepoCache, excerpt *BugExcerpt) bool { - return strings.Contains(excerpt.Title, title) + return strings.Contains( + strings.ToLower(excerpt.Title), + strings.ToLower(query), + ) } } diff --git a/cache/filter_test.go b/cache/filter_test.go new file mode 100644 index 0000000000000000000000000000000000000000..a47d2ad731f5dff308a844df5addb1bdf28ca6c3 --- /dev/null +++ b/cache/filter_test.go @@ -0,0 +1,34 @@ +package cache + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestTitleFilter(t *testing.T) { + tests := []struct { + name string + title string + query string + match bool + }{ + {name: "complete match", title: "hello world", query: "hello world", match: true}, + {name: "partial match", title: "hello world", query: "hello", match: true}, + {name: "no match", title: "hello world", query: "foo", match: false}, + {name: "cased title", title: "Hello World", query: "hello", match: true}, + {name: "cased query", title: "hello world", query: "Hello", match: true}, + + // Those following tests should work eventually but are left for a future iteration. + + // {name: "cased accents", title: "ÑOÑO", query: "ñoño", match: true}, + // {name: "natural language matching", title: "Århus", query: "Aarhus", match: true}, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + filter := TitleFilter(tt.query) + excerpt := &BugExcerpt{Title: tt.title} + assert.Equal(t, tt.match, filter(nil, excerpt)) + }) + } +} diff --git a/doc/man/git-bug-ls.1 b/doc/man/git-bug-ls.1 index eb985fd219ae98bfec832b331f12a09b41f8847a..7b3a0aa64b60c39ac031718380142008857bb244 100644 --- a/doc/man/git-bug-ls.1 +++ b/doc/man/git-bug-ls.1 @@ -34,6 +34,10 @@ You can pass an additional query to filter and order the list. This query can be \fB\-l\fP, \fB\-\-label\fP=[] Filter by label +.PP +\fB\-t\fP, \fB\-\-title\fP=[] + Filter by title + .PP \fB\-n\fP, \fB\-\-no\fP=[] Filter by absence of something. Valid values are [label] diff --git a/doc/md/git-bug_ls.md b/doc/md/git-bug_ls.md index 18ac5d61142ac7e82dd1b3cabbe138fe7691c300..9ab71884851250686d64f78338bce8a721451ca2 100644 --- a/doc/md/git-bug_ls.md +++ b/doc/md/git-bug_ls.md @@ -29,6 +29,7 @@ git bug ls --status closed --by creation -s, --status strings Filter by status. Valid values are [open,closed] -a, --author strings Filter by author -l, --label strings Filter by label + -t, --title strings Filter by title -n, --no strings Filter by absence of something. Valid values are [label] -b, --by string Sort the results by a characteristic. Valid values are [id,creation,edit] (default "creation") -d, --direction string Select the sorting direction. Valid values are [asc,desc] (default "asc") diff --git a/misc/bash_completion/git-bug b/misc/bash_completion/git-bug index a0ac545c17fb7569a7e949865251042a7011105d..ec8c64eafc568b24fa8e31512dbfdc05e74f5130 100644 --- a/misc/bash_completion/git-bug +++ b/misc/bash_completion/git-bug @@ -535,6 +535,9 @@ _git-bug_ls() flags+=("--label=") two_word_flags+=("-l") local_nonpersistent_flags+=("--label=") + flags+=("--title=") + two_word_flags+=("-t") + local_nonpersistent_flags+=("--title=") flags+=("--no=") two_word_flags+=("-n") local_nonpersistent_flags+=("--no=")