{"id":534,"date":"2015-11-02T11:46:11","date_gmt":"2015-11-02T11:46:11","guid":{"rendered":"http:\/\/blogs.gentoo.org\/lu_zero\/?p=534"},"modified":"2015-11-02T11:46:48","modified_gmt":"2015-11-02T11:46:48","slug":"tags-in-git","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/lu_zero\/2015\/11\/02\/tags-in-git\/","title":{"rendered":"Tags in git"},"content":{"rendered":"<p><a href=\"https:\/\/blogs.gentoo.org\/lu_zero\/tag\/mini-post\/\">mini-post<\/a> about using tags in git commits.<\/p>\n<h2>Tags<\/h2>\n<p>In git a commit message is structured in a first <code>subject<\/code> line, an empty newline and more text making the <code>body<\/code> of the message.<\/p>\n<p>The subject can be split in two components <code>tags<\/code> and the actual <code>subject<\/code>.<\/p>\n<pre><code class=\"git-message\">tag1: tag2: Commit Subject\n\nA body with more information spanning\nmultiple lines.\n<\/code><\/pre>\n<p>The tags can be used to pin the general <strong>area<\/strong> the patch is impacting, e.g:<\/p>\n<pre><code>ui: Change widget foo\n\n<\/code><\/pre>\n<h2>Usage<\/h2>\n<p>When you are looking at the history using <code>git log<\/code> having tags helps a lot digging out old commits, for example: you remember some commit added some timeout system in something related to the component <code>foo<\/code>.<\/p>\n<pre><code>git log --oneline | grep foo:\n<\/code><\/pre>\n<p>Would help figuring out the commit.<\/p>\n<p>This usage is the best when working with not well structured codebase, since alternatively you can do<\/p>\n<pre><code>git log --oneline module\/component\n<\/code><\/pre>\n<p>If you use separate directories for each module and component within the module.<\/p>\n<p><strong>PS:<\/strong> This is one of the reasons <a href=\"https:\/\/github.org\/lu-zero\/plaid\">plaid<\/a> focuses a lot on tags and I complain a lot when tags are not used.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mini-post about using tags in git commits. Tags In git a commit message is structured in a first subject line, an empty newline and more text making the body of the message. The subject can be split in two components tags and the actual subject. tag1: tag2: Commit Subject A body with more information spanning &hellip; <a href=\"https:\/\/blogs.gentoo.org\/lu_zero\/2015\/11\/02\/tags-in-git\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Tags in git<\/span><\/a><\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[17],"tags":[22,20],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1aGWH-8C","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/534"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/comments?post=534"}],"version-history":[{"count":2,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/534\/revisions"}],"predecessor-version":[{"id":536,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/534\/revisions\/536"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/media?parent=534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/categories?post=534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/tags?post=534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}