git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [bug?] git-format-patch produces a 0-byte long patch for the first commit

From
GLGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Date
Mar 24, 2009, 11:51 UTC
Message-ID
<Pine.LNX.4.64.0903241250140.4451@axis700.grange>
In-Reply-To
<alpine.DEB.1.00.0903241244380.7493@intel-tinevez-2-302>
On Tue, 24 Mar 2009, Johannes Schindelin wrote:
Show 33 quoted lines
> Hi,
> 
> On Tue, 24 Mar 2009, Guennadi Liakhovetski wrote:
> 
> > On Tue, 24 Mar 2009, Jeff King wrote:
> > 
> > > On Mon, Mar 23, 2009 at 11:34:07AM +0100, Guennadi Liakhovetski wrote:
> > > 
> > > > mkdir x
> > > > cd x
> > > > git-init
> > > > echo hi > greating
> > > > git-commit -a
> > > > git-format-patch -1
> > > > 
> > > > produces a 0-byte long patch. git-format-patch HEAD^ produces an 
> > > > error, whereas with more than one commit it produces tha last patch. 
> > > > Yes, I know about "--root" and that it does allow to extract the 
> > > > very first commit.
> > > 
> > > What version of git are you using? I believe the 0-byte diff has been 
> > > fixed since git 1.6.1.1.
> > 
> > Mine is still 1.5.4, if it's already fixed in the meantime - all the 
> > better!
> 
> There is the off-chance that somewhere in those 3127 commits between 
> v1.5.4 and v1.6.1.1, not only this bug is fixed.  You might be surprised 
> ;-)
> 
> Seriously again, in a project that moves as fast as Git, you should always 
> test with a recent version, and v1.5.1 -- being over one year old -- does 
> not account for recent.
Sorry, didn't mention, I also tested with 1.6.0.6 - still was there.

Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer

Previous: Johannes Schindelin
Message 8 of 8 in “[bug?] git-format-patch produces a 0-byte long patch for the first commit”
  1. Guennadi LiakhovetskiMar 23, 2009
  2. Thomas RastMar 23, 2009
  3. Guennadi LiakhovetskiMar 23, 2009
  4. Documentation: format-patch --root clarificationsThomas Rast, Mar 26, 2009
  5. Jeff KingMar 24, 2009
  6. Guennadi LiakhovetskiMar 24, 2009
  7. Johannes SchindelinMar 24, 2009
  8. Guennadi LiakhovetskiMar 24, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.