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

Re: [PATCH] fast-import: Document the effect of "merge" with no "from" in a commit

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 20, 2008, 03:40 UTC
Message-ID
<20080320034031.GX8410@spearce.org>
In-Reply-To
<9A41E5AD-2305-457B-A214-7A11A1B559F6@orakel.ntnu.no>
Eyvind Bernhardsen <eyvind-git@orakel.ntnu.no> wrote:
Show 8 quoted lines
> @@ -385,9 +385,11 @@ new commit.
>  Omitting the `from` command in the first commit of a new branch
>  will cause fast-import to create that commit with no ancestor. This
>  tends to be desired only for the initial commit of a project.
> -Omitting the `from` command on existing branches is usually desired,
> +Including the `from` command on existing branches is usually desired,
>  as the current commit on that branch is automatically assumed to
>  be the first ancestor of the new commit.

I disagree with this. Omitting is the correct term here as you usually do not want a 'from' commit, as you usually want it to automatically use the prior commit made on this branch.

As I understand it, this discussion about leaving out 'from' and using 'merge' is only relevant on a *new* branch.

> +If the frontend creates all files from scratch when making a new
> +commit, a `merge` command may be used instead.
This is fine.
 
Show 19 quoted lines
>  As `LF` is not valid in a Git refname or SHA-1 expression, no
>  quoting or escaping syntax is supported within `<committish>`.
> @@ -427,13 +429,15 @@ existing value of the branch.
> 
>  `merge`
>  ^^^^^^^
> -Includes one additional ancestor commit, and makes the current
> -commit a merge commit.  An unlimited number of `merge` commands per
> +Includes one additional ancestor commit.  In the absence of a `from`
> +command, the first `merge` commit will be the first ancestor of the
> +current commit, and the commit will start out with no files.  An
> +unlimited number of `merge` commands per
>  commit are permitted by fast-import, thereby establishing an n-way  
> merge.
>  However Git's other tools never create commits with more than 15
>  additional ancestors (forming a 16-way merge).  For this reason
>  it is suggested that frontends do not use more than 15 `merge`
> -commands per commit.
> +commands per commit; 16, if `from` is not used.
These updates are also fine.
-- 
Shawn.
Previous: James WestbyNext: Eyvind Bernhardsen
Message 5 of 9 in “"commit"s without "from" in fast-import”
  1. Eyvind BernhardsenMar 17, 2008
  2. Shawn O. PearceMar 18, 2008
  3. Shawn O. PearceMar 19, 2008
  4. James WestbyMar 19, 2008
  5. Shawn O. PearceMar 20, 2008
  6. Eyvind BernhardsenMar 21, 2008
  7. fast-import: Document the effect of "merge" with no "from" in a commitEyvind Bernhardsen, Mar 21, 2008
  8. Shawn O. PearceMar 23, 2008
  9. Junio C HamanoMar 23, 2008

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.