答案是我可以将元数据添加到 git 提交吗?或者我可以在 gitk 中隐藏一些标签吗 https://stackoverflow.com/questions/2683248/can-i-add-metadata-to-git-commits-or-can-i-hide-some-tags-in-gitk提到 git Notes 作为将元数据添加到 git 提交的一种方式。
如果我想添加其他类型的注释,git 注释可能会利用其名称空间功能,这是对提交进行分类的最佳方式吗?例如,我想将提交分类为“重构”、“更改功能”、“错误修复”、“错误引入”,并且能够要求 git 仅列出某些类别中的提交。
您所提议的内容与基于红宝石的宝石“升级” https://github.com/kawamanza/step-up正在做,基于git notes
.
的伟大目标this Gem http://rubygems.org/gems/step-up为开发人员提供了一种管理这些笔记的简单方法。
通过记录所有相关进展的文化,除了指定将检索哪种信息之外,还可以检索一系列版本的摘要。
例如,假设您希望查看应用程序中自版本 v1.10.1 到 v2.0.0 以来实现的所有功能
stepup notes --since v1.10.1 upto v2.0.0 --sections pre_deploy pos_deploy
结果将类似于以下内容:
Showing notes since v1.10.1 up to v2.0.0 (including notes of tags: v1.10.1, v1.10.2, v1.51.0, v2.0.0)
---
Pre-Deploy:
- dependency of version v10 of project XYZ
- it needed to rename the following file
- config/environment_variables.yml.sample -> config/environment_variables.yml
- rake articles:index
Pos-Deploy:
- Reindex articles
- rake articles:index
- rake db:seed
- rake categories:reload
ranged_notes.rb https://github.com/kawamanza/step-up/blob/master/lib/step-up/ranged_notes.rb将根据他们的注释定义函数来获取所有相关的提交。
git.rb https://github.com/kawamanza/step-up/blob/master/lib/step-up/driver/git.rb包含实际的git notes
命令。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)