From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Subject: Re: Handling commit change logs Date: Wed, 20 Aug 2014 14:30:12 -0600 Message-ID: <53F50554.3050505@wwwdotorg.org> References: <1408419205-10048-1-git-send-email-tuomas.tynkkynen@iki.fi> <1408419205-10048-14-git-send-email-tuomas.tynkkynen@iki.fi> <53F3A900.8010805@nvidia.com> <53F4FED4.7060408@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from avon.wwwdotorg.org ([70.85.31.133]:59316 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751823AbaHTU3y (ORCPT ); Wed, 20 Aug 2014 16:29:54 -0400 In-Reply-To: <53F4FED4.7060408@suse.de> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= , Javier Martinez Canillas Cc: "devicetree@vger.kernel.org" , Prashant Gaikwad , Mike Turquette , Vince Hsu , "linux-pm@vger.kernel.org" , Viresh Kumar , Peter De Schrijver , "Rafael J. Wysocki" , Linux Kernel Mailing List , Tuomas Tynkkynen , Thierry Reding , Tuomas Tynkkynen , Paul Walmsley , "linux-tegra@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" On 08/20/2014 02:02 PM, Andreas F=C3=A4rber wrote: > Hi Javier, > > Am 20.08.2014 17:39, schrieb Javier Martinez Canillas: >> As you already know when you apply a patch with git am, everything >> that is between a line with 3 dashes line (---) and the actual diff = is >> omitted since that is where the generated diffstat is placed by git >> format-patch. >> >> We usually rely on that behavior to put there the history of a patch >> or any information that we think that is useful for reviewers but is >> not suitable to end in the commit message. Now that means that you >> have to generate the patch and then manually edit it to add the >> history there. >> >> But since git am omits any text between the first "---" and the diff= , >> it means that you can add a "---" on your actual commit message and >> anything that follows will be discarded by git am, that way you can >> maintain your history on your commit message which is way less tedio= us >> than manually editing patches. >> >> So the second "---" from Tuomas patch is actually the one generated = by >> git format-patch but that gets discarded by git am just like any oth= er >> text so it causes no harm when other apply the patches. >> >> If this not the correct workflow and you have a better way to manage >> this, I would love to know about it. > > One drawback of having --- in the commit message is that you can't > cherry-pick but really need to use git-am for it to be stripped. You can, you just have to either: * Pass -e to git cherry-pick so you get to edit the patch description, * Run "git commit --amend" right afterwards, =2E.. and then delete everything starting at ---. I do this reasonably often on my own patches; I send them to the list,=20 get them reviewed, and then cherry-pick them into the Tegra maintainer=20 tree rather than saving them from the email client and running git am. From mboxrd@z Thu Jan 1 00:00:00 1970 From: swarren@wwwdotorg.org (Stephen Warren) Date: Wed, 20 Aug 2014 14:30:12 -0600 Subject: Handling commit change logs In-Reply-To: <53F4FED4.7060408@suse.de> References: <1408419205-10048-1-git-send-email-tuomas.tynkkynen@iki.fi> <1408419205-10048-14-git-send-email-tuomas.tynkkynen@iki.fi> <53F3A900.8010805@nvidia.com> <53F4FED4.7060408@suse.de> Message-ID: <53F50554.3050505@wwwdotorg.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 08/20/2014 02:02 PM, Andreas F?rber wrote: > Hi Javier, > > Am 20.08.2014 17:39, schrieb Javier Martinez Canillas: >> As you already know when you apply a patch with git am, everything >> that is between a line with 3 dashes line (---) and the actual diff is >> omitted since that is where the generated diffstat is placed by git >> format-patch. >> >> We usually rely on that behavior to put there the history of a patch >> or any information that we think that is useful for reviewers but is >> not suitable to end in the commit message. Now that means that you >> have to generate the patch and then manually edit it to add the >> history there. >> >> But since git am omits any text between the first "---" and the diff, >> it means that you can add a "---" on your actual commit message and >> anything that follows will be discarded by git am, that way you can >> maintain your history on your commit message which is way less tedious >> than manually editing patches. >> >> So the second "---" from Tuomas patch is actually the one generated by >> git format-patch but that gets discarded by git am just like any other >> text so it causes no harm when other apply the patches. >> >> If this not the correct workflow and you have a better way to manage >> this, I would love to know about it. > > One drawback of having --- in the commit message is that you can't > cherry-pick but really need to use git-am for it to be stripped. You can, you just have to either: * Pass -e to git cherry-pick so you get to edit the patch description, * Run "git commit --amend" right afterwards, ... and then delete everything starting at ---. I do this reasonably often on my own patches; I send them to the list, get them reviewed, and then cherry-pick them into the Tegra maintainer tree rather than saving them from the email client and running git am.