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

Re: Git hangs while executing commit-tree

From
David Greaves <david@dgreaves.com>
Date
Apr 20, 2005, 22:08 UTC
Message-ID
<4266D2D0.5000503@dgreaves.com>
In-Reply-To
<Pine.LNX.4.58.0504201446510.6467@ppc970.osdl.org>
Linus Torvalds wrote:
Show 23 quoted lines
> 
> On Wed, 20 Apr 2005, Rhys Hardwick wrote:
> 
>>rhys@metatron:~/repo/tmp.repo$ commit-tree  c80156fafbac377ab35beb076090c8320f874f91
>>Committing initial tree c80156fafbac377ab35beb076090c8320f874f91
>> 
>>At this point, the command seems to be just waiting.
> 
> 
> That's _exactly_ what it's doing. It's waiting for you to write a commit 
> message.
> 
> Something like
> 
> 	This is my initial commit of Hello World!
> 	^D
> 
> will make it happy.
> 
> Alternatively, you can certainly just write your message beforehand with 
> an editor and just pipe it into commit-tree.
> 
> 			Linus
When someone commits the docs I'll submit the next patch for the README:
commit-tree
	commit-tree <sha1> [-p <parent sha1>...] < changelog

Creates a new commit object based on the provided tree object and emits the new commit object id on stdout. If no parent is given then it is considered to be an initial tree.

A commit comment is read from stdin (max 999 chars)

A commit object usually has 1 parent (a commit after a change) or 2 parents (a merge) although there is no reason it cannot have more than 2 parents.

While a tree represents a particular directory state of a working directory, a commit represents that state in "time", and explains how to get there.

Normally a commit would identify a new "HEAD" state, and while git doesn't care where you save the note about that state, in practice we tend to just write the result to the file ".git/HEAD", so that we can always see what the last committed state was.

Options
<sha1>
	An existing tree object
-p <parent sha1>
	Each -p indicates a the id of a parent commit object.
	
Commit Information
A commit encapsulates:
	all parent object ids
	author name, email and date
	committer name and email and the commit time.
If not provided, commit-tree uses your name, hostname and domain to
provide author and committer info. This can be overridden using the
following environment variables.
	AUTHOR_NAME
	AUTHOR_EMAIL
	AUTHOR_DATE
	COMMIT_AUTHOR_NAME
	COMMIT_AUTHOR_EMAIL
(nb <,> and CRs are stripped)
see also: write-tree
David
Previous: Linus Torvalds
Message 4 of 4 in “Git hangs while executing commit-tree”
  1. Rhys HardwickApr 20, 2005
  2. Petr BaudisApr 20, 2005
  3. Linus TorvaldsApr 20, 2005
  4. David GreavesApr 20, 2005

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.