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

Re: [RFC/PATCH] Additional fast forward strategies.

From
Jakub Narebski <jnareb@gmail.com>
Date
Mar 11, 2008, 09:09 UTC
Message-ID
<m37ig9zky7.fsf@localhost.localdomain>
In-Reply-To
<402c10cd0803102004x7892f01cledfef6f277fba26a@mail.gmail.com>
"Sverre Hvammen Johansen" <hvammen@gmail.com> writes:
Show 6 quoted lines
> From: Sverre Hvammen Johansen <hvammen@gmail.com>
> Subject: [PATCH] Additional fast forward strategies.
> 
> New fast forward strategies, common, fork, path, and same
> is introduced.  These new fast forward strategies allows
> additional work flows.
It would be better (read: greater chance to be accepted) if you had
provided examples of those "additional workflows", best in EXAMPLES
section (or something like that) of fast-forward documentation, and
"see documentation" (or something like that) in commit message.
 
> FF strategy "common" does a fast-forward to the common ancestor
> of the specified heads.  The merge will fail unless HEAD is the
> common ancestor or HEAD can be fast-forwarded to the common ancestor.
Don't you mean "common descendant" here?
> FF strategy "fork" does a fast-forward to the common ancestor
> of the real heads.  The merge will fail unless HEAD is the
> common ancestor of these heads or HEAD can be fast-forwarded
> to the common ancestor of the real heads.

What is the difference between 'real heads' and 'soecified heads'? Example, please.

Show 10 quoted lines
> FF strategy "path" does a fast-forward to the first possible
> branch that no other branches are ahead of.  HEAD will be
> fast-forwarded to such a branch if it exist.  If no such branch
> exist, HEAD is considered to be up to date.
> 
> FF strategy "same" does a fast forward where all branches are
> required to point to the same commit.  HEAD will be
> fast-forwarded to this branch unless it is up to date.
> 
> Signed-off-by: Sverre Hvammen Johansen <sj@black.local>

It will be easier to understand those descriptions if you have provided with ASCII-art diagrams (in the documentation, not necessarily in fast-forward strategies^W options description, but perhaps somewhere below, above FAST-FORWARD OPTIONS EXAMPLES section).

For example, by default you can fast-forward only when doing single branch merge.

%%
  A---B---C---D   <--- master <--- HEAD
       \
        \-1---2   <--- a

If you have situation as above, you are on branch 'master', and you do "git merge a" it would result in merge commit.

  A---B---C---D---M   <--- master <--- HEAD
       \         /
        \-1---2-/     <--- a
%%
  A---B           <--- master <--- HEAD
       \
        \-1---2   <--- a

If you have situation as above, you are on branch 'master', and you do "git merge a" it would result in fast-forward.

  A---B---1---2   <--- master <--- HEAD
                    
              ^------- a
or
  A---B---1---2   <--- master <--- HEAD
              ^      
               \------ a
%%
  A---B           <--- master <--- HEAD
       \
        \-1---2   <--- a
              
              ^------- b
This I think is 'FF strategy "same"' situation.
%%
  A---B              <--- master <--- HEAD
       \
        \-1---2      <--- a
               \
                \-3  <--- b
This I guess is either 'common' or 'fork' situation.
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Junio C HamanoNext: Sverre Hvammen Johansen
Message 3 of 4 in “Additional fast forward strategies.”
  1. Additional fast forward strategies.Sverre Hvammen Johansen, Mar 11, 2008
  2. Junio C HamanoMar 11, 2008
  3. Jakub NarebskiMar 11, 2008
  4. Sverre Hvammen JohansenMar 12, 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.