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

Re: Help requested - trying to build a tool doing whole-tree commits

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Nov 10, 2012, 19:24 UTC
Message-ID
<CAMP44s2NzPw+GYKk5s7UUo8uRWob=K9nedcB+xP85rcyM5WPrQ@mail.gmail.com>
In-Reply-To
<m2txsyqwdi.fsf@igel.home>
On Fri, Nov 9, 2012 at 10:50 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Unknown <unknown@unknown.invalid> writes:

Unknown Invalid? Please don't change the original email, makes it harder for other people to reply.

Show 17 quoted lines
>> I need a command or command sequence that will commit an entire file
>> tree to a repository...
>>
>> (a) Allowing me to specify committer and author metadata, and
>>
>> (b) deleting paths not present in the previous commit on the current
>> branch, and
>>
>> (c) allowing me to specify merge links from other previous commits.
>>
>> git commit -a passes (a) and (b) but not (c).
>
> git commit -a won't add new files, so you probably want to use git add
> -A && git commit.  I'm not quite sure what you mean with "merge links",
> but if you want to create merge commits the you'll need to resort to
> plumbing: git add -A && git write-tree && git commit-tree && git
> update-ref.

I've done something similar, except that I used git hash-object instead of git commit-tree so that I can specify every single detail about the commit object.

Cheers.
-- 
Felipe Contreras
Previous: Andreas SchwabNext: Junio C Hamano
Message 3 of 5 in “Help requested - trying to build a tool doing whole-tree commits”
  1. UnknownNov 9, 2012
  2. Andreas SchwabNov 9, 2012
  3. Felipe ContrerasNov 10, 2012
  4. Junio C HamanoNov 10, 2012
  5. Eric S. RaymondNov 11, 2012

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.