{"thread":{"id":"25146","subject":"Adding a commit message to the index","startedAt":"2010-09-18T22:38:04Z","lastAt":"2010-09-19T13:38:32Z","messageCount":4,"participants":["Cameron Hutchison","Joshua Juran","Ævar Arnfjörð Bjarmason","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"150974","messageId":"3347.4c955dd6.4a79e@getafix.xdna.net","threadId":"25146","inReplyTo":null,"subject":"Adding a commit message to the index","fromName":"Cameron Hutchison","fromEmail":"lists@xdna.net","sentAt":null,"receivedAt":"2010-09-18T22:38:04Z","isPatch":false,"sender":{"key":"lists@xdna.net","avatar":null},"body":"Is it possible to add a commit message to the index, and have it used as\nthe final commit message, or as the template for the final commit\nmessage?\n\nWitnessing AKPM's ongoing efforts on linux-kernel to get better commit\nmessages out of people, it seems it would be beneficial to be able to\nstage a commit message and refine it over the course of the development\nof the commit. The first cut is rarely the best, so being able to refine\na commit message as one can refine a commit by incrementally using the\nindex seems like a good idea.\n\nI know I can use git-commit -F and store my commit message outside of\ngit, but it would be nice to have it in the index with the code it\ncomments on. That would make the commit and the message stay together\nwith git-stash for example. Apply this to other index-modifying\noperations too.\n"},{"id":"150977","messageId":"7AA1261F-8DDD-4599-9A11-753334634DB2@gmail.com","threadId":"25146","inReplyTo":"3347.4c955dd6.4a79e@getafix.xdna.net","subject":"Re: Adding a commit message to the index","fromName":"Joshua Juran","fromEmail":"jjuran@gmail.com","sentAt":"2010-09-19T01:29:01Z","receivedAt":"2010-09-19T01:29:01Z","isPatch":false,"sender":{"key":"jjuran@gmail.com","avatar":null},"body":"On Sep 18, 2010, at 5:48 PM, Cameron Hutchison wrote:\n\n> Is it possible to add a commit message to the index, and have it  \n> used as\n> the final commit message, or as the template for the final commit\n> message?\n>\n> Witnessing AKPM's ongoing efforts on linux-kernel to get better commit\n> messages out of people, it seems it would be beneficial to be able to\n> stage a commit message and refine it over the course of the  \n> development\n> of the commit. The first cut is rarely the best, so being able to  \n> refine\n> a commit message as one can refine a commit by incrementally using the\n> index seems like a good idea.\n\nOne of the reasons for having a local repo is so you can check in work  \nin progress without committing it to public history.\n\nIf you're ready to write a commit message, then make a commit.  You  \ncan refine it incrementally with `git commit --amend`.\n\nAlso, consider making multiple fine-grained commits, and then use  \ninteractive rebase to squash them into fewer larger commits (and edit  \ncommit messages) as appropriate.  It's a lot easier to squash fine  \ncommits than to split course ones.\n\nTo summarize:  Commit first, answer questions later.\n\nJosh\n"},{"id":"150987","messageId":"AANLkTinbgTx=ihy82zPRvsv-WvdeEPt0fX+arCQaKnUr@mail.gmail.com","threadId":"25146","inReplyTo":"3347.4c955dd6.4a79e@getafix.xdna.net","subject":"Re: Adding a commit message to the index","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-19T12:19:59Z","receivedAt":"2010-09-19T12:19:59Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Sun, Sep 19, 2010 at 00:48, Cameron Hutchison <lists@xdna.net> wrote:\n> Is it possible to add a commit message to the index, and have it used as\n> the final commit message, or as the template for the final commit\n> message?\n\nWhat Joshua suggests is better, but you can abuse git-commit by\nwriting a commit message to e.g. .git/MERGE_MSG, then the message will\nbe used at the next 'git commit'.\n\nBut just commiting /now/ and squashing/rebasing later is a much better\nworkflow.\n"},{"id":"150990","messageId":"m362y1luqg.fsf@localhost.localdomain","threadId":"25146","inReplyTo":"3347.4c955dd6.4a79e@getafix.xdna.net","subject":"Re: Adding a commit message to the index","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-09-19T13:38:32Z","receivedAt":"2010-09-19T13:38:32Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Cameron Hutchison <lists@xdna.net> writes:\n\n> Is it possible to add a commit message to the index, and have it used as\n> the final commit message, or as the template for the final commit\n> message?\n[...]\n\nWhy not use commit message templates?\n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"}]}