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

Re: git-am with an initial checkin doesn't work

From
DSDirk Süsserott <poststelle@suesserott.de>
Date
Jul 15, 2009, 14:46 UTC
Message-ID
<4A5DEBCC.9060600@suesserott.de>
In-Reply-To
<7vocrngm2d.fsf@alter.siamese.dyndns.org>
Am 14.07.2009 20:24 schrieb Junio C Hamano:
Show 33 quoted lines
> Dirk Süsserott <newsletter@dirk.my1.cc> writes:
> 
>> # Try to "import" the patch:
>> git am 0001-initial-checkin.patch
>>
>> The latter yields to
>> fatal: HEAD: not a valid SHA1
>> fatal: bad revision 'HEAD'
>>
>> It works, when I
>> git apply 0001-initial-checkin.patch
>> instead of am'ing it, but then the thing isn't committed and I've to
>> manually git-commit it.
>>
>> Is this a bug, intentional behavior, or am I missing some magic option
>> to git-am?
> 
> The original mode of operation of the e-mail patchflow commands was to
> support project members who contribute changes to _existing_ projects, and
> maintainers to accept such changes.  The reason behind the behaviour you
> are observing is merely a historical accident that nobody bothered about
> use cases outside of that original purpose.  For exactly the same reason,
> the original implementation of format-patch did not bother with the root
> commit.
> 
> IOW, this was not an intentional behaviour, neither it was a bug.  It was
> simply use outside of spec, and nobody bothered until f79d4c8 (git-am:
> teach git-am to apply a patch to an unborn branch, 2009-04-10), which is
> v1.6.3-rc1~11^2, added a support for it.
> 
> What version of git are you running?
> 
> 
Hi Junio,

I used "1.6.1.9.g97c34" which is an msysGit release and not exactly the latest. I now updated to "1.6.3.2.1299.gee46c" and the problem dissapeared. Thanks for the hint and sorry for the noise.

     -- Dirk
Previous: Junio C Hamano
Message 3 of 3 in “git-am with an initial checkin doesn't work”
  1. Dirk SüsserottJul 14, 2009
  2. Junio C HamanoJul 14, 2009
  3. Dirk SüsserottJul 15, 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.