{"thread":{"id":"43650","subject":"Re: git-commit: select which files to commit while editing the commit message","startedAt":"2006-12-08T12:36:31Z","lastAt":"2006-12-09T07:02:45Z","messageCount":3,"participants":["Junio C Hamano","Pazu","Sean"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"297108","messageId":"loom.20061208T131919-178@post.gmane.org","threadId":"43650","inReplyTo":null,"subject":"git-commit: select which files to commit while editing the commit message","fromName":"Pazu","fromEmail":"pazu@pazu.com.br","sentAt":"2006-12-08T12:36:31Z","receivedAt":"2006-12-08T12:36:31Z","isPatch":false,"sender":{"key":"pazu@pazu.com.br","avatar":null},"body":"Junio's reworking of the git-commit documentation, and the ensuing discussion\nabout what is commited, and how do you select that, made me remember how much I\nliked SVK -- particularly, how much I liked to remove files from the commit\nmessage template, and have them removed from the commit.\n\nAt first, I thought \"great opportunity to contribute my first patch to git\",\nuntil I realized that git-commit is written in bash, and my brain refuses to\nunderstand that. Yep, I'm that bad. So I'm writing this, and maybe someone\nwell-versed in bash will find this a good idea and code it :-)\n\nFor those not familiar with SVK, if you remove the files mentioned in the commit\ntemplate (that \"here are the files that you're about to commit\" part), SVK won't\ncommit them. For example, if I modify a couple of files in git, and execute 'git\ncommit -a', an editor will popup showing something like this:\n\n# Please enter the commit message for your changes.\n# (Comment lines starting with '#' will not be included)\n# On branch refs/heads/next\n# Updated but not checked in:\n#   (will commit)\n#\n#\tmodified:   perl/Makefile\n#\tmodified:   var.c\n\nHere's where the magic would happen. Removing the line \"modified: var.c\" would\nremove var.c from this commit. Of course, the template message should be\nmodified to tell the user he can do that.\n\nSo, what do you think about this?\n\n-- Pazu\n"},{"id":"296320","messageId":"7vpsaui4cn.fsf@assigned-by-dhcp.cox.net","threadId":"43650","inReplyTo":"loom.20061208T131919-178@post.gmane.org","subject":"Re: git-commit: select which files to commit while editing the commit message","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-12-08T19:18:16Z","receivedAt":"2006-12-08T19:18:16Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pazu <pazu@pazu.com.br> writes:\n\n> # Please enter the commit message for your changes.\n> # (Comment lines starting with '#' will not be included)\n> # On branch refs/heads/next\n> # Updated but not checked in:\n> #   (will commit)\n> #\n> #\tmodified:   perl/Makefile\n> #\tmodified:   var.c\n>\n> Here's where the magic would happen. Removing the line \"modified: var.c\" would\n> remove var.c from this commit. Of course, the template message should be\n> modified to tell the user he can do that.\n>\n> So, what do you think about this?\n\nPersonally, I would refuse to use such a modified git, because\noften the first thing I would do in the commit log buffer is\ncheck the listed files and remove the '# ...' lines while\ntyping.  I do not want that to affect the set of changes I\nstaged in any way.\n\nBut maybe that is just me.\n"},{"id":"298068","messageId":"BAYC1-PASMTP1040BEA204693E211075F0AED20@CEZ.ICE","threadId":"43650","inReplyTo":"7vpsaui4cn.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-commit: select which files to commit while editing the commit message","fromName":"Sean","fromEmail":"seanlkml@sympatico.ca","sentAt":"2006-12-09T07:02:45Z","receivedAt":"2006-12-09T07:02:45Z","isPatch":false,"sender":{"key":"seanlkml@sympatico.ca","avatar":"https://gravatar.com/avatar/f92923f54fc08c401fc59b71829d4b89e9b8087fbba45ff87c82e6a83aee02ae?d=mp&s=160"},"body":"On Fri, 08 Dec 2006 11:18:16 -0800\nJunio C Hamano <junkio@cox.net> wrote:\n\n> Personally, I would refuse to use such a modified git, because\n> often the first thing I would do in the commit log buffer is\n> check the listed files and remove the '# ...' lines while\n> typing.  I do not want that to affect the set of changes I\n> staged in any way.\n\nYour usage should not affected at all by the addition of this\nfeature.  One of the comment lines could be magic, in that if\nit is missing the feature is disabled.  Something like:\n\n#  *** Editable Commit List ***\n\nOr some such at the top of the list, where if it is missing after\ncommit message editing, the post processing of the file list\nwill be completely disabled.  Another alternative would be to\njust enable the feature with an  -A  or some other commit command\nline option, so that those uninterested in such a feature don't\nhave to even see it.\n\nIt would be interesting to hear from Pasky on how this feature\nhas worked out in practice for Cogito users and whether he thinks\nit would be a good addition to Git.\n\n"}]}