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

Re: "git rebase" behavior change in 2.26.0

From
Elijah Newren <newren@gmail.com>
Date
Mar 26, 2020, 06:32 UTC
Message-ID
<CABPp-BFMN+pnOjEe2tZZJp3_Noojn5j1ip3dh8Xz9hCZoKJbxw@mail.gmail.com>
In-Reply-To
<CABPp-BHMMw+L6fgfdVEEXnhH0w0aK6KfKA9Aq+aSuzWD0Cgr8g@mail.gmail.com>
On Wed, Mar 25, 2020 at 8:37 PM Elijah Newren <newren@gmail.com> wrote:
Show 19 quoted lines
> Now, when I try to duplicate, just for fun I added some 'die("You ran
> a merge!")' and 'die("You ran a rebase!")' lines early in
> builtin/{merge,rebase}.c, just so I could verify what was run.  Then I
> tried to use a command line similar to yours:
>
> $ git -c rebase.backend=merge -c pull.rebase=false -c
> branch.master.rebase=true pull
> remote: Enumerating objects: 5, done.
> remote: Counting objects: 100% (5/5), done.
> remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
> Unpacking objects: 100% (3/3), 250 bytes | 250.00 KiB/s, done.
> From /home/newren/floss/git/testing/pull-rebase-orig-head/repo
>    c911eef..2ccdb90  master     -> origin/master
> fatal: You ran a merge!
> fatal: You ran a rebase!
>
>
> Say, WAT?!?  This attempted to run both a merge and a rebase?  That
> appears to be yet another bug.
From git-pull.c:
    ...
        if (is_descendant_of(merge_head, list)) {
            /* we can fast-forward this without invoking rebase */
            opt_ff = "--ff-only";
            ret = run_merge();
        }
    }
    ret = run_rebase(&curr_head, merge_heads.oid, &rebase_fork_point);
Perhaps that comment should read:
   /* we can fast-forward this using merge and avoid rebase...but then
run rebase afterward anyway! */
Whoops.  Perhaps fixing this is a good micro-project candidate?  Too small?
Previous: Elijah NewrenNext: Jeff King
Message 7 of 11 in “"git rebase" behavior change in 2.26.0”
  1. Norbert KieselMar 25, 2020
  2. Jeff KingMar 25, 2020
  3. Elijah NewrenMar 25, 2020
  4. Norbert KieselMar 26, 2020
  5. Norbert KieselMar 26, 2020
  6. Elijah NewrenMar 26, 2020
  7. Elijah NewrenMar 26, 2020
  8. Jeff KingMar 26, 2020
  9. Norbert KieselMar 27, 2020
  10. Elijah NewrenMar 27, 2020
  11. Elijah NewrenMar 27, 2020

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.