Commit Graph

293 Commits

Author SHA1 Message Date
Michael Muré
271dc1334c
commands: proper backend close on RunE error 2021-05-09 11:33:20 +02:00
Sascha
1939949fcd
CLI: Add non-interactive option to interactive commands (#651)
* Add option to skip the AvatarURL input request

Using an empty string for the avatar cli flag e.g. `git-bug user create
-a ""` will still result in a prompt. As the avatar URL is an optional
option, it should be possible to skip asking for it entirely.
Otherwise automated user creation via a script must make use of pipe hacks.

* Add global --non-interactive cmdline option

* Replace --skipAvatar for --non-interactive option

* Cmd BugAdd: respect non-interactive option

* Cmd bridge configure: respect non-interactive opt

* Cmd CommentAdd: respect non-interactive option

* Cmd CommentEdit: respect non-interactive option

* Cmd TermUI: respect non-interactive option

* Cmd TitleEdit: respect non-interactive option

* Remove global non-interactive option

* Cmd UserCreate: Use local non-interactive option

* Cmd BugAdd: Use local non-interactive option

* Cmd BridgeConfigure: Use local non-interactive option

* Cmd CommentAdd: Use local non-interactive option

* Cmd CommentEdit: Use local non-interactive option

* Cmd TermUI: Drop non-interactive option

It should be obviouse that the termui is an interactive command.

* Cmd TitleEdit: Use local non-interactive option

* Update docs

* Bridge GitHub: respect non-interactive option

* Bridge GitLab: respect non-interactive option

* Bridge Jira: respect non-interactive and token opt

* Fix failing compilation

* Bridge launchpad: respect non-interactive option

* bridge: isNonInteractive --> interactive

Co-authored-by: Michael Muré <batolettre@gmail.com>
2021-05-09 11:14:45 +02:00
Hariharan
bc96f316ff
CLI - allow user create without prompt (#650)
* CLI - allow user create without prompt. Fixes #577

* Update commands/user_create.go email message

Co-authored-by: Michael Muré <batolettre@gmail.com>

* Update docs

Co-authored-by: Michael Muré <batolettre@gmail.com>
2021-04-25 16:46:36 +02:00
Michael Muré
51a2c85954
make sure every text input is safe and validated
fix #630
2021-04-17 17:40:11 +02:00
Michael Muré
aa0449a3ea
Merge remote-tracking branch 'origin/master' into dag-entity 2021-03-29 11:02:08 +02:00
Michael Muré
3a819525d7
commands: minor fixes for the webui open with query
- go fmt
- add a shorthand
- fix displayed webUI URL in the terminal
2021-03-07 21:44:48 +01:00
Miklos Vajna
626ec9835b webui: allow specifying the initial query
Example use-case: given a github URL in a source code comment or commit
message, one can now run:

git bug webui --query 'metadata:github-url:"https://github.com/author/myproject/issues/42"'

on the commandline to look up the details of that issue on the web ui
quickly, offline.

Fixes <https://github.com/MichaelMure/git-bug/issues/592>.
2021-03-07 14:11:04 +01:00
Sascha
ea329aed69 Add option to specify host address
'--host'-cmdline-option is added to the webui command.

Previously, the WebUI couldn't be hosted inside of a container. As the
WebUI-server only listend per default to localhost and there was no
option to change the address, the server should listend to. This means,
that the WebUI was only reachable from localhost. So only from inside of
the container but never from outside.
The '--host'-option allows to set the IP address or a hostname
which the WebUI-server should listen to. E.g. by setting 0.0.0.0 or ::
as address.

Update documentation for new option.

Update shell completion for new option.

Compilation seems to add another go-gitlab version.
2021-02-28 21:20:15 +01:00
Miklos Vajna
cb61245078 Add ability to search by arbitrary metadata
Example:

~/git/git-bug/git-bug ls --metadata github-url=https://github.com/author/myproject/issues/42

or

~/git/git-bug/git-bug ls metadata:github-url:\"https://github.com/author/myproject/issues/42\"

Fixes the cmdline part of <https://github.com/MichaelMure/git-bug/issues/567>.
2021-02-21 14:15:50 +01:00
Michael Muré
bb8a214df3
command: fix "comment edit" usage 2021-02-14 12:17:49 +01:00
vince
d96284da64
Change the comment ID to use both bug and comment ID references.
Add comment edit command
This commit adds the comment edit command, which provides a CLI tool that allows a user to edit a comment.
2021-02-14 12:17:48 +01:00
Michael Muré
ab57d74a31
deal with the previous changes 2021-02-14 12:17:47 +01:00
Michael Muré
c884d557bf
repo: move bleve there 2020-12-08 14:42:13 +01:00
Michael Muré
4ef2c11040
repo: finish RepoStorage move 2020-12-08 13:07:51 +01:00
Mike Goldin
ee3841155e
Update docs for full text search 2020-11-17 08:32:19 -05:00
Michael Muré
9bea84e232
ls: fix query quotation 2020-11-17 08:09:51 -05:00
Michael Muré
499dbc0a03
identity: remove support for legacy identity 2020-10-04 20:50:15 +02:00
Michael Muré
1a0c86a12d
repo: use go-git in more places, fix push 2020-10-04 19:56:16 +02:00
Michael Muré
02146f0b40 use go-git by default! 2020-09-29 20:43:53 +02:00
Michael Muré
71b7eb1401 repo: implement local/global/any config everywhere 2020-09-29 20:42:21 +02:00
Michael Muré
148b335dd3
command: match the output in ls and in the termui 2020-09-27 21:30:13 +02:00
Zdenek Crha
999e61224c Fix 'no description' readability in terminal with bright background
The rendering of color for 'No description provided' text is broken on
bright terminals - it sets black background which together with default
black forground color renders opaque rectangle.

The GreyBold color alias is broken too - name suggests bold gray
forground color, but actually sets bold default fg color with black
bacground.

First make color alias consistent. Rename it to BlackBold and have it
set bold black fg color (same as similar *Bold aliases).

Second, update all places which use it to render text to also use white
background to prevent it from disappering in terminals with black
background color.
2020-09-27 09:22:34 +02:00
Michael Muré
ae5c0967ce commands: cleanup the command's usage to avoid warnings when generating the doc 2020-07-28 20:24:24 +02:00
vince
6e315ea131
Update docs 2020-07-28 14:30:07 +02:00
vince
4e5f377d75
Remove need to specify remote
This commit makes the removeBug command use the listRefs repo command to search for the bug, eliminating the need to input the remote the bug came from.
2020-07-28 14:30:06 +02:00
vince
9436cf4b89
Move args parsing out of repo cache 2020-07-28 14:30:06 +02:00
vince
4e4ca106ae
Allow user to delete remote bugs 2020-07-28 14:30:05 +02:00
vince
36f300cb35
Add the 'rm' command
This commit adds a command that removes a bug from the repository, given a prefix.
2020-07-28 14:30:05 +02:00
Michael Muré
b4158dbd9e
Merge pull request #427 from wavexx/trim_titles
Trim titles in list views
2020-07-14 19:21:45 +02:00
Michael Muré
5c823a7024
ls: minor code improvements 2020-07-14 19:13:46 +02:00
Yuri D'Elia
54d4307a2e Trim titles in list views 2020-07-13 13:14:47 +02:00
Dima Gerasimov
efe6ea3371 ls --format org-mode enhancements
- fix and align OPEN/CLOSED states
- fix org-mode links format
- santize tags (org-mode only allows _ and @ as special characters)
- format datetimes as org-mode
2020-07-12 17:58:15 +01:00
Michael Muré
71989045c9 commands: fix segfault with badly loaded backend 2020-07-07 20:15:22 +02:00
Michael Muré
536c290dfb
commands: open and close the backend in a single place, simplify commands 2020-06-28 19:09:32 +02:00
Michael Muré
26bd1dd110
commands: refactor to avoid globals 2020-06-28 18:26:29 +02:00
Michael Muré
2ab6381a94
Reorganize the webUI and API code
Included in the changes:
- create a new /api root package to hold all API code, migrate /graphql in there
- git API handlers all use the cache instead of the repo directly
- git API handlers are now tested
- git API handlers now require a "repo" mux parameter
- lots of untangling of API/handlers/middleware
- less code in commands/webui.go
2020-06-27 23:03:05 +02:00
Luke Granger-Brown
5f72b04ef8
Use ErrNotAuthenticated 2020-06-27 23:01:10 +02:00
Luke Granger-Brown
e5a316e40c
Pull out context-stuff from identity into graphqlidentity package 2020-06-27 23:01:09 +02:00
Luke Granger-Brown
766aff2b2f
Change graphql Go handlers to pluck identity out of context instead. 2020-06-27 22:58:22 +02:00
Luke Granger-Brown
dfdb5e090b
Verify that we have an identity only in read-write mode 2020-06-27 22:56:11 +02:00
Luke Granger-Brown
43c78da02e
Don't permit file uploads in read-only mode 2020-06-27 22:56:11 +02:00
Luke Granger-Brown
4a28f25347
Add support for read-only mode for web UI.
Fixes #402.
2020-06-27 22:56:10 +02:00
Michael Muré
88ad7e606f
repository: remove tie to Bug, improved and reusable testing
- allow the creation of arbitrary Lamport clocks, freeing the way to new entities and removing Bug specific (upper layer) code.
- generalize the memory-only and persisted Lamport clocks behind a common interface
- rework the tests to provide reusable testing code for a Repo, a Clock, a Config, opening a path to add a new Repo implementation more easily
- test previously untested components with those new tests

Note: one problem found during this endeavor is that `identity.Version` also need to store one time + Lamport time for each other Entity (Bug, config, PR ...). This could possibly done without breaking change but it would be much easier to wait for https://github.com/MichaelMure/git-bug-migration to happen.
2020-06-26 19:14:22 +02:00
Michael Muré
aab3a04d0c
bug: harmonize how time are used, fix some issues in command special formats
This assume that the convertion from time.Time <--> Unix timestamp is lossless which seems to be.
2020-06-25 23:18:17 +02:00
Michael Muré
1d06244c82
cmds: cleanup and re-generate files 2020-06-24 15:10:57 +02:00
vince
ebd1030cde Fix bugs
This fixes some bugs experienced when using the new formatting options:
- org-mode indents not working properly
- print statements missing contents
2020-06-24 14:34:36 +08:00
vince
8eb004b405 Clean up code and fix suggestions 2020-06-24 10:22:32 +08:00
vince
fc3f6540b8 Add org-mode formatting option
This adds an option to the formatting flag on the ls, show and user ls commands that allows the user to specify the format of the output in org-mode. This will be useful for emacs users to read it in the editor.
2020-06-23 17:51:42 +08:00
vince
cd8352edde Add output formatting support to the 'show' and 'user ls' commands
This adds options to specify an output format for the commands in question. Supported formats are currently:
- 'plain': plaintext, stripped of all colors
- 'json': prints output as a json object
2020-06-21 13:51:48 +08:00
Vincent Tiu
f790083fb2
Merge pull request #403 from MichaelMure/ls-dump
[ls] add support for different output formats
2020-06-18 20:37:00 +08:00