Re: serious problem with `git format-patch' & `git am'
- From
Brandon Casey <casey@nrlssc.navy.mil>
- Date
- Feb 26, 2009, 18:00 UTC
- Message-ID
- <6HVVE8kW9V0CsNfW21a_Tqpt2s-IrJbt2_qdAvQ8r1tetEhb6jr18g@cipher.nrlssc.navy.mil>
- In-Reply-To
- <20090225.230352.177616203.wl@gnu.org>
Werner LEMBERG wrote:
Show 48 quoted lines
> [both version 1.6.0.2 and git from 2009-01-24] > > Folks, > > > I'm going to convert the FreeType CVS repository to git, using Keith > Packard's `parsecvs'. It sometimes happens that there are git entries > titled > > *** empty log message *** > > I want to massage the git repository before publishing it, replacing > those entries with something more meaningful. > > The last time I tested this (using git 1.5.something, I no longer > remember the exact version) I did the following: > > . git format-patch <start>..HEAD > git reset --hard <start> > > . Edit the `Subject:' field in the created *.patch files where > necessary. > > . git am --whitespace=nowarn *.patch > > Unfortunately, this no longer works as before, and since I can't find > a hint in the docs about this change I wonder whether it is a bug. > > With git 1.5.something, if the first paragraph of the commit message > (as output by parsecvs) looks like this > > foo foo foo foo > bar bar bar bar > baz baz baz baz > > it is emitted exactly as-is (after `git format-patch' & `git am'); > gitk shows `foo foo foo foo' as the first line. However, git version > 1.6.0.2 and the current git both convert newlines to spaces in the > first paragraph! I now get > > foo foo foo foo bar bar bar bar baz baz baz baz > > as the beginning of the commit message which is VERY bad since > CVS-style entries often have a long first paragraph, causing > ugly-looking, overlong lines. > > In case this is an intended change I ask you urgently to provide an > option to get back the old behaviour of `git format-patch' & `git am'.
I was not aware of this behavior, but it looks like the '-k' option for both format-patch and git-am is what you want to use. It will prevent mailinfo from munging the commit message.
-brandon