git是否记录了将类别样式信息添加到提交的预期方式? [英] Is git notes the intended way to add category-style information to a commit?

查看:87
本文介绍了git是否记录了将类别样式信息添加到提交的预期方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以向git提交添加元数据吗?或者我可以在gitk中隐藏一些标签提及git笔记作为向git commit添加元数据的一种方式。

The answer to Can I add metadata to git commits? Or can I hide some tags in gitk mentions git notes as a way to add metadata to a git commit.

是git笔记,可能是利用它的优势命名空间功能,以防我想添加其他类型的笔记,最好的方式来分类提交?例如,我想将提交分为重构,更改功能,错误修复,bug引入,并且可以让git列出某些类别的提交。 / p>

Is git notes, possibly taking advantage of its namespace functionality in case I want to add other types of notes, the best way to categorize commits? For example, I'd like to categorize commits into "refactoring", "change-functionality", "bug-fix", "bug-introduce", and be able to ask git to only list commits that are in certain categories.

推荐答案

您提出的建议与 ruby​​-based gemstep-up正在做,基于 git notes

What you are proposing is quite similar to what the ruby-based gem "step-up" is doing, based on git notes.


这只宝石的伟大目标为开发人员提供了一种简单的方式来管理这些笔记。

The great goal of this Gem is giving to developers an easy way to manage these notes.

以一种注意所有相关发展的文化,它可以检索除此之外的一系列版本的摘要指定将检索哪种类型的信息。

例如,想象一下,自从版本v1.10.1至v2.0.0之后,您希望看到应用程序中实现的所有功能。

With a culture of notating all the relevant developments, its possible to retrieve a summary of a range of versions besides that specifying what kind of information will be retrieved.
For example, imagine that you want to see all the features implemented in your application since the version v1.10.1 up to v2.0.0



stepup notes --since v1.10.1 upto v2.0.0 --sections pre_deploy pos_deploy




结果如下:

The result would be something like the following:



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 将定义函数以根据其笔记获取所有相关的提交。

git.rb 包含实际的 git notes 命令。

这篇关于git是否记录了将类别样式信息添加到提交的预期方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆