{"id":107868,"date":"2023-02-22T12:02:02","date_gmt":"2023-02-22T03:02:02","guid":{"rendered":"https:\/\/softantenna.com\/blog\/?p=107868"},"modified":"2023-02-22T12:02:02","modified_gmt":"2023-02-22T03:02:02","slug":"linus-torvalds-git-merge-advice","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/linus-torvalds-git-merge-advice\/","title":{"rendered":"Linus Torvalds\u6c0f\u3001Git\u306e\u30de\u30fc\u30b8\u306b\u95a2\u3057\u300c\u30de\u30fc\u30b8\u306b\u3064\u3044\u3066\u8aac\u660e\u3067\u304d\u306a\u3044\u306e\u306a\u3089\u3084\u3089\u306a\u3044\u307b\u3046\u304c\u3044\u3044\u300d\u30b4\u30df\u3060\u304b\u3089\u3068\u30a2\u30c9\u30d0\u30a4\u30b9"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2023\/02\/s_20230222_114750.jpg\" alt=\"S 20230222 114750\" title=\"s_20230222_114750.jpg\" border=\"0\" width=\"860\" height=\"560\" \/><\/p>\n<p>Linux\u304a\u3088\u3073Git\u3092\u958b\u767a\u3057\u305fLinus Torvalds\u6c0f\u304c\u3001Git\u306e\u30de\u30fc\u30b8\u306b\u95a2\u3057\u3066\u76f4\u3005\u306b\u30a2\u30c9\u30d0\u30a4\u30b9\u3057\u3066\u3044\u305f\u4e8b\u304c\u308f\u304b\u308a\u3001\u6ce8\u76ee\u3092\u96c6\u3081\u3066\u3044\u307e\u3059(<a href=\"https:\/\/www.phoronix.com\/news\/Linus-Torvalds-Git-Merge-Wisdom\">Phoronix<\/a>)\u3002<\/p>\n<p>Linus Torvalds\u6c0f\u306eGit\u30de\u30fc\u30b8\u306b\u95a2\u3059\u308b\u5b9f\u8df5\u7684\u306a\u30a2\u30c9\u30d0\u30a4\u30b9\u306f\u300c\u3082\u3057\u30de\u30fc\u30b8\u306e\u3053\u3068\u3092\u8aac\u660e\u3067\u304d\u306a\u3044\u306e\u306a\u3089\u3001\u3084\u3089\u306a\u3044\u3053\u3068\u3060\u3002\u3053\u308c\u306f\u672c\u5f53\u306b\u7c21\u5358\u306a\u3053\u3068\u3067\u3059\u3002\u30de\u30fc\u30b8\u306e\u7406\u7531\u3092\u8aac\u660e\u3057\u306a\u3044\u307e\u307e\u30de\u30fc\u30b8\u3059\u308b\u3053\u3068\u306f\u7d76\u5bfe\u306b\u8a31\u3055\u308c\u306a\u3044\u300d\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>Linus\u6c0f\u306f\u30de\u30fc\u30b8\u306b\u5bfe\u3059\u308b\u30b3\u30e1\u30f3\u30c8\u304c\u5341\u5206\u306b\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u30d7\u30eb\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u767a\u898b\u3057\u3001\u6211\u6162\u306e\u9650\u754c\u3092\u7a81\u7834\u3057\u305f\u306e\u304b\u3001<a href=\"https:\/\/lore.kernel.org\/lkml\/CAHk-=wgw++ccN-Pd1npZsBSDD3z6EGUSKsWuAEh5YC-TmfJAug@mail.gmail.com\/\">LKML<\/a>\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6295\u7a3f\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<blockquote>\n<p>So I've pulled this, but while looking at it, I see commit 5c0f220e1b2d (\"Merge branch 'for-linus\/hardening' into for-next\/hardening\").<\/p>\n<p>\u3067\u3001\u3053\u308c\u3092\u5f15\u3063\u5f35\u3063\u3066\u304d\u305f\u306e\u3067\u3059\u304c\u3001\u898b\u3066\u3044\u308b\u3068\u30b3\u30df\u30c3\u30c8 5c0f220e1b2d (\"Merge branch 'for-linus\/hardening' into for-next\/hardening\") \u304c\u51fa\u3066\u304d\u307e\u3059\u306d\u3002<\/p>\n<p>And that one-liner shortlog part is literally the whole commit message.<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u306e\u4e00\u884c\u3060\u3051\u306e\u30b7\u30e7\u30fc\u30c8\u30ed\u30b0\u90e8\u5206\u304c\u6587\u5b57\u901a\u308a\u30b3\u30df\u30c3\u30c8\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u5168\u3066\u3067\u3059\u3002<\/p>\n<p>I've said this before, and apparently I need to say this again: if you cannot be bothered to explain *WHY* a merge exists, then that merge is buggy garbage by definition.<\/p>\n<p>\u4ee5\u524d\u306b\u3082\u8a00\u3044\u307e\u3057\u305f\u304c\u3001\u3069\u3046\u3084\u3089\u3082\u3046\u4e00\u5ea6\u8a00\u3046\u5fc5\u8981\u304c\u3042\u308a\u305d\u3046\u3067\u3059\u3002\u30de\u30fc\u30b8\u304c\u5b58\u5728\u3059\u308b*WHY*\u3092\u8aac\u660e\u3059\u308b\u306e\u304c\u9762\u5012\u306a\u3089\u3001\u305d\u306e\u30de\u30fc\u30b8\u306f\u5b9a\u7fa9\u4e0a\u30d0\u30b0\u306e\u591a\u3044\u30b4\u30df\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>This really should be a rule that every single developer should take to heart. I'm not just putting random words together in a random order.<\/p>\n<p>\u3053\u308c\u306f\u672c\u5f53\u306b\u3001\u3059\u3079\u3066\u306e\u958b\u767a\u8005\u304c\u5fc3\u306b\u523b\u3080\u3079\u304d\u30eb\u30fc\u30eb\u3067\u3059\u3002\u9069\u5f53\u306b\u8a00\u8449\u3092\u4e26\u3079\u3066\u3044\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>I repeat: if you cannot explain a merge, then JUST DON'T DO IT.<\/p>\n<p>\u7e70\u308a\u8fd4\u3057\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u3082\u3057\u30de\u30fc\u30b8\u3092\u8aac\u660e\u3067\u304d\u306a\u3044\u306e\u306a\u3089\u3001\u3084\u3089\u306a\u3044\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>It's really that simple. There is absolutely *NEVER* an excuse for merges without explaining why those merges exist.<\/p>\n<p>\u3082\u3057\u30de\u30fc\u30b8\u306e\u3053\u3068\u3092\u8aac\u660e\u3067\u304d\u306a\u3044\u306e\u306a\u3089\u3001\u3084\u3089\u306a\u3044\u3053\u3068\u3060\u3002\u3053\u308c\u306f\u672c\u5f53\u306b\u7c21\u5358\u306a\u3053\u3068\u3067\u3059\u3002\u30de\u30fc\u30b8\u306e\u7406\u7531\u3092\u8aac\u660e\u3057\u306a\u3044\u307e\u307e\u30de\u30fc\u30b8\u3059\u308b\u3053\u3068\u306f\u7d76\u5bfe\u306b\u8a31\u3055\u308c\u306a\u3044\u3002<\/p>\n<p>In this case, I really think that merge should not have existed at all, and the lack of explanation is because there *IS* no explanation for it.<\/p>\n<p>\u3053\u306e\u5834\u5408\u3001\u79c1\u306f\u305d\u306e\u30de\u30fc\u30b8\u306f\u5b58\u5728\u3059\u3079\u304d\u3067\u306f\u306a\u304b\u3063\u305f\u3068\u601d\u3044\u307e\u3059\u3057\u3001\u8aac\u660e\u304c\u306a\u3044\u306e\u306f\u3001\u305d\u306e\u305f\u3081\u306e\u8aac\u660e\u304c\u306a\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>But if there was a reason for it, then just state it, dammit, and make that merge commit look sensible.<\/p>\n<p>\u3057\u304b\u3057\u3001\u3082\u3057\u305d\u306e\u7406\u7531\u304c\u3042\u308b\u306e\u306a\u3089\u3001\u305d\u308c\u3092\u8ff0\u3079\u3066\u3001\u305d\u306e\u30de\u30fc\u30b8\u30b3\u30df\u30c3\u30c8\u304c\u7406\u306b\u304b\u306a\u3063\u305f\u3082\u306e\u306b\u898b\u3048\u308b\u3088\u3046\u306b\u3059\u308c\u3070\u3044\u3044\u306e\u3067\u3059\u3002<\/p>\n<p>Because right now it just looks entirely pointless. And I literally *detest* pointless merges. They only make the history look worse and harder to read.<\/p>\n<p>\u306a\u305c\u306a\u3089\u3001\u4eca\u306f\u307e\u3063\u305f\u304f\u7121\u610f\u5473\u306b\u898b\u3048\u308b\u304b\u3089\u3067\u3059\u3002\u305d\u3057\u3066\u3001\u79c1\u306f\u6587\u5b57\u901a\u308a\u7121\u610f\u5473\u306a\u30de\u30fc\u30b8\u3092\u5426\u5b9a\u3057\u307e\u3059\u3002\u305d\u308c\u3089\u306f\u5c65\u6b74\u3092\u60aa\u304f\u3057\u3001\u8aad\u307f\u306b\u304f\u304f\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<\/blockquote>\n<p>\u3082\u3068\u3082\u3068Git\u306fLinus\u6c0f\u304cLinux\u958b\u767a\u306e\u305f\u3081\u306b\u4f5c\u6210\u3057\u305f\u5206\u6563\u578b\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3067\u3059\u3002\u4f5c\u8005\u304cGit\u306e\u30de\u30fc\u30b8\u3092\u3069\u306e\u3088\u3046\u306b\u8003\u3048\u3066\u3044\u308b\u306e\u304b\u304c\u5206\u304b\u308b\u8cb4\u91cd\u306a\u60c5\u5831\u3060\u3068\u3044\u3048\u305d\u3046\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u304a\u3088\u3073Git\u3092\u958b\u767a\u3057\u305fLinus Torvalds\u6c0f\u304c\u3001Git\u306e\u30de\u30fc\u30b8\u306b\u95a2\u3057\u3066\u76f4\u3005\u306b\u30a2\u30c9\u30d0\u30a4\u30b9\u3057\u3066\u3044\u305f\u4e8b\u304c\u308f\u304b\u308a\u3001\u6ce8\u76ee\u3092\u96c6\u3081\u3066\u3044\u307e\u3059(Phoronix)\u3002 Linus Torvalds\u6c0f\u306eGit\u30de\u30fc\u30b8\u306b\u95a2\u3059\u308b\u5b9f [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":107869,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[37],"class_list":["post-107868","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-linux"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/107868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=107868"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/107868\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/107869"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=107868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=107868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=107868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}