hexojs / hexojs/hexo-deployer-git
[Feature]: Change default deploy commit message to use ISO 8601 date format instead of locale-dependent format
- Dominant language
- JavaScript
- Stars
- 588
- Forks
- 120
- PR merge metrics
- No merged PRs in 30d
Description
### Check List
- [x] I have already read [Docs page](https://hexo.io/docs/).
- [x] I have already searched existing issues.
### Feature Request
### 描述
在非英语系统(如中文 Windows)上使用 hexo-deployer-git 时,默认的部署提交信息 `Site updated: {{ now() }}` 会生成类似以下格式的输出:
```
Site updated: YYYY-06-2026年6月28日 16:43:39
```
这是因为 `{{ now() }}` 默认返回本地化的日期字符串,其中:
- `YYYY` 作为字面量原样输出(模板解析问题)
- 日期部分使用了系统区域语言(如中文的「2026年6月28日」)
### 痛点
- **新用户困惑**:看到提交信息出现乱码/混合格式,第一反应是以为自己配置错了,但实际上这是插件默认行为
- **国际标准缺失**:作为一个全球使用的工具,默认不应依赖系统区域设置
- **不一致**:对于团队协作或 CI/CD 场景,不同开发者机器上生成的提交信息格式不同
### 建议方案
将默认的 `message` 配置改为 ISO 8601 标准格式:
```yaml
deploy:
type: git
message: Site updated: {{ now("YYYY-MM-DD HH:mm:ss") }}
```
这样在所有系统上都会统一输出:
```
Site updated: 2026-06-28 16:43:39
```
### 兼容性
- 只影响**首次使用且未自定义 `message` 字段**的新用户
- 已有项目的用户不受影响(因为他们已经有自定义配置或现有的提交记录)
- 这是一个低风险、高收益的改进
### Others
### 参考
实际受影响的输出示例(中文 Windows 11):
```
[master 102c386] Site updated: YYYY-06-2026年6月28日 16:43:39
```
如果改为 ISO 8601 格式后的期望输出:
```
[master 1234567] Site updated: 2026-06-28 16:43:39
```
相关配置文档显示现有实现中通过 `message` 字段支持 `{{ now() }}` 模板函数,已有自定义格式的能力,只是默认值需要优化。
Contributor guide
No contributing guide indexed for this repository
Research direction
Search the repository for the default `Site updated: {{ now() }}` message and the `message` configuration handling. Confirm the default produces the requested `YYYY-MM-DD HH:mm:ss` output across locales, while existing custom message formats remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, javascript
- Domain
- devops
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100