{"thread":{"id":"6524","subject":"How to change merge message (\"weenie commits\")","startedAt":"2007-01-25T15:56:33Z","lastAt":"2007-01-26T23:24:45Z","messageCount":8,"participants":["Bill Lear","Santi Béjar","J. Bruce Fields","Seth Falcon","Karl Hasselström","Junio C Hamano","Jakub Narebski","Robin Rosenberg"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"32611","messageId":"17848.54065.631799.755255@lisa.zopyra.com","threadId":"6524","inReplyTo":null,"subject":"How to change merge message (\"weenie commits\")","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-01-25T15:56:33Z","receivedAt":"2007-01-25T15:56:33Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"I have developed a habit of using my SCM to provide local backup of my\ndaily (hourly) work.  I often will work to a stopping point and commit\nmy work, without any real coherence to the commit --- a sort of\ncheckpoint.  These I call \"weenie commits\" because they are weenie-ish,\nunimportant in the larger scheme of things.\n\nWhen developing with others, I would like to be able to work in this\nway, tidily keeping my stuff tucked away in my SCM system, and then\nwhen I am ready to share, to convey to my peers what they need to\nknow about my work, and not the 10,000 weenie commit messages that\nmay be associated with my work.\n\nSo, when I merge my topic branch onto master, for example, I'd like\nthe commit message to be something more thoughtful than the\n\"checkpoint 1\", \"checkpoint 2\", \"fix typo\", \"redo sort algorithm\",\netc., etc., and be more like a short set of release notes, a summary\nof what all has been accomplished.\n\nDo others run into this and perhaps have a good solution?\n\n\nBill\n"},{"id":"32612","messageId":"8aa486160701250805y1b4fa78bj96fd7a137089824d@mail.gmail.com","threadId":"6524","inReplyTo":"17848.54065.631799.755255@lisa.zopyra.com","subject":"Re: How to change merge message (\"weenie commits\")","fromName":"Santi Béjar","fromEmail":"sbejar@gmail.com","sentAt":"2007-01-25T16:05:46Z","receivedAt":"2007-01-25T16:05:46Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On 1/25/07, Bill Lear <rael@zopyra.com> wrote:\n> So, when I merge my topic branch onto master, for example, I'd like\n> the commit message to be something more thoughtful than the\n> \"checkpoint 1\", \"checkpoint 2\", \"fix typo\", \"redo sort algorithm\",\n> etc., etc., and be more like a short set of release notes, a summary\n> of what all has been accomplished.\n\nI think the --no-commit flag to git-merge/git-pull (man git-pull) is\nwhat you are looking for, or a git commit --amend.\n\nSanti\n"},{"id":"32613","messageId":"20070125160714.GA6358@fieldses.org","threadId":"6524","inReplyTo":"17848.54065.631799.755255@lisa.zopyra.com","subject":"Re: How to change merge message (\"weenie commits\")","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2007-01-25T16:07:14Z","receivedAt":"2007-01-25T16:07:14Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Thu, Jan 25, 2007 at 09:56:33AM -0600, Bill Lear wrote:\n> I have developed a habit of using my SCM to provide local backup of my\n> daily (hourly) work.  I often will work to a stopping point and commit\n> my work, without any real coherence to the commit --- a sort of\n> checkpoint.  These I call \"weenie commits\" because they are weenie-ish,\n> unimportant in the larger scheme of things.\n> \n> When developing with others, I would like to be able to work in this\n> way, tidily keeping my stuff tucked away in my SCM system, and then\n> when I am ready to share, to convey to my peers what they need to\n> know about my work, and not the 10,000 weenie commit messages that\n> may be associated with my work.\n> \n> So, when I merge my topic branch onto master, for example, I'd like\n> the commit message to be something more thoughtful than the\n> \"checkpoint 1\", \"checkpoint 2\", \"fix typo\", \"redo sort algorithm\",\n> etc., etc., and be more like a short set of release notes, a summary\n> of what all has been accomplished.\n> \n> Do others run into this and perhaps have a good solution?\n\nI tend to do something vaguely like:\n\n\tgit checkout -b dirtywork origin\n\nThen make a bunch of commits as you describe above--poorly commented,\nnot necessarily logically split up, etc.--then when it's ready,\n\n\tgit checkout -b cleanwork origin\n\tgit diff cleanwork..dirtywork\n\nExamine the diff, figure out which change should go logically first,\napply that one change and commit, and then again run\n\n\tgit diff cleanwork..dirtywork\n\nRepeat until the diff is empty (except maybe for a few improvements I\nnoticed as I went along).  Then finally\n\n\tgit push publicrepo cleanwork:master\n\tgit branch -D dirtywork\n\nOr something like that.\n\n--b.\n"},{"id":"32614","messageId":"m2veiv9jbp.fsf@ziti.local","threadId":"6524","inReplyTo":"17848.54065.631799.755255@lisa.zopyra.com","subject":"Re: How to change merge message (\"weenie commits\")","fromName":"Seth Falcon","fromEmail":"sethfalcon@gmail.com","sentAt":"2007-01-25T16:12:26Z","receivedAt":"2007-01-25T16:12:26Z","isPatch":false,"sender":{"key":"sethfalcon@gmail.com","avatar":"https://gravatar.com/avatar/fd62fe73d3013b12fce71d5269ec52eaca3c4cee479efc6eea3603d6f1d8bf8d?d=mp&s=160"},"body":"Bill Lear <rael@zopyra.com> writes:\n> So, when I merge my topic branch onto master, for example, I'd like\n> the commit message to be something more thoughtful than the\n> \"checkpoint 1\", \"checkpoint 2\", \"fix typo\", \"redo sort algorithm\",\n> etc., etc., and be more like a short set of release notes, a summary\n> of what all has been accomplished.\n>\n> Do others run into this and perhaps have a good solution?\n\nSuppose you do your daily work on branch weenie, then one way would\nbe:\n\n  git format-patch -k master..weenie\n  git checkout master\n  git apply 00*.patch\n  ## review, then git add and git commit where you would write a long\n  ## commit message.\n\nOne nice thing about this workflow is that you can easily decide if\nyou want one single commit or a few commits to group logical groups of\nthe patch files.\n\n+ seth\n"},{"id":"32616","messageId":"20070125161609.GA7453@diana.vm.bytemark.co.uk","threadId":"6524","inReplyTo":"17848.54065.631799.755255@lisa.zopyra.com","subject":"Re: How to change merge message (\"weenie commits\")","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2007-01-25T16:16:09Z","receivedAt":"2007-01-25T16:16:09Z","isPatch":false,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2007-01-25 09:56:33 -0600, Bill Lear wrote:\n\n> Do others run into this and perhaps have a good solution?\n\nI make lots of small commits, then periodically rewrite history with\nStGIT to get the nice-looking set of commits I wish I had made in the\nfirst place. I don't think I do anything that couldn't be done with\njust git, but StGIT is made precisely for this kind of work, and is\nquite good at it.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"32654","messageId":"7v1wli90q0.fsf@assigned-by-dhcp.cox.net","threadId":"6524","inReplyTo":"17848.54065.631799.755255@lisa.zopyra.com","subject":"Re: How to change merge message (\"weenie commits\")","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-25T22:54:15Z","receivedAt":"2007-01-25T22:54:15Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Bill Lear <rael@zopyra.com> writes:\n\n> I have developed a habit of using my SCM to provide local backup of my\n> daily (hourly) work.  I often will work to a stopping point and commit\n> my work, without any real coherence to the commit --- a sort of\n> checkpoint.  These I call \"weenie commits\" because they are weenie-ish,\n> unimportant in the larger scheme of things.\n>\n> When developing with others, I would like to be able to work in this\n> way, tidily keeping my stuff tucked away in my SCM system, and then\n> when I am ready to share, to convey to my peers what they need to\n> know about my work, and not the 10,000 weenie commit messages that\n> may be associated with my work.\n>\n> So, when I merge my topic branch onto master, for example, I'd like\n> the commit message to be something more thoughtful than the\n> \"checkpoint 1\", \"checkpoint 2\", \"fix typo\", \"redo sort algorithm\",\n> etc., etc., and be more like a short set of release notes, a summary\n> of what all has been accomplished.\n\nYour message is titled as if it is about changing \"merge\nmessage\", but to clean-up history you would want to fix the\ncommit boundary as well if your commits are \"without any real\ncoherence\".\n\nWhich means that you need to first rebuild the topic branch to\nmake it presentable before merging.\n\nIf all the work done in the weenie commits chain is really a\nsingle logical change in the bigger picture, then the answer is\nvery simple: \"git merge --squash\".  It's not a merge, but is to\nprepare your working tree to create a single commit for public\nconsumption, and after committing you can (and probably should,\nin order to avoid confusing yourself) discard the branch with\nweenie commits.\n\nOtherwise, what I often do myself is to export them as format-patch\noutput, sift and reorder bits to make them coherent chunks and\nrebuild the series.  It would go something like this:\n\n\t$ git checkout topic\n\t$ git format-patch master\n\t0001-snapshot-1.patch\n\t0002-snapshot-2.patch\n\t0003-snapshot-3.patch\n\t$ edit 00??-*.patch\n\t..\tI come up with a fixed series which most likely\n        ..\thave different number of patch files.\n        $ git checkout -b rebuilt topic~3 ;# go back to where I forked\n        $ git am 0*-.patch.fixed\n\t$ git diff topic\n        ..\tThis should match where I started, except I\n\t..\tmight have made small fix-ups while coming up\n\t..\twith the *-patch.fixed series which should show up.\n\t$ test test test\n\n        $ git branch -f topic\n\t$ git branch -d rebuilt\n\t..\tNow the topic is cleaned-up so it is ready to be merged.\n\t..\twe do not need the 'rebuilt' branch anymore.\n\n        $ git checkout master\n        $ git merge topic\n\nI would also do \"git rebase master\" while on the \"rebuilt\"\nbranch, because it is not a significant fact that I started my\nwork on 'topic' at a particular commit in the past.\n"},{"id":"32731","messageId":"epctjl$vrv$1@sea.gmane.org","threadId":"6524","inReplyTo":"20070125161609.GA7453@diana.vm.bytemark.co.uk","subject":"Re: How to change merge message (\"weenie commits\")","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-01-26T12:54:17Z","receivedAt":"2007-01-26T12:54:17Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Karl Hasselström wrote:\n\n> On 2007-01-25 09:56:33 -0600, Bill Lear wrote:\n> \n>> Do others run into this and perhaps have a good solution?\n> \n> I make lots of small commits, then periodically rewrite history with\n> StGIT to get the nice-looking set of commits I wish I had made in the\n> first place. I don't think I do anything that couldn't be done with\n> just git, but StGIT is made precisely for this kind of work, and is\n> quite good at it.\n\nIf you want to use only core git, \"git cherry-pick\" (with or without\n--no-commit option), \"git commit --amend\" and \"git merge --squash\"\n(and probably \"git rebase --onto\") are your friends. You can also\ndo \"git format-patch\", edit/reorder patches and then \"git am --3way\"\nor \"git apply\".\n\nBut StGIT is made for this work. I use it to reorder commits, to\namend commit deeper in the history, to split and join commits (although\nit is more work, at least with version I use). If you have branch which\nis currently not managed by StGIT, \"stg init\" and then use \"stg uncommit\".\nI frequently use \"stg uncommit\" and \"stg pop\"/\"stg push\" to add commit\nin the middle of branch.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"32778","messageId":"200701270024.46116.robin.rosenberg.lists@dewire.com","threadId":"6524","inReplyTo":"17848.54065.631799.755255@lisa.zopyra.com","subject":"Re: How to change merge message (\"weenie commits\")","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-01-26T23:24:45Z","receivedAt":"2007-01-26T23:24:45Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"torsdag 25 januari 2007 16:56 skrev Bill Lear:\n> So, when I merge my topic branch onto master, for example, I'd like\n> the commit message to be something more thoughtful than the\n> \"checkpoint 1\", \"checkpoint 2\", \"fix typo\", \"redo sort algorithm\",\n> etc., etc., and be more like a short set of release notes, a summary\n> of what all has been accomplished.\n>\n> Do others run into this and perhaps have a good solution?\n\nI agree with Karl. Stacked Git is the tool. It doesn't help in splitting \nmuliple changes to one file so you have to do that manually with e.g. emacs.\n\n-- robin\n"}]}