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

Re: commit/from command in git-fast-import

From
David Barr <davidbarr@google.com>
Date
Jan 27, 2012, 14:00 UTC
Message-ID
<CAFfmPPPYc=9BdwuE+ANiHKrFk+_7aXDgnMv3fHxVmF0ttZu8bA@mail.gmail.com>
In-Reply-To
<20120127124837.GA24084@glandium.org>
On Fri, Jan 27, 2012 at 11:48 PM, Mike Hommey <mh@glandium.org> wrote:
Show 16 quoted lines
> When I do create a commit on a given branch with a stream like:
>  commit refs/heads/branch
>  author ...
>  committer ...
>  data <<EOF
>  Commit message
>  EOF
>  deleteall
>
> All I get is this warning:
>  warning: Not updating refs/heads/branch (new tip new_sha1
> does not contain old_sha1)
>
> And the branch only has one commit, which is the one I just created.
> On the other hand, if I add a "from" instruction in the above stream,
> I have the expected branch history.

This is precisely the expected behavior. If 'from' is omitted, the resulting commit has no preceding history. On the other hand, what you want is to specify the parent so that there is a continuation of history.

I hope this helps. -- David Barr

Previous: Mike HommeyNext: Mike Hommey
Message 2 of 6 in “commit/from command in git-fast-import”
  1. Mike HommeyJan 27, 2012
  2. David BarrJan 27, 2012
  3. Mike HommeyJan 27, 2012
  4. David BarrJan 27, 2012
  5. Jonathan NiederJan 27, 2012
  6. Sverre RabbelierJan 30, 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.