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

Re: [Q] `git push', branch management, and "(forced update)"?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 24, 2009, 16:31 UTC
Message-ID
<7v8wjhwq40.fsf@alter.siamese.dyndns.org>
In-Reply-To
<200906241034.18550.brian.foster@innova-card.com>
Brian Foster <brian.foster@innova-card.com> writes:
Show 18 quoted lines
>    L is a clone of M, where other work has also been committed,
>    in master.  So now-and-then my colleague pulls M into L:
>
>      o--o--o--o--*--* master
>                \
>                 r--r--f--f TOPIC
>
>   My colleague then pushes the result to B.  End result is B
>   is essentially M plus TOPIC.
>
>    As it happens (mostly by design), the changes on TOPIC
>   are independent of the `*' ones on master.  So, working
>   in L, my colleague often rebases, and this is (always?)
>   a fast-forward:
>
>      o--o--o--o--*--* master
>                      \
>                       r--r--f--f TOPIC

When he rebases the TOPIC, he is not making this topology. Instead, this is what he is making:

                       r'-r'-f'-f' TOPIC
                      /
      o--o--o--o--*--* master
                \
                 r--r--f--f

The tip of the TOPIC before (the rightmost commit on the lower side branch in this picture) is not an ancestor of the tip of the TOPIC after the rebase. It is not a fast-forward.

>    In a simple simulation test I tried, it not only worked
>   for me, but the subsequent pull from simulated-B into
>   simulated-R said the TOPIC was a "(forced update)".
>   What does that mean?

The remote side B (and its mirror R) still points at the rightmost commit on the lower side branch with TOPIC. He forces a non-fast-forward push to B using "+:" (that is "leading plus to force a push" followed by "solitary colon to mean push matching refs"), violating a simple rule "do not rebase what others already have seen". Push from B to its mirror R then will be in the same situation.

This may be a good food-for-thought:
    http://www.mail-archive.com/dri-devel@lists.sourceforge.net/msg39091.html

Incidentally the message explains why it would be bad if your "now-and-then" above is too often.

Previous: Brian Foster
Message 2 of 2 in “[Q] `git push', branch management, and "(forced update)"?”
  1. Brian FosterJun 24, 2009
  2. Junio C HamanoJun 24, 2009

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.