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

Re: Re* git pull --rebase should use fast forward merge if possible

From
Stefan Beller <sbeller@google.com>
Date
Dec 1, 2016, 18:24 UTC
Message-ID
<CAGZ79kZSEan5uXCUn4iVCWEc9zohMSr+UDyHDyQUHz84H=tR8w@mail.gmail.com>
In-Reply-To
<xmqqa8cfbkeq.fsf_-_@gitster.mtv.corp.google.com>
On Thu, Dec 1, 2016 at 9:59 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 11 quoted lines
> +test_expect_success '--rebase fast forward' '
> +       git reset --hard before-rebase &&
> +       git checkout -b ff &&
> +       echo another modification >file &&
> +       git commit -m third file &&
> +
> +       git checkout to-rebase &&
> +       git pull --rebase . ff &&
> +       test "$(git rev-parse HEAD)" = "$(git rev-parse ff)" &&
> +
> +       # The above only validates the result.  Did we actually bypass rebase?

Good catch for the test, but I think we can make the sed regexp simpler, as we can leave out the second "[0-9a-f]"? (git reflog |sed "s/^[0-9a-f]*/OBJID/" works here)

The implication of that we'd also match if there is no object id at all at the beginning, which sounds fine.

I shortly debated the idea to just cut off anything before the first space and then expect "HEAD@{0}: pull --rebase . ff: Fast-forward" only, but why cut off what we produce in the first place?

    git reflog --format="%s" -1 >actual &&
    echo "pull --rebase . ff: Fast-forward" >expect &&
    test_cmp expect actual
maybe?
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 9 in “git pull --rebase should use fast forward merge if possible”
  1. neuling@dakosy.deJun 29, 2016
  2. Junio C HamanoJun 29, 2016
  3. Junio C HamanoJun 29, 2016
  4. Stefan BellerJun 29, 2016
  5. Junio C HamanoJun 29, 2016
  6. Re* git pull --rebase should use fast forward merge if possibleJunio C Hamano, Dec 1, 2016
  7. Stefan BellerDec 1, 2016
  8. Junio C HamanoDec 1, 2016
  9. Stefan BellerDec 1, 2016

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.