dalnix/report

Dalnix 内部计费脚本

v1.2.8 2023-02-22 10:59 UTC

This package is auto-updated.

Last update: 2024-09-25 14:40:58 UTC


README

用于通过 Git 提交报告时间的 Artisan 命令。

安装

您可以通过 composer 安装此包

composer require dalnix/report

使用方法

将 BILLING_ENDPOINT 和 BILLING_TOKEN 添加到您的 .env 文件,并运行

php artisan dalnix:report

或者如果您想通过管道从 STDIN 发送提交。只需提供一系列哈希值。使用 git log 您可以过滤各种内容;也许您只跟踪合并提交中的时间,那么解析所有提交就毫无意义。

git log --format="%H" | php artisan dalnix:report --pipe

常见问题解答

我不使用 Composer,或者我的项目不是 Laravel 基础的

使用在 bin/report.php 中找到的遗留版本。如果您想发送,请将 env 中的 BILLING_ENDPOINTBILLING_TOKEN 应用相同的规则。否则,只需运行它。

php bin/report.php

我应该如何格式化我的提交信息?

在您的提交信息中添加单个 "时间码"。例如

Add a time consuming worm

Applying this commit will add a worm that lives on Time. Took one and a
half day to complete. Don't really know why I only made one commit. But
hey; living on the edge!

[2d4h33m]

如何使用它取决于您。也许您按每小时开始计费;没关系,只需使用 "hour" 标签,即 [4h] 并跳过分钟。或者仅使用分钟,[550m] 来展示您的数学技能。

如何获取适合解析的提交列表?

git log --format="%H %ai %ae %f"

如何列出特定提交哈希之后的提交(仅哈希)?

git rev-list <hash>^..HEAD

致谢

许可协议

MIT 许可协议(MIT)。有关更多信息,请参阅许可文件