Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPROTEIN_GIT_REPOSITORY配下だけでなく、その親ディレクトリも含めてgitレポジトリを探索するように修正 #37

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

Penpen7
Copy link
Contributor

@Penpen7 Penpen7 commented Nov 5, 2024

現状、環境変数のPPROTEIN_GIT_REPOSITORY(デフォルト値はカレントディレクトリ.)で指定されたディレクトリ内に.gitがないか探索するようになっていますが、
カレントディレクトリ内だけではなく、その親ディレクトリも辿って.gitがないか探索した方が良いかなと思い修正しました。

大抵/home/isuconでgit initされるかと思いますが、アプリケーションが実行されるカレントディレクトリ(=PPROTEIN_GIT_REPOSITORYのデフォルト値)は/home/isucon/src/webapp/golangのように階層が掘られるため、PPROTEIN_GIT_REPOSITORYを/home/isuconに修正しないとgitのコミットハッシュを取得できません。
そこで親ディレクトリも含めて探索するようにすれば.gitを見つけることができるため、環境変数を追加する手間が減るかと思われます。

PPROTEIN_GIT_REPOSITORYがデフォルト値の場合のみ親ディレクトリも辿るオプションを入れるでも良いかもしれませんが、一旦常にONにするように修正しています

@Penpen7 Penpen7 changed the title search git repository not only in specified directory but also in par… PPROTEIN_GIT_REPOSITORY配下だけでなく、その親ディレクトリも含めてgitレポジトリを探索するように修正 Nov 5, 2024
Copy link
Owner

@kaz kaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます!助かります 🙏

@kaz kaz merged commit 6c12aea into kaz:master Nov 7, 2024
@kaz
Copy link
Owner

kaz commented Nov 7, 2024

リリースしました 🚀 https://github.com/kaz/pprotein/releases/tag/v1.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants