https://github.com/hugginsio/git-view-work-item
Open your current work item in your browser using the current branch.
https://github.com/hugginsio/git-view-work-item
git git-addons
Last synced: about 1 year ago
JSON representation
Open your current work item in your browser using the current branch.
- Host: GitHub
- URL: https://github.com/hugginsio/git-view-work-item
- Owner: hugginsio
- License: bsd-2-clause
- Created: 2023-10-16T23:42:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-03T03:19:26.000Z (over 2 years ago)
- Last Synced: 2025-01-29T22:46:20.415Z (about 1 year ago)
- Topics: git, git-addons
- Language: Go
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# git-view-work-item
Git add-on for opening work item details in your browser based on the current branch. You can also print the JSON properties to `stdout` for integration with other workflows.
It uses a regular expression to extract a work item identifier from the current branch name and inserts it into a URL via Go text templates.
You can configure the add-on's behavior through Git properties. See the following example:
```gitconfig
[git-view-work-item]
url = "https://dev.azure.com/org/project/_workitems/edit/{{ .Identifier }}"
regex = "[0-9]+"
```
The following properties are available for you to insert into the URL:
- `Directory`: the current directory name (but not the full path).
- `Identifier`: the identifier extracted from the current branch name.
- `Repository`: the repository name, taken from `remote.origin.url`.
- `Url`: the URL of the repository, taken from `remote.origin.url`.
You can learn more about Go text templates in the [package documentation][go-text-templates].
## Installation
### Homebrew
```
brew install hugginsio/tap/git-vwi
```
### Manual installation
1. Navigate to the [releases page][github-releases] and download the appropriate binary for your system.
2. Copy the `git-vwi` binary to somewhere on your PATH.
3. Run `git vwi -h` in your terminal to validate.
### Building from source
1. Install the latest version of [Go][go-install].
2. Install the latest version of [Task][task-install].
3. Clone the repository.
4. Run `task install`.
[go-text-templates]: https://pkg.go.dev/text/template
[github-releases]: https://github.com/hugginsio/git-view-work-item/releases
[go-install]: https://go.dev/dl/
[task-install]: https://taskfile.dev/installation/