3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

gitbucket-commitgraphs-plugin導入

Last updated at Posted at 2015-10-17

gitbucket-commitgraphs-plugin

This plugin enhances takezoe/gitbucket by providing an viewing commit graphs.

yoshiyoshifujii/gitbucket-commitgraphs-plugin
GitBucket Pluginでコミット件数をグラフ表示してくれるやつを作りました - Qiita

インストール

環境

  • OS : Windows7
  • GitBucket : 3.7
  • AppServer : Tomcat7.0
  • JVM : 1.8.0_51-b16

ビルド

  1. GitHubからgitbucket-commitgraphs-pluginをクローン
  2. Proxy環境のためsbt.batを編集
  3. コマンドプロンプトでsbt packageを実行し、しばらく待つ
  4. gitbucket-commitgraphs-plugin\target\scala-2.11gitbucket-commitgraphs-plugin_2.11-1.0.jarができているはず

プロキシ用オプション

sbt.bat
set SCRIPT_DIR=%~dp0
- java -Dsbt.log.noformat=true -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss2M -jar "%SCRIPT_DIR%\sbt-launch-0.13.5.jar" %*
+ java -Dhttp.proxyHost=<HostName> -Dhttp.proxyPort=<PortNumber> -Dsbt.log.noformat=true -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss2M -jar "%SCRIPT_DIR%\sbt-launch-0.13.5.jar" %*

インストール

  1. gitbucket-commitgraphs-plugin_2.11-1.0.jarGITBUCKET_HOME\pluginsに移す
  2. GitBucketを再起動

Cannot run program "git" の対処

gitbucket-commitgraphs-pluginではjGitを使っている部分とgitコマンドを使っている部分がある。
gitにパスを通していないと以下のエラーが発生する。

java.io.IOException: Cannot run program "git" (in directory "<リポジトリのパス>"): CreateProcess error=2, 指定されたファイルが見つかりません。
	at java.lang.ProcessBuilder.start(Unknown Source)
	at scala.sys.process.ProcessBuilderImpl$Simple.run(ProcessBuilderImpl.scala:69)
	at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.lineStream(ProcessBuilderImpl.scala:141)
	at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.lineStream_$bang(ProcessBuilderImpl.scala:109)
	at me.huzi.gitbucket.commitgraphs.controller.CommitGraphsControllerBase$$anonfun$1$$anonfun$apply$1$$anonfun$apply$2$$anonfun$2.apply(CommitGraphsController.scala:30)
	at me.huzi.gitbucket.commitgraphs.controller.CommitGraphsControllerBase$$anonfun$1$$anonfun$apply$1$$anonfun$apply$2$$anonfun$2.apply(CommitGraphsController.scala:28)
...

該当箇所

val p = Process.apply(Seq("git", "log", "-n", "1", "--numstat", """--pretty="%H"""", "--source", rev.getId.name), git.getRepository.getDirectory)
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?