Help us shape the future of Go! Take the 2026 Go Developer Survey

git-desc

command module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

README

git-desc

これはgit branch --edit-descriptionなどでブランチに説明を追加するコマンドの代わりとなるCLIツールです。

Environment

現状、macのみしか動作しません。

Install

brew tap miyazi777/gitdesc
brew install miyazi777/gitdesc/gitdesc

or

go get github.com/miyazi777/gitdesc

Usage

現在のブランチに説明を追加

以下のコマンドで環境変数$EDITORに設定されているエディタが起動し、編集したテキストが現在のブランチの説明になります。

gitdesc set

また、-mオプションを付けることでエディタを起動せず、説明を設定できます。

gitdesc set -m "branch description"
現在のブランチの説明と関連するwebページのURLを表示
gitdesc info
全ブランチの説明を表示
gitdesc list

また、--only-listオプションを付けることでリストのみを表示します。

現在のブランチに関連するwebページを登録

以下のコマンドで環境変数$EDITORに設定されているエディタが起動し、編集したテキストが現在のブランチの関連ページとなります。

gitdesc page set

また、-mオプションを付けることでエディタを起動せず、webページを設定できます。

gitdesc page set -m "web page url"
現在のブランチに関連するwebページをブラウザで開く
gitdesc page open
現在のブランチの説明と関連するwebページを削除

以下のコマンドで現在のブランチの説明と関連webページに関する情報を削除します。

gitdesc delete

config

$HOME/.config/git-desc/config.yamlに設定ファイルを置くと、コマンド実行時にそこから設定を読み込み、設定に沿った動きをします。 設定内容は以下のとおりです。

キー 内容
editor set, page setコマンドを実行した時に起動するエディタ
設定例
editor: nvim

fzfとの連携例

ブランチの移動

fzfを使用しているのであれば、以下のようなスクリプトを.bashrcや.zshrcに記述することでブランチを確認しながら、移動することができます。 以下のスクリプトではターミナルでblと打ち込むとこのツールのlistからブランチを選択し、移動することが出来ます。

# git desc setting
bl() {
  branches=$(gitdesc list --only-list) &&
  select_line=$(echo "$branches" | fzf +m)
  git checkout $(echo ${select_line} | cut -d" " -f 1)
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
git

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL